mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 04:31:09 +00:00
gtk: Remove menu code
GtkMenu, GtkMenuBar, GtkMenuItem and their subclasses and supporting classes are replaced by model-based popover implementations.
This commit is contained in:
parent
53d9445715
commit
7ee5779efc
@ -217,12 +217,6 @@
|
|||||||
<title>Menus, Combo Box, Toolbar</title>
|
<title>Menus, Combo Box, Toolbar</title>
|
||||||
<xi:include href="xml/gtkcombobox.xml" />
|
<xi:include href="xml/gtkcombobox.xml" />
|
||||||
<xi:include href="xml/gtkcomboboxtext.xml" />
|
<xi:include href="xml/gtkcomboboxtext.xml" />
|
||||||
<xi:include href="xml/gtkmenu.xml" />
|
|
||||||
<xi:include href="xml/gtkmenubar.xml" />
|
|
||||||
<xi:include href="xml/gtkmenuitem.xml" />
|
|
||||||
<xi:include href="xml/gtkradiomenuitem.xml" />
|
|
||||||
<xi:include href="xml/gtkcheckmenuitem.xml" />
|
|
||||||
<xi:include href="xml/gtkseparatormenuitem.xml" />
|
|
||||||
<xi:include href="xml/gtktoolshell.xml" />
|
<xi:include href="xml/gtktoolshell.xml" />
|
||||||
<xi:include href="xml/gtktoolbar.xml" />
|
<xi:include href="xml/gtktoolbar.xml" />
|
||||||
<xi:include href="xml/gtktoolitem.xml" />
|
<xi:include href="xml/gtktoolitem.xml" />
|
||||||
@ -311,7 +305,6 @@
|
|||||||
<xi:include href="xml/gtkwidget.xml" />
|
<xi:include href="xml/gtkwidget.xml" />
|
||||||
<xi:include href="xml/gtkcontainer.xml" />
|
<xi:include href="xml/gtkcontainer.xml" />
|
||||||
<xi:include href="xml/gtkbin.xml" />
|
<xi:include href="xml/gtkbin.xml" />
|
||||||
<xi:include href="xml/gtkmenushell.xml" />
|
|
||||||
<xi:include href="xml/gtkrange.xml" />
|
<xi:include href="xml/gtkrange.xml" />
|
||||||
<xi:include href="xml/gtkimcontext.xml" />
|
<xi:include href="xml/gtkimcontext.xml" />
|
||||||
<xi:include href="xml/gtknativedialog.xml" />
|
<xi:include href="xml/gtknativedialog.xml" />
|
||||||
|
@ -674,34 +674,6 @@ GTK_CHECK_BUTTON_GET_CLASS
|
|||||||
gtk_check_button_get_type
|
gtk_check_button_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkcheckmenuitem</FILE>
|
|
||||||
GtkCheckMenuItem
|
|
||||||
GtkCheckMenuItemClass
|
|
||||||
<TITLE>GtkCheckMenuItem</TITLE>
|
|
||||||
gtk_check_menu_item_new
|
|
||||||
gtk_check_menu_item_new_with_label
|
|
||||||
gtk_check_menu_item_new_with_mnemonic
|
|
||||||
gtk_check_menu_item_get_active
|
|
||||||
gtk_check_menu_item_set_active
|
|
||||||
gtk_check_menu_item_toggled
|
|
||||||
gtk_check_menu_item_get_inconsistent
|
|
||||||
gtk_check_menu_item_set_inconsistent
|
|
||||||
gtk_check_menu_item_set_draw_as_radio
|
|
||||||
gtk_check_menu_item_get_draw_as_radio
|
|
||||||
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_CHECK_MENU_ITEM
|
|
||||||
GTK_IS_CHECK_MENU_ITEM
|
|
||||||
GTK_TYPE_CHECK_MENU_ITEM
|
|
||||||
GTK_CHECK_MENU_ITEM_CLASS
|
|
||||||
GTK_IS_CHECK_MENU_ITEM_CLASS
|
|
||||||
GTK_CHECK_MENU_ITEM_GET_CLASS
|
|
||||||
<SUBSECTION Private>
|
|
||||||
GtkCheckMenuItemPrivate
|
|
||||||
gtk_check_menu_item_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gtkcolorbutton</FILE>
|
<FILE>gtkcolorbutton</FILE>
|
||||||
<TITLE>GtkColorButton</TITLE>
|
<TITLE>GtkColorButton</TITLE>
|
||||||
@ -1830,66 +1802,6 @@ GTK_MAP_LIST_MODEL_GET_CLASS
|
|||||||
gtk_map_list_model_get_type
|
gtk_map_list_model_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkmenu</FILE>
|
|
||||||
<TITLE>GtkMenu</TITLE>
|
|
||||||
GtkMenu
|
|
||||||
gtk_menu_new
|
|
||||||
gtk_menu_new_from_model
|
|
||||||
GtkPopoverMenuFlags
|
|
||||||
gtk_menu_reorder_child
|
|
||||||
gtk_menu_popup_at_rect
|
|
||||||
gtk_menu_popup_at_widget
|
|
||||||
gtk_menu_popup_at_pointer
|
|
||||||
gtk_menu_set_accel_group
|
|
||||||
gtk_menu_get_accel_group
|
|
||||||
gtk_menu_set_accel_path
|
|
||||||
gtk_menu_get_accel_path
|
|
||||||
gtk_menu_set_monitor
|
|
||||||
gtk_menu_get_monitor
|
|
||||||
gtk_menu_place_on_monitor
|
|
||||||
gtk_menu_set_reserve_toggle_size
|
|
||||||
gtk_menu_get_reserve_toggle_size
|
|
||||||
<SUBSECTION>
|
|
||||||
gtk_menu_popdown
|
|
||||||
gtk_menu_reposition
|
|
||||||
gtk_menu_get_active
|
|
||||||
gtk_menu_set_active
|
|
||||||
gtk_menu_attach_to_widget
|
|
||||||
gtk_menu_detach
|
|
||||||
gtk_menu_get_attach_widget
|
|
||||||
gtk_menu_get_for_attach_widget
|
|
||||||
GtkMenuDetachFunc
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_MENU
|
|
||||||
GTK_IS_MENU
|
|
||||||
GTK_TYPE_MENU
|
|
||||||
GTK_MENU_CLASS
|
|
||||||
GTK_IS_MENU_CLASS
|
|
||||||
GTK_MENU_GET_CLASS
|
|
||||||
<SUBSECTION Private>
|
|
||||||
GtkMenuPrivate
|
|
||||||
gtk_menu_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkmenubar</FILE>
|
|
||||||
<TITLE>GtkMenuBar</TITLE>
|
|
||||||
GtkMenuBar
|
|
||||||
gtk_menu_bar_new
|
|
||||||
gtk_menu_bar_new_from_model
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_MENU_BAR
|
|
||||||
GTK_IS_MENU_BAR
|
|
||||||
GTK_TYPE_MENU_BAR
|
|
||||||
GTK_MENU_BAR_CLASS
|
|
||||||
GTK_IS_MENU_BAR_CLASS
|
|
||||||
GTK_MENU_BAR_GET_CLASS
|
|
||||||
<SUBSECTION Private>
|
|
||||||
GtkMenuBarPrivate
|
|
||||||
gtk_menu_bar_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gtkmenubutton</FILE>
|
<FILE>gtkmenubutton</FILE>
|
||||||
<TITLE>GtkMenuButton</TITLE>
|
<TITLE>GtkMenuButton</TITLE>
|
||||||
@ -1925,72 +1837,6 @@ GtkMenuButtonPrivate
|
|||||||
gtk_menu_button_get_type
|
gtk_menu_button_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkmenuitem</FILE>
|
|
||||||
<TITLE>GtkMenuItem</TITLE>
|
|
||||||
GtkMenuItem
|
|
||||||
GtkMenuItemClass
|
|
||||||
gtk_menu_item_new
|
|
||||||
gtk_menu_item_new_with_label
|
|
||||||
gtk_menu_item_new_with_mnemonic
|
|
||||||
gtk_menu_item_get_label
|
|
||||||
gtk_menu_item_set_label
|
|
||||||
gtk_menu_item_get_use_underline
|
|
||||||
gtk_menu_item_set_use_underline
|
|
||||||
gtk_menu_item_set_submenu
|
|
||||||
gtk_menu_item_get_submenu
|
|
||||||
gtk_menu_item_set_accel_path
|
|
||||||
gtk_menu_item_get_accel_path
|
|
||||||
gtk_menu_item_select
|
|
||||||
gtk_menu_item_deselect
|
|
||||||
gtk_menu_item_activate
|
|
||||||
gtk_menu_item_toggle_size_request
|
|
||||||
gtk_menu_item_toggle_size_allocate
|
|
||||||
gtk_menu_item_get_reserve_indicator
|
|
||||||
gtk_menu_item_set_reserve_indicator
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_MENU_ITEM
|
|
||||||
GTK_IS_MENU_ITEM
|
|
||||||
GTK_TYPE_MENU_ITEM
|
|
||||||
GTK_MENU_ITEM_CLASS
|
|
||||||
GTK_IS_MENU_ITEM_CLASS
|
|
||||||
GTK_MENU_ITEM_GET_CLASS
|
|
||||||
<SUBSECTION Private>
|
|
||||||
GtkMenuItemPrivate
|
|
||||||
gtk_menu_item_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkmenushell</FILE>
|
|
||||||
<TITLE>GtkMenuShell</TITLE>
|
|
||||||
GtkMenuShell
|
|
||||||
gtk_menu_shell_append
|
|
||||||
gtk_menu_shell_prepend
|
|
||||||
gtk_menu_shell_insert
|
|
||||||
gtk_menu_shell_deactivate
|
|
||||||
gtk_menu_shell_select_item
|
|
||||||
gtk_menu_shell_select_first
|
|
||||||
gtk_menu_shell_deselect
|
|
||||||
gtk_menu_shell_activate_item
|
|
||||||
gtk_menu_shell_cancel
|
|
||||||
gtk_menu_shell_set_take_focus
|
|
||||||
gtk_menu_shell_get_take_focus
|
|
||||||
gtk_menu_shell_get_selected_item
|
|
||||||
gtk_menu_shell_get_parent_shell
|
|
||||||
gtk_menu_shell_bind_model
|
|
||||||
GtkMenuDirectionType
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_MENU_SHELL
|
|
||||||
GTK_IS_MENU_SHELL
|
|
||||||
GTK_TYPE_MENU_SHELL
|
|
||||||
GTK_MENU_SHELL_CLASS
|
|
||||||
GTK_IS_MENU_SHELL_CLASS
|
|
||||||
GTK_MENU_SHELL_GET_CLASS
|
|
||||||
<SUBSECTION Private>
|
|
||||||
GtkMenuShellPrivate
|
|
||||||
gtk_menu_shell_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gtkmessagedialog</FILE>
|
<FILE>gtkmessagedialog</FILE>
|
||||||
<TITLE>GtkMessageDialog</TITLE>
|
<TITLE>GtkMessageDialog</TITLE>
|
||||||
@ -2253,31 +2099,6 @@ GtkRadioButtonPrivate
|
|||||||
gtk_radio_button_get_type
|
gtk_radio_button_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkradiomenuitem</FILE>
|
|
||||||
<TITLE>GtkRadioMenuItem</TITLE>
|
|
||||||
GtkRadioMenuItem
|
|
||||||
gtk_radio_menu_item_new
|
|
||||||
gtk_radio_menu_item_new_with_label
|
|
||||||
gtk_radio_menu_item_new_with_mnemonic
|
|
||||||
gtk_radio_menu_item_new_from_widget
|
|
||||||
gtk_radio_menu_item_new_with_label_from_widget
|
|
||||||
gtk_radio_menu_item_new_with_mnemonic_from_widget
|
|
||||||
gtk_radio_menu_item_set_group
|
|
||||||
gtk_radio_menu_item_get_group
|
|
||||||
gtk_radio_menu_item_join_group
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_RADIO_MENU_ITEM
|
|
||||||
GTK_IS_RADIO_MENU_ITEM
|
|
||||||
GTK_TYPE_RADIO_MENU_ITEM
|
|
||||||
GTK_RADIO_MENU_ITEM_CLASS
|
|
||||||
GTK_IS_RADIO_MENU_ITEM_CLASS
|
|
||||||
GTK_RADIO_MENU_ITEM_GET_CLASS
|
|
||||||
<SUBSECTION Private>
|
|
||||||
GtkRadioMenuItemPrivate
|
|
||||||
gtk_radio_menu_item_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gtkrange</FILE>
|
<FILE>gtkrange</FILE>
|
||||||
<TITLE>GtkRange</TITLE>
|
<TITLE>GtkRange</TITLE>
|
||||||
@ -2584,22 +2405,6 @@ gtk_separator_get_type
|
|||||||
GtkSeparatorPrivate
|
GtkSeparatorPrivate
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gtkseparatormenuitem</FILE>
|
|
||||||
<TITLE>GtkSeparatorMenuItem</TITLE>
|
|
||||||
GtkSeparatorMenuItem
|
|
||||||
gtk_separator_menu_item_new
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
GTK_SEPARATOR_MENU_ITEM
|
|
||||||
GTK_SEPARATOR_MENU_ITEM_CLASS
|
|
||||||
GTK_SEPARATOR_MENU_ITEM_GET_CLASS
|
|
||||||
GTK_IS_SEPARATOR_MENU_ITEM
|
|
||||||
GTK_IS_SEPARATOR_MENU_ITEM_CLASS
|
|
||||||
GTK_TYPE_SEPARATOR_MENU_ITEM
|
|
||||||
<SUBSECTION Private>
|
|
||||||
gtk_separator_menu_item_get_type
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gtksettings</FILE>
|
<FILE>gtksettings</FILE>
|
||||||
<TITLE>GtkSettings</TITLE>
|
<TITLE>GtkSettings</TITLE>
|
||||||
|
@ -44,7 +44,6 @@ gtk_cell_renderer_text_get_type
|
|||||||
gtk_cell_renderer_toggle_get_type
|
gtk_cell_renderer_toggle_get_type
|
||||||
gtk_cell_view_get_type
|
gtk_cell_view_get_type
|
||||||
gtk_check_button_get_type
|
gtk_check_button_get_type
|
||||||
gtk_check_menu_item_get_type
|
|
||||||
gtk_color_button_get_type
|
gtk_color_button_get_type
|
||||||
gtk_color_chooser_get_type
|
gtk_color_chooser_get_type
|
||||||
gtk_color_chooser_dialog_get_type
|
gtk_color_chooser_dialog_get_type
|
||||||
@ -119,11 +118,7 @@ gtk_map_list_model_get_type
|
|||||||
gtk_media_controls_get_type
|
gtk_media_controls_get_type
|
||||||
gtk_media_file_get_type
|
gtk_media_file_get_type
|
||||||
gtk_media_stream_get_type
|
gtk_media_stream_get_type
|
||||||
gtk_menu_bar_get_type
|
|
||||||
gtk_menu_button_get_type
|
gtk_menu_button_get_type
|
||||||
gtk_menu_get_type
|
|
||||||
gtk_menu_item_get_type
|
|
||||||
gtk_menu_shell_get_type
|
|
||||||
gtk_menu_tool_button_get_type
|
gtk_menu_tool_button_get_type
|
||||||
gtk_message_dialog_get_type
|
gtk_message_dialog_get_type
|
||||||
gtk_mount_operation_get_type
|
gtk_mount_operation_get_type
|
||||||
@ -152,7 +147,6 @@ gtk_print_settings_get_type
|
|||||||
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
|
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
|
||||||
gtk_progress_bar_get_type
|
gtk_progress_bar_get_type
|
||||||
gtk_radio_button_get_type
|
gtk_radio_button_get_type
|
||||||
gtk_radio_menu_item_get_type
|
|
||||||
gtk_radio_tool_button_get_type
|
gtk_radio_tool_button_get_type
|
||||||
gtk_range_get_type
|
gtk_range_get_type
|
||||||
gtk_recent_manager_get_type
|
gtk_recent_manager_get_type
|
||||||
@ -167,7 +161,6 @@ gtk_search_bar_get_type
|
|||||||
gtk_search_entry_get_type
|
gtk_search_entry_get_type
|
||||||
gtk_selection_model_get_type
|
gtk_selection_model_get_type
|
||||||
gtk_separator_get_type
|
gtk_separator_get_type
|
||||||
gtk_separator_menu_item_get_type
|
|
||||||
gtk_separator_tool_item_get_type
|
gtk_separator_tool_item_get_type
|
||||||
gtk_settings_get_type
|
gtk_settings_get_type
|
||||||
gtk_shortcut_label_get_type
|
gtk_shortcut_label_get_type
|
||||||
|
@ -17,7 +17,6 @@ private_headers = [
|
|||||||
'gtkbuttonprivate.h',
|
'gtkbuttonprivate.h',
|
||||||
'gtkcellareaboxcontextprivate.h',
|
'gtkcellareaboxcontextprivate.h',
|
||||||
'gtkcheckbuttonprivate.h',
|
'gtkcheckbuttonprivate.h',
|
||||||
'gtkcheckmenuitemprivate.h',
|
|
||||||
'gtkcolorchooserprivate.h',
|
'gtkcolorchooserprivate.h',
|
||||||
'gtkcoloreditorprivate.h',
|
'gtkcoloreditorprivate.h',
|
||||||
'gtkcolorplaneprivate.h',
|
'gtkcolorplaneprivate.h',
|
||||||
@ -138,9 +137,6 @@ private_headers = [
|
|||||||
'gtkmagnifierprivate.h',
|
'gtkmagnifierprivate.h',
|
||||||
'gtkmediafileprivate.h',
|
'gtkmediafileprivate.h',
|
||||||
'gtkmenubuttonprivate.h',
|
'gtkmenubuttonprivate.h',
|
||||||
'gtkmenuitemprivate.h',
|
|
||||||
'gtkmenuprivate.h',
|
|
||||||
'gtkmenushellprivate.h',
|
|
||||||
'gtkmodulesprivate.h',
|
'gtkmodulesprivate.h',
|
||||||
'gtkmountoperationprivate.h',
|
'gtkmountoperationprivate.h',
|
||||||
'gtknativedialogprivate.h',
|
'gtknativedialogprivate.h',
|
||||||
|
@ -25,7 +25,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkBooleanCellAccessible, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkButtonAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkButtonAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAccessibleParent, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAccessibleParent, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCheckMenuItemAccessible, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkComboBoxAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkComboBoxAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkContainerAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkContainerAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkContainerCellAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkContainerCellAccessible, g_object_unref)
|
||||||
@ -43,17 +42,13 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLinkButtonAccessible, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListBoxAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListBoxAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListBoxRowAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListBoxRowAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLockButtonAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLockButtonAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuAccessible, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuButtonAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuButtonAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuItemAccessible, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuShellAccessible, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkNotebookAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkNotebookAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkNotebookPageAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkNotebookPageAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPanedAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPanedAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPopoverAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPopoverAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkProgressBarAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkProgressBarAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioButtonAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioButtonAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioMenuItemAccessible, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRangeAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRangeAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRendererCellAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRendererCellAccessible, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScaleAccessible, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScaleAccessible, g_object_unref)
|
||||||
|
@ -1,128 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2002 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include "gtkcheckmenuitemaccessible.h"
|
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkCheckMenuItemAccessible, gtk_check_menu_item_accessible, GTK_TYPE_MENU_ITEM_ACCESSIBLE)
|
|
||||||
|
|
||||||
static void
|
|
||||||
toggled_cb (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
AtkObject *accessible;
|
|
||||||
GtkCheckMenuItem *check_menu_item;
|
|
||||||
gboolean active;
|
|
||||||
|
|
||||||
check_menu_item = GTK_CHECK_MENU_ITEM (widget);
|
|
||||||
active = gtk_check_menu_item_get_active (check_menu_item);
|
|
||||||
|
|
||||||
accessible = gtk_widget_get_accessible (widget);
|
|
||||||
atk_object_notify_state_change (accessible, ATK_STATE_CHECKED, active);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_accessible_initialize (AtkObject *obj,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ATK_OBJECT_CLASS (gtk_check_menu_item_accessible_parent_class)->initialize (obj, data);
|
|
||||||
|
|
||||||
g_signal_connect (data, "toggled", G_CALLBACK (toggled_cb), NULL);
|
|
||||||
|
|
||||||
obj->role = ATK_ROLE_CHECK_MENU_ITEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkStateSet *
|
|
||||||
gtk_check_menu_item_accessible_ref_state_set (AtkObject *accessible)
|
|
||||||
{
|
|
||||||
AtkStateSet *state_set;
|
|
||||||
GtkCheckMenuItem *check_menu_item;
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
state_set = ATK_OBJECT_CLASS (gtk_check_menu_item_accessible_parent_class)->ref_state_set (accessible);
|
|
||||||
|
|
||||||
check_menu_item = GTK_CHECK_MENU_ITEM (widget);
|
|
||||||
|
|
||||||
if (gtk_check_menu_item_get_active (check_menu_item))
|
|
||||||
atk_state_set_add_state (state_set, ATK_STATE_CHECKED);
|
|
||||||
|
|
||||||
if (gtk_check_menu_item_get_inconsistent (check_menu_item))
|
|
||||||
{
|
|
||||||
atk_state_set_remove_state (state_set, ATK_STATE_ENABLED);
|
|
||||||
atk_state_set_add_state (state_set, ATK_STATE_INDETERMINATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return state_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_accessible_notify_gtk (GObject *obj,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (obj);
|
|
||||||
AtkObject *atk_obj;
|
|
||||||
gboolean sensitive;
|
|
||||||
gboolean inconsistent;
|
|
||||||
gboolean active;
|
|
||||||
|
|
||||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (check_menu_item));
|
|
||||||
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item));
|
|
||||||
inconsistent = gtk_check_menu_item_get_inconsistent (check_menu_item);
|
|
||||||
active = gtk_check_menu_item_get_active (check_menu_item);
|
|
||||||
|
|
||||||
if (strcmp (pspec->name, "inconsistent") == 0)
|
|
||||||
{
|
|
||||||
atk_object_notify_state_change (atk_obj, ATK_STATE_INDETERMINATE, inconsistent);
|
|
||||||
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, (sensitive && !inconsistent));
|
|
||||||
}
|
|
||||||
else if (strcmp (pspec->name, "sensitive") == 0)
|
|
||||||
{
|
|
||||||
/* Need to override gailwidget behavior of notifying for ENABLED */
|
|
||||||
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
|
|
||||||
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, (sensitive && !inconsistent));
|
|
||||||
}
|
|
||||||
else if (strcmp (pspec->name, "active") == 0)
|
|
||||||
{
|
|
||||||
atk_object_notify_state_change (atk_obj, ATK_STATE_CHECKED, active);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
GTK_WIDGET_ACCESSIBLE_CLASS (gtk_check_menu_item_accessible_parent_class)->notify_gtk (obj, pspec);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_accessible_class_init (GtkCheckMenuItemAccessibleClass *klass)
|
|
||||||
{
|
|
||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
|
||||||
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
|
||||||
|
|
||||||
widget_class->notify_gtk = gtk_check_menu_item_accessible_notify_gtk;
|
|
||||||
|
|
||||||
class->ref_state_set = gtk_check_menu_item_accessible_ref_state_set;
|
|
||||||
class->initialize = gtk_check_menu_item_accessible_initialize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_accessible_init (GtkCheckMenuItemAccessible *item)
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2002 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_CHECK_MENU_ITEM_ACCESSIBLE_H__
|
|
||||||
#define __GTK_CHECK_MENU_ITEM_ACCESSIBLE_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/a11y/gtkmenuitemaccessible.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE (gtk_check_menu_item_accessible_get_type ())
|
|
||||||
#define GTK_CHECK_MENU_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, GtkCheckMenuItemAccessible))
|
|
||||||
#define GTK_CHECK_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, GtkCheckMenuItemAccessibleClass))
|
|
||||||
#define GTK_IS_CHECK_MENU_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE))
|
|
||||||
#define GTK_IS_CHECK_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE))
|
|
||||||
#define GTK_CHECK_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, GtkCheckMenuItemAccessibleClass))
|
|
||||||
|
|
||||||
typedef struct _GtkCheckMenuItemAccessible GtkCheckMenuItemAccessible;
|
|
||||||
typedef struct _GtkCheckMenuItemAccessibleClass GtkCheckMenuItemAccessibleClass;
|
|
||||||
typedef struct _GtkCheckMenuItemAccessiblePrivate GtkCheckMenuItemAccessiblePrivate;
|
|
||||||
|
|
||||||
struct _GtkCheckMenuItemAccessible
|
|
||||||
{
|
|
||||||
GtkMenuItemAccessible parent;
|
|
||||||
|
|
||||||
GtkCheckMenuItemAccessiblePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkCheckMenuItemAccessibleClass
|
|
||||||
{
|
|
||||||
GtkMenuItemAccessibleClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_check_menu_item_accessible_get_type (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_CHECK_MENU_ITEM_ACCESSIBLE_H__ */
|
|
@ -1,99 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "gtkmenuaccessible.h"
|
|
||||||
#include "gtkwidgetaccessibleprivate.h"
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkMenuAccessible, gtk_menu_accessible, GTK_TYPE_MENU_SHELL_ACCESSIBLE)
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_accessible_initialize (AtkObject *obj,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ATK_OBJECT_CLASS (gtk_menu_accessible_parent_class)->initialize (obj, data);
|
|
||||||
|
|
||||||
obj->role = ATK_ROLE_MENU;
|
|
||||||
|
|
||||||
_gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_POPUP);
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkObject *
|
|
||||||
gtk_menu_accessible_get_parent (AtkObject *accessible)
|
|
||||||
{
|
|
||||||
AtkObject *parent;
|
|
||||||
GtkWidget *widget, *parent_widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
parent = accessible->accessible_parent;
|
|
||||||
if (parent != NULL)
|
|
||||||
return parent;
|
|
||||||
|
|
||||||
/* If the menu is attached to a menu item or a button (Gnome Menu)
|
|
||||||
* report the menu item as parent.
|
|
||||||
*/
|
|
||||||
parent_widget = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
|
||||||
|
|
||||||
if (!GTK_IS_MENU_ITEM (parent_widget) &&
|
|
||||||
!GTK_IS_BUTTON (parent_widget) &&
|
|
||||||
!GTK_IS_COMBO_BOX (parent_widget))
|
|
||||||
parent_widget = gtk_widget_get_parent (widget);
|
|
||||||
|
|
||||||
if (parent_widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
parent = gtk_widget_get_accessible (parent_widget);
|
|
||||||
atk_object_set_parent (accessible, parent);
|
|
||||||
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_menu_accessible_get_index_in_parent (AtkObject *accessible)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
|
||||||
if (widget == NULL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (gtk_menu_get_attach_widget (GTK_MENU (widget)))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return ATK_OBJECT_CLASS (gtk_menu_accessible_parent_class)->get_index_in_parent (accessible);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_accessible_class_init (GtkMenuAccessibleClass *klass)
|
|
||||||
{
|
|
||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
class->get_parent = gtk_menu_accessible_get_parent;
|
|
||||||
class->get_index_in_parent = gtk_menu_accessible_get_index_in_parent;
|
|
||||||
class->initialize = gtk_menu_accessible_initialize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_accessible_init (GtkMenuAccessible *accessible)
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2001 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_ACCESSIBLE_H__
|
|
||||||
#define __GTK_MENU_ACCESSIBLE_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/a11y/gtkmenushellaccessible.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU_ACCESSIBLE (gtk_menu_accessible_get_type ())
|
|
||||||
#define GTK_MENU_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ACCESSIBLE, GtkMenuAccessible))
|
|
||||||
#define GTK_MENU_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_ACCESSIBLE, GtkMenuAccessibleClass))
|
|
||||||
#define GTK_IS_MENU_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_ACCESSIBLE))
|
|
||||||
#define GTK_IS_MENU_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ACCESSIBLE))
|
|
||||||
#define GTK_MENU_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ACCESSIBLE, GtkMenuAccessibleClass))
|
|
||||||
|
|
||||||
typedef struct _GtkMenuAccessible GtkMenuAccessible;
|
|
||||||
typedef struct _GtkMenuAccessibleClass GtkMenuAccessibleClass;
|
|
||||||
typedef struct _GtkMenuAccessiblePrivate GtkMenuAccessiblePrivate;
|
|
||||||
|
|
||||||
struct _GtkMenuAccessible
|
|
||||||
{
|
|
||||||
GtkMenuShellAccessible parent;
|
|
||||||
|
|
||||||
GtkMenuAccessiblePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuAccessibleClass
|
|
||||||
{
|
|
||||||
GtkMenuShellAccessibleClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_accessible_get_type (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_ACCESSIBLE_H__ */
|
|
@ -1,926 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2001, 2002, 2003 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <glib/gi18n-lib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include "gtkmenuitemaccessible.h"
|
|
||||||
#include "gtkwidgetaccessibleprivate.h"
|
|
||||||
#include "gtk/gtkmenuitemprivate.h"
|
|
||||||
|
|
||||||
struct _GtkMenuItemAccessiblePrivate
|
|
||||||
{
|
|
||||||
gchar *text;
|
|
||||||
gboolean selected;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define KEYBINDING_SEPARATOR ";"
|
|
||||||
|
|
||||||
static void menu_item_select (GtkMenuItem *item);
|
|
||||||
static void menu_item_deselect (GtkMenuItem *item);
|
|
||||||
|
|
||||||
static GtkWidget *get_label_from_container (GtkWidget *container);
|
|
||||||
static gchar *get_text_from_label_widget (GtkWidget *widget);
|
|
||||||
|
|
||||||
static gint menu_item_insert_gtk (GtkMenuShell *shell,
|
|
||||||
GtkWidget *widget,
|
|
||||||
gint position);
|
|
||||||
static gint menu_item_remove_gtk (GtkContainer *container,
|
|
||||||
GtkWidget *widget);
|
|
||||||
|
|
||||||
static void atk_action_interface_init (AtkActionIface *iface);
|
|
||||||
static void atk_selection_interface_init (AtkSelectionIface *iface);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GtkMenuItemAccessible, gtk_menu_item_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
|
|
||||||
G_ADD_PRIVATE (GtkMenuItemAccessible)
|
|
||||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init);
|
|
||||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_item_accessible_initialize (AtkObject *obj,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *parent;
|
|
||||||
GtkWidget *menu;
|
|
||||||
|
|
||||||
ATK_OBJECT_CLASS (gtk_menu_item_accessible_parent_class)->initialize (obj, data);
|
|
||||||
g_signal_connect (data, "select", G_CALLBACK (menu_item_select), NULL);
|
|
||||||
g_signal_connect (data, "deselect", G_CALLBACK (menu_item_deselect), NULL);
|
|
||||||
|
|
||||||
widget = GTK_WIDGET (data);
|
|
||||||
if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_PRELIGHT) != 0)
|
|
||||||
GTK_MENU_ITEM_ACCESSIBLE (obj)->priv->selected = TRUE;
|
|
||||||
|
|
||||||
parent = gtk_widget_get_parent (widget);
|
|
||||||
if (GTK_IS_MENU (parent))
|
|
||||||
{
|
|
||||||
GtkWidget *parent_widget;
|
|
||||||
|
|
||||||
parent_widget = gtk_menu_get_attach_widget (GTK_MENU (parent));
|
|
||||||
|
|
||||||
if (!GTK_IS_MENU_ITEM (parent_widget))
|
|
||||||
parent_widget = gtk_widget_get_parent (widget);
|
|
||||||
if (parent_widget)
|
|
||||||
atk_object_set_parent (obj, gtk_widget_get_accessible (parent_widget));
|
|
||||||
}
|
|
||||||
|
|
||||||
_gtk_widget_accessible_set_layer (GTK_WIDGET_ACCESSIBLE (obj), ATK_LAYER_POPUP);
|
|
||||||
|
|
||||||
obj->role = ATK_ROLE_MENU_ITEM;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (data));
|
|
||||||
if (menu)
|
|
||||||
{
|
|
||||||
g_signal_connect (menu, "insert", G_CALLBACK (menu_item_insert_gtk), NULL);
|
|
||||||
g_signal_connect (menu, "remove", G_CALLBACK (menu_item_remove_gtk), NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_menu_item_accessible_get_n_children (AtkObject *obj)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *submenu;
|
|
||||||
gint count = 0;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
|
||||||
if (widget == NULL)
|
|
||||||
return count;
|
|
||||||
|
|
||||||
submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (submenu)
|
|
||||||
{
|
|
||||||
GList *children;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (submenu));
|
|
||||||
count = g_list_length (children);
|
|
||||||
g_list_free (children);
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkObject *
|
|
||||||
gtk_menu_item_accessible_ref_child (AtkObject *obj,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
AtkObject *accessible;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *submenu;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
accessible = NULL;
|
|
||||||
submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (submenu)
|
|
||||||
{
|
|
||||||
GList *children;
|
|
||||||
GList *tmp_list;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (submenu));
|
|
||||||
tmp_list = g_list_nth (children, i);
|
|
||||||
if (tmp_list)
|
|
||||||
{
|
|
||||||
accessible = gtk_widget_get_accessible (GTK_WIDGET (tmp_list->data));
|
|
||||||
g_object_ref (accessible);
|
|
||||||
}
|
|
||||||
g_list_free (children);
|
|
||||||
}
|
|
||||||
|
|
||||||
return accessible;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkStateSet *
|
|
||||||
gtk_menu_item_accessible_ref_state_set (AtkObject *obj)
|
|
||||||
{
|
|
||||||
AtkObject *menu_item;
|
|
||||||
AtkStateSet *state_set, *parent_state_set;
|
|
||||||
|
|
||||||
state_set = ATK_OBJECT_CLASS (gtk_menu_item_accessible_parent_class)->ref_state_set (obj);
|
|
||||||
|
|
||||||
atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
|
|
||||||
if (GTK_MENU_ITEM_ACCESSIBLE (obj)->priv->selected)
|
|
||||||
atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
|
|
||||||
|
|
||||||
menu_item = atk_object_get_parent (obj);
|
|
||||||
|
|
||||||
if (menu_item)
|
|
||||||
{
|
|
||||||
if (!GTK_IS_MENU_ITEM (gtk_accessible_get_widget (GTK_ACCESSIBLE (menu_item))))
|
|
||||||
return state_set;
|
|
||||||
|
|
||||||
parent_state_set = atk_object_ref_state_set (menu_item);
|
|
||||||
if (!atk_state_set_contains_state (parent_state_set, ATK_STATE_SELECTED))
|
|
||||||
{
|
|
||||||
atk_state_set_remove_state (state_set, ATK_STATE_FOCUSED);
|
|
||||||
atk_state_set_remove_state (state_set, ATK_STATE_SHOWING);
|
|
||||||
}
|
|
||||||
g_object_unref (parent_state_set);
|
|
||||||
}
|
|
||||||
|
|
||||||
return state_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkRole
|
|
||||||
gtk_menu_item_accessible_get_role (AtkObject *obj)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
|
||||||
if (widget != NULL &&
|
|
||||||
gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget)))
|
|
||||||
return ATK_ROLE_MENU;
|
|
||||||
|
|
||||||
return ATK_OBJECT_CLASS (gtk_menu_item_accessible_parent_class)->get_role (obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const gchar *
|
|
||||||
gtk_menu_item_accessible_get_name (AtkObject *obj)
|
|
||||||
{
|
|
||||||
const gchar *name;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *label;
|
|
||||||
GtkMenuItemAccessible *accessible;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
name = ATK_OBJECT_CLASS (gtk_menu_item_accessible_parent_class)->get_name (obj);
|
|
||||||
if (name)
|
|
||||||
return name;
|
|
||||||
|
|
||||||
accessible = GTK_MENU_ITEM_ACCESSIBLE (obj);
|
|
||||||
label = get_label_from_container (widget);
|
|
||||||
|
|
||||||
g_free (accessible->priv->text);
|
|
||||||
accessible->priv->text = get_text_from_label_widget (label);
|
|
||||||
|
|
||||||
return accessible->priv->text;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_item_accessible_finalize (GObject *object)
|
|
||||||
{
|
|
||||||
GtkMenuItemAccessible *accessible = GTK_MENU_ITEM_ACCESSIBLE (object);
|
|
||||||
|
|
||||||
g_free (accessible->priv->text);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gtk_menu_item_accessible_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_item_accessible_notify_gtk (GObject *obj,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
AtkObject* atk_obj;
|
|
||||||
|
|
||||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (obj));
|
|
||||||
|
|
||||||
if (strcmp (pspec->name, "label") == 0)
|
|
||||||
{
|
|
||||||
if (atk_obj->name == NULL)
|
|
||||||
g_object_notify (G_OBJECT (atk_obj), "accessible-name");
|
|
||||||
g_signal_emit_by_name (atk_obj, "visible-data-changed");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
GTK_WIDGET_ACCESSIBLE_CLASS (gtk_menu_item_accessible_parent_class)->notify_gtk (obj, pspec);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_item_accessible_class_init (GtkMenuItemAccessibleClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
|
||||||
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
|
||||||
|
|
||||||
widget_class->notify_gtk = gtk_menu_item_accessible_notify_gtk;
|
|
||||||
|
|
||||||
gobject_class->finalize = gtk_menu_item_accessible_finalize;
|
|
||||||
|
|
||||||
class->get_n_children = gtk_menu_item_accessible_get_n_children;
|
|
||||||
class->ref_child = gtk_menu_item_accessible_ref_child;
|
|
||||||
class->ref_state_set = gtk_menu_item_accessible_ref_state_set;
|
|
||||||
class->initialize = gtk_menu_item_accessible_initialize;
|
|
||||||
class->get_name = gtk_menu_item_accessible_get_name;
|
|
||||||
class->get_role = gtk_menu_item_accessible_get_role;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_item_accessible_init (GtkMenuItemAccessible *menu_item)
|
|
||||||
{
|
|
||||||
menu_item->priv = gtk_menu_item_accessible_get_instance_private (menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
|
||||||
get_label_from_container (GtkWidget *container)
|
|
||||||
{
|
|
||||||
GtkWidget *label;
|
|
||||||
GList *children, *tmp_list;
|
|
||||||
|
|
||||||
if (!GTK_IS_CONTAINER (container))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (container));
|
|
||||||
label = NULL;
|
|
||||||
|
|
||||||
for (tmp_list = children; tmp_list != NULL; tmp_list = tmp_list->next)
|
|
||||||
{
|
|
||||||
if (GTK_IS_LABEL (tmp_list->data))
|
|
||||||
{
|
|
||||||
label = tmp_list->data;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (GTK_IS_CELL_VIEW (tmp_list->data))
|
|
||||||
{
|
|
||||||
label = tmp_list->data;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (GTK_IS_BOX (tmp_list->data))
|
|
||||||
{
|
|
||||||
label = get_label_from_container (GTK_WIDGET (tmp_list->data));
|
|
||||||
if (label)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_list_free (children);
|
|
||||||
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gchar *
|
|
||||||
get_text_from_label_widget (GtkWidget *label)
|
|
||||||
{
|
|
||||||
if (GTK_IS_LABEL (label))
|
|
||||||
return g_strdup (gtk_label_get_text (GTK_LABEL (label)));
|
|
||||||
else if (GTK_IS_CELL_VIEW (label))
|
|
||||||
{
|
|
||||||
GList *cells, *l;
|
|
||||||
GtkTreeModel *model;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
GtkTreePath *path;
|
|
||||||
GtkCellArea *area;
|
|
||||||
gchar *text;
|
|
||||||
|
|
||||||
model = gtk_cell_view_get_model (GTK_CELL_VIEW (label));
|
|
||||||
path = gtk_cell_view_get_displayed_row (GTK_CELL_VIEW (label));
|
|
||||||
gtk_tree_model_get_iter (model, &iter, path);
|
|
||||||
gtk_tree_path_free (path);
|
|
||||||
|
|
||||||
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (label));
|
|
||||||
gtk_cell_area_apply_attributes (area, model, &iter, FALSE, FALSE);
|
|
||||||
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (label));
|
|
||||||
|
|
||||||
text = NULL;
|
|
||||||
for (l = cells; l; l = l->next)
|
|
||||||
{
|
|
||||||
GtkCellRenderer *cell = l->data;
|
|
||||||
|
|
||||||
if (GTK_IS_CELL_RENDERER_TEXT (cell))
|
|
||||||
{
|
|
||||||
g_object_get (cell, "text", &text, NULL);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_list_free (cells);
|
|
||||||
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
ensure_menus_unposted (GtkMenuItemAccessible *menu_item)
|
|
||||||
{
|
|
||||||
AtkObject *parent;
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
parent = atk_object_get_parent (ATK_OBJECT (menu_item));
|
|
||||||
while (parent)
|
|
||||||
{
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
|
|
||||||
if (GTK_IS_MENU (widget))
|
|
||||||
{
|
|
||||||
if (gtk_widget_get_mapped (widget))
|
|
||||||
gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
parent = atk_object_get_parent (parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_item_accessible_do_action (AtkAction *action,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkWidget *item, *item_parent;
|
|
||||||
gboolean item_mapped;
|
|
||||||
|
|
||||||
item = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
|
|
||||||
if (item == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!gtk_widget_get_sensitive (item) || !gtk_widget_get_visible (item))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
item_parent = gtk_widget_get_parent (item);
|
|
||||||
if (!GTK_IS_MENU_SHELL (item_parent))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
gtk_menu_shell_select_item (GTK_MENU_SHELL (item_parent), item);
|
|
||||||
item_mapped = gtk_widget_get_mapped (item);
|
|
||||||
|
|
||||||
/* This is what is called when <Return> is pressed for a menu item.
|
|
||||||
* The last argument means 'force hide'.
|
|
||||||
*/
|
|
||||||
g_signal_emit_by_name (item_parent, "activate-current", 1);
|
|
||||||
if (!item_mapped)
|
|
||||||
ensure_menus_unposted (GTK_MENU_ITEM_ACCESSIBLE (action));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_menu_item_accessible_get_n_actions (AtkAction *action)
|
|
||||||
{
|
|
||||||
GtkWidget *item;
|
|
||||||
|
|
||||||
item = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
|
|
||||||
if (item == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!_gtk_menu_item_is_selectable (item))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const gchar *
|
|
||||||
gtk_menu_item_accessible_action_get_name (AtkAction *action,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
if (i == 0 && gtk_menu_item_accessible_get_n_actions (action) > 0)
|
|
||||||
return "click";
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const gchar *
|
|
||||||
gtk_menu_item_accessible_action_get_localized_name (AtkAction *action,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
if (i == 0 && gtk_menu_item_accessible_get_n_actions (action) > 0)
|
|
||||||
return C_("Action name", "Click");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const gchar *
|
|
||||||
gtk_menu_item_accessible_action_get_description (AtkAction *action,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
if (i == 0 && gtk_menu_item_accessible_get_n_actions (action) > 0)
|
|
||||||
return C_("Action description", "Clicks the menuitem");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
find_accel_by_widget (GtkAccelKey *key,
|
|
||||||
GClosure *closure,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
/* We assume that closure->data points to the widget
|
|
||||||
* pending gtk_widget_get_accel_closures being made public
|
|
||||||
*/
|
|
||||||
return data == (gpointer) closure->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
find_accel_by_closure (GtkAccelKey *key,
|
|
||||||
GClosure *closure,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
return data == (gpointer) closure;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
|
||||||
find_item_label (GtkWidget *item)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
if (GTK_IS_CONTAINER (child))
|
|
||||||
{
|
|
||||||
GList *children, *l;
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
for (l = children; l; l = l->next)
|
|
||||||
{
|
|
||||||
if (GTK_IS_LABEL (l->data))
|
|
||||||
{
|
|
||||||
child = l->data;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_list_free (children);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GTK_IS_LABEL (child))
|
|
||||||
return child;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function returns a string of the form A;B;C where A is
|
|
||||||
* the keybinding for the widget; B is the keybinding to traverse
|
|
||||||
* from the menubar and C is the accelerator. The items in the
|
|
||||||
* keybinding to traverse from the menubar are separated by “:”.
|
|
||||||
*/
|
|
||||||
static const gchar *
|
|
||||||
gtk_menu_item_accessible_get_keybinding (AtkAction *action,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
gchar *keybinding = NULL;
|
|
||||||
gchar *item_keybinding = NULL;
|
|
||||||
gchar *full_keybinding = NULL;
|
|
||||||
gchar *accelerator = NULL;
|
|
||||||
GtkWidget *item;
|
|
||||||
GtkWidget *temp_item;
|
|
||||||
GtkWidget *child;
|
|
||||||
GtkWidget *parent;
|
|
||||||
|
|
||||||
item = gtk_accessible_get_widget (GTK_ACCESSIBLE (action));
|
|
||||||
if (item == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
temp_item = item;
|
|
||||||
while (TRUE)
|
|
||||||
{
|
|
||||||
GdkModifierType mnemonic_modifier = 0;
|
|
||||||
guint key_val;
|
|
||||||
gchar *key, *temp_keybinding;
|
|
||||||
|
|
||||||
if (gtk_bin_get_child (GTK_BIN (temp_item)) == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
parent = gtk_widget_get_ancestor (temp_item, GTK_TYPE_MENU_SHELL);
|
|
||||||
if (!parent)
|
|
||||||
/* parent can be NULL when activating a window from the panel */
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (GTK_IS_MENU_BAR (parent))
|
|
||||||
{
|
|
||||||
GtkRoot *root;
|
|
||||||
|
|
||||||
root = gtk_widget_get_root (parent);
|
|
||||||
if (root && GTK_IS_WINDOW (root))
|
|
||||||
mnemonic_modifier = gtk_window_get_mnemonic_modifier (GTK_WINDOW (root));
|
|
||||||
}
|
|
||||||
|
|
||||||
child = find_item_label (temp_item);
|
|
||||||
if (GTK_IS_LABEL (child))
|
|
||||||
{
|
|
||||||
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (child));
|
|
||||||
if (key_val != GDK_KEY_VoidSymbol)
|
|
||||||
{
|
|
||||||
key = gtk_accelerator_name (key_val, mnemonic_modifier);
|
|
||||||
if (full_keybinding)
|
|
||||||
temp_keybinding = g_strconcat (key, ":", full_keybinding, NULL);
|
|
||||||
else
|
|
||||||
temp_keybinding = g_strdup (key);
|
|
||||||
|
|
||||||
if (temp_item == item)
|
|
||||||
item_keybinding = g_strdup (key);
|
|
||||||
|
|
||||||
g_free (key);
|
|
||||||
g_free (full_keybinding);
|
|
||||||
full_keybinding = temp_keybinding;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* No keybinding */
|
|
||||||
g_free (full_keybinding);
|
|
||||||
full_keybinding = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We have reached the menu bar so we are finished */
|
|
||||||
if (GTK_IS_MENU_BAR (parent))
|
|
||||||
break;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_MENU (parent), NULL);
|
|
||||||
temp_item = gtk_menu_get_attach_widget (GTK_MENU (parent));
|
|
||||||
if (!GTK_IS_MENU_ITEM (temp_item))
|
|
||||||
{
|
|
||||||
/* Menu is attached to something other than a menu item;
|
|
||||||
* probably an option menu
|
|
||||||
*/
|
|
||||||
g_free (full_keybinding);
|
|
||||||
full_keybinding = NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parent = gtk_widget_get_ancestor (item, GTK_TYPE_MENU_SHELL);
|
|
||||||
if (GTK_IS_MENU (parent))
|
|
||||||
{
|
|
||||||
child = find_item_label (item);
|
|
||||||
if (GTK_IS_ACCEL_LABEL (child))
|
|
||||||
{
|
|
||||||
guint accel_key;
|
|
||||||
GdkModifierType accel_mods;
|
|
||||||
|
|
||||||
gtk_accel_label_get_accel (GTK_ACCEL_LABEL (child), &accel_key, &accel_mods);
|
|
||||||
|
|
||||||
if (accel_key)
|
|
||||||
accelerator = gtk_accelerator_name (accel_key, accel_mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!accelerator)
|
|
||||||
{
|
|
||||||
GtkAccelGroup *group;
|
|
||||||
GtkAccelKey *key = NULL;
|
|
||||||
|
|
||||||
group = gtk_menu_get_accel_group (GTK_MENU (parent));
|
|
||||||
if (group)
|
|
||||||
key = gtk_accel_group_find (group, find_accel_by_widget, item);
|
|
||||||
else if (GTK_IS_ACCEL_LABEL (child))
|
|
||||||
{
|
|
||||||
GtkAccelLabel *accel_label;
|
|
||||||
GClosure *accel_closure;
|
|
||||||
|
|
||||||
accel_label = GTK_ACCEL_LABEL (child);
|
|
||||||
g_object_get (accel_label, "accel-closure", &accel_closure, NULL);
|
|
||||||
if (accel_closure)
|
|
||||||
{
|
|
||||||
key = gtk_accel_group_find (gtk_accel_group_from_accel_closure (accel_closure),
|
|
||||||
find_accel_by_closure,
|
|
||||||
accel_closure);
|
|
||||||
g_closure_unref (accel_closure);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key)
|
|
||||||
accelerator = gtk_accelerator_name (key->accel_key, key->accel_mods);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Concatenate the bindings */
|
|
||||||
if (item_keybinding || full_keybinding || accelerator)
|
|
||||||
{
|
|
||||||
gchar *temp;
|
|
||||||
if (item_keybinding)
|
|
||||||
{
|
|
||||||
keybinding = g_strconcat (item_keybinding, KEYBINDING_SEPARATOR, NULL);
|
|
||||||
g_free (item_keybinding);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
keybinding = g_strdup (KEYBINDING_SEPARATOR);
|
|
||||||
|
|
||||||
if (full_keybinding)
|
|
||||||
{
|
|
||||||
temp = g_strconcat (keybinding, full_keybinding,
|
|
||||||
KEYBINDING_SEPARATOR, NULL);
|
|
||||||
g_free (full_keybinding);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
temp = g_strconcat (keybinding, KEYBINDING_SEPARATOR, NULL);
|
|
||||||
|
|
||||||
g_free (keybinding);
|
|
||||||
keybinding = temp;
|
|
||||||
if (accelerator)
|
|
||||||
{
|
|
||||||
temp = g_strconcat (keybinding, accelerator, NULL);
|
|
||||||
g_free (accelerator);
|
|
||||||
g_free (keybinding);
|
|
||||||
keybinding = temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return keybinding;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
atk_action_interface_init (AtkActionIface *iface)
|
|
||||||
{
|
|
||||||
iface->do_action = gtk_menu_item_accessible_do_action;
|
|
||||||
iface->get_n_actions = gtk_menu_item_accessible_get_n_actions;
|
|
||||||
iface->get_name = gtk_menu_item_accessible_action_get_name;
|
|
||||||
iface->get_localized_name = gtk_menu_item_accessible_action_get_localized_name;
|
|
||||||
iface->get_description = gtk_menu_item_accessible_action_get_description;
|
|
||||||
iface->get_keybinding = gtk_menu_item_accessible_get_keybinding;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
menu_item_selection (GtkMenuItem *item,
|
|
||||||
gboolean selected)
|
|
||||||
{
|
|
||||||
AtkObject *obj, *parent;
|
|
||||||
gint i;
|
|
||||||
|
|
||||||
obj = gtk_widget_get_accessible (GTK_WIDGET (item));
|
|
||||||
GTK_MENU_ITEM_ACCESSIBLE (obj)->priv->selected = selected;
|
|
||||||
atk_object_notify_state_change (obj, ATK_STATE_SELECTED, selected);
|
|
||||||
|
|
||||||
for (i = 0; i < atk_object_get_n_accessible_children (obj); i++)
|
|
||||||
{
|
|
||||||
AtkObject *child;
|
|
||||||
child = atk_object_ref_accessible_child (obj, i);
|
|
||||||
atk_object_notify_state_change (child, ATK_STATE_SHOWING, selected);
|
|
||||||
g_object_unref (child);
|
|
||||||
}
|
|
||||||
parent = atk_object_get_parent (obj);
|
|
||||||
g_signal_emit_by_name (parent, "selection-changed");
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_item_accessible_add_selection (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GList *kids;
|
|
||||||
guint length;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *menu;
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (menu == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (menu);
|
|
||||||
kids = gtk_container_get_children (GTK_CONTAINER (shell));
|
|
||||||
length = g_list_length (kids);
|
|
||||||
if (i < 0 || i > length)
|
|
||||||
{
|
|
||||||
g_list_free (kids);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
child = g_list_nth_data (kids, i);
|
|
||||||
g_list_free (kids);
|
|
||||||
g_return_val_if_fail (GTK_IS_MENU_ITEM (child), FALSE);
|
|
||||||
gtk_menu_shell_select_item (shell, GTK_WIDGET (child));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_item_accessible_clear_selection (AtkSelection *selection)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *menu;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (menu == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
gtk_menu_shell_deselect (GTK_MENU_SHELL (menu));
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkObject *
|
|
||||||
gtk_menu_item_accessible_ref_selection (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
AtkObject *obj;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *menu;
|
|
||||||
GtkWidget *item;
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (menu == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (menu);
|
|
||||||
|
|
||||||
item = gtk_menu_shell_get_selected_item (shell);
|
|
||||||
if (item != NULL)
|
|
||||||
{
|
|
||||||
obj = gtk_widget_get_accessible (item);
|
|
||||||
g_object_ref (obj);
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_menu_item_accessible_get_selection_count (AtkSelection *selection)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *menu;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (menu == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (menu);
|
|
||||||
|
|
||||||
if (gtk_menu_shell_get_selected_item (shell) != NULL)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_item_accessible_is_child_selected (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
gint j;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *menu;
|
|
||||||
GtkWidget *item;
|
|
||||||
GList *kids;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (menu == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (menu);
|
|
||||||
|
|
||||||
item = gtk_menu_shell_get_selected_item (shell);
|
|
||||||
if (item == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
kids = gtk_container_get_children (GTK_CONTAINER (shell));
|
|
||||||
j = g_list_index (kids, item);
|
|
||||||
g_list_free (kids);
|
|
||||||
|
|
||||||
return j==i;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_item_accessible_remove_selection (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *menu;
|
|
||||||
GtkWidget *item;
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget));
|
|
||||||
if (menu == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (menu);
|
|
||||||
|
|
||||||
item = gtk_menu_shell_get_selected_item (shell);
|
|
||||||
if (item && gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)))
|
|
||||||
gtk_menu_shell_deselect (shell);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
atk_selection_interface_init (AtkSelectionIface *iface)
|
|
||||||
{
|
|
||||||
iface->add_selection = gtk_menu_item_accessible_add_selection;
|
|
||||||
iface->clear_selection = gtk_menu_item_accessible_clear_selection;
|
|
||||||
iface->ref_selection = gtk_menu_item_accessible_ref_selection;
|
|
||||||
iface->get_selection_count = gtk_menu_item_accessible_get_selection_count;
|
|
||||||
iface->is_child_selected = gtk_menu_item_accessible_is_child_selected;
|
|
||||||
iface->remove_selection = gtk_menu_item_accessible_remove_selection;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
menu_item_insert_gtk (GtkMenuShell *shell,
|
|
||||||
GtkWidget *widget,
|
|
||||||
gint position)
|
|
||||||
{
|
|
||||||
GtkWidget *parent_widget;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_MENU (shell), 1);
|
|
||||||
|
|
||||||
parent_widget = gtk_menu_get_attach_widget (GTK_MENU (shell));
|
|
||||||
if (GTK_IS_MENU_ITEM (parent_widget))
|
|
||||||
GTK_CONTAINER_ACCESSIBLE_CLASS (gtk_menu_item_accessible_parent_class)->add_gtk (GTK_CONTAINER (shell), widget, gtk_widget_get_accessible (parent_widget));
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
menu_item_remove_gtk (GtkContainer *container,
|
|
||||||
GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkWidget *parent_widget;
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_MENU (container), 1);
|
|
||||||
|
|
||||||
parent_widget = gtk_menu_get_attach_widget (GTK_MENU (container));
|
|
||||||
if (GTK_IS_MENU_ITEM (parent_widget))
|
|
||||||
{
|
|
||||||
GTK_CONTAINER_ACCESSIBLE_CLASS (gtk_menu_item_accessible_parent_class)->remove_gtk (container, widget, gtk_widget_get_accessible (parent_widget));
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
menu_item_select (GtkMenuItem *item)
|
|
||||||
{
|
|
||||||
menu_item_selection (item, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
menu_item_deselect (GtkMenuItem *item)
|
|
||||||
{
|
|
||||||
menu_item_selection (item, FALSE);
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2001 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_ITEM_ACCESSIBLE_H__
|
|
||||||
#define __GTK_MENU_ITEM_ACCESSIBLE_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/a11y/gtkcontaineraccessible.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU_ITEM_ACCESSIBLE (gtk_menu_item_accessible_get_type ())
|
|
||||||
#define GTK_MENU_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ITEM_ACCESSIBLE, GtkMenuItemAccessible))
|
|
||||||
#define GTK_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_ITEM_ACCESSIBLE, GtkMenuItemAccessibleClass))
|
|
||||||
#define GTK_IS_MENU_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_ITEM_ACCESSIBLE))
|
|
||||||
#define GTK_IS_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ITEM_ACCESSIBLE))
|
|
||||||
#define GTK_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ITEM_ACCESSIBLE, GtkMenuItemAccessibleClass))
|
|
||||||
|
|
||||||
typedef struct _GtkMenuItemAccessible GtkMenuItemAccessible;
|
|
||||||
typedef struct _GtkMenuItemAccessibleClass GtkMenuItemAccessibleClass;
|
|
||||||
typedef struct _GtkMenuItemAccessiblePrivate GtkMenuItemAccessiblePrivate;
|
|
||||||
|
|
||||||
struct _GtkMenuItemAccessible
|
|
||||||
{
|
|
||||||
GtkContainerAccessible parent;
|
|
||||||
|
|
||||||
GtkMenuItemAccessiblePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuItemAccessibleClass
|
|
||||||
{
|
|
||||||
GtkContainerAccessibleClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_item_accessible_get_type (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_ITEM_ACCESSIBLE_H__ */
|
|
@ -1,199 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2001 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include "gtkmenushellaccessible.h"
|
|
||||||
|
|
||||||
|
|
||||||
static void atk_selection_interface_init (AtkSelectionIface *iface);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GtkMenuShellAccessible, gtk_menu_shell_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
|
|
||||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_shell_accessible_initialize (AtkObject *accessible,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ATK_OBJECT_CLASS (gtk_menu_shell_accessible_parent_class)->initialize (accessible, data);
|
|
||||||
|
|
||||||
accessible->role = ATK_ROLE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_shell_accessible_class_init (GtkMenuShellAccessibleClass *klass)
|
|
||||||
{
|
|
||||||
AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
atk_object_class->initialize = gtk_menu_shell_accessible_initialize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_shell_accessible_init (GtkMenuShellAccessible *menu_shell)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_shell_accessible_add_selection (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GList *kids;
|
|
||||||
GtkWidget *item;
|
|
||||||
guint length;
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
kids = gtk_container_get_children (GTK_CONTAINER (widget));
|
|
||||||
length = g_list_length (kids);
|
|
||||||
if (i < 0 || i > length)
|
|
||||||
{
|
|
||||||
g_list_free (kids);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
item = g_list_nth_data (kids, i);
|
|
||||||
g_list_free (kids);
|
|
||||||
g_return_val_if_fail (GTK_IS_MENU_ITEM (item), FALSE);
|
|
||||||
gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), item);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_shell_accessible_clear_selection (AtkSelection *selection)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (widget);
|
|
||||||
|
|
||||||
gtk_menu_shell_deselect (shell);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static AtkObject *
|
|
||||||
gtk_menu_shell_accessible_ref_selection (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
AtkObject *obj;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *item;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (widget);
|
|
||||||
|
|
||||||
item = gtk_menu_shell_get_selected_item (shell);
|
|
||||||
if (item != NULL)
|
|
||||||
{
|
|
||||||
obj = gtk_widget_get_accessible (item);
|
|
||||||
g_object_ref (obj);
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_menu_shell_accessible_get_selection_count (AtkSelection *selection)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (widget);
|
|
||||||
|
|
||||||
if (gtk_menu_shell_get_selected_item (shell) != NULL)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_shell_accessible_is_child_selected (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GList *kids;
|
|
||||||
gint j;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *item;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (widget);
|
|
||||||
item = gtk_menu_shell_get_selected_item (shell);
|
|
||||||
if (item == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
kids = gtk_container_get_children (GTK_CONTAINER (shell));
|
|
||||||
j = g_list_index (kids, item);
|
|
||||||
g_list_free (kids);
|
|
||||||
|
|
||||||
return j==i;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gtk_menu_shell_accessible_remove_selection (AtkSelection *selection,
|
|
||||||
gint i)
|
|
||||||
{
|
|
||||||
GtkMenuShell *shell;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GtkWidget *item;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
|
||||||
if (widget == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (i != 0)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
shell = GTK_MENU_SHELL (widget);
|
|
||||||
|
|
||||||
item = gtk_menu_shell_get_selected_item (shell);
|
|
||||||
if (item && gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)))
|
|
||||||
gtk_menu_shell_deselect (shell);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
atk_selection_interface_init (AtkSelectionIface *iface)
|
|
||||||
{
|
|
||||||
iface->add_selection = gtk_menu_shell_accessible_add_selection;
|
|
||||||
iface->clear_selection = gtk_menu_shell_accessible_clear_selection;
|
|
||||||
iface->ref_selection = gtk_menu_shell_accessible_ref_selection;
|
|
||||||
iface->get_selection_count = gtk_menu_shell_accessible_get_selection_count;
|
|
||||||
iface->is_child_selected = gtk_menu_shell_accessible_is_child_selected;
|
|
||||||
iface->remove_selection = gtk_menu_shell_accessible_remove_selection;
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2001 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_SHELL_ACCESSIBLE_H__
|
|
||||||
#define __GTK_MENU_SHELL_ACCESSIBLE_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/a11y/gtkcontaineraccessible.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU_SHELL_ACCESSIBLE (gtk_menu_shell_accessible_get_type ())
|
|
||||||
#define GTK_MENU_SHELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessible))
|
|
||||||
#define GTK_MENU_SHELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessibleClass))
|
|
||||||
#define GTK_IS_MENU_SHELL_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE))
|
|
||||||
#define GTK_IS_MENU_SHELL_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL_ACCESSIBLE))
|
|
||||||
#define GTK_MENU_SHELL_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessibleClass))
|
|
||||||
|
|
||||||
typedef struct _GtkMenuShellAccessible GtkMenuShellAccessible;
|
|
||||||
typedef struct _GtkMenuShellAccessibleClass GtkMenuShellAccessibleClass;
|
|
||||||
typedef struct _GtkMenuShellAccessiblePrivate GtkMenuShellAccessiblePrivate;
|
|
||||||
|
|
||||||
struct _GtkMenuShellAccessible
|
|
||||||
{
|
|
||||||
GtkContainerAccessible parent;
|
|
||||||
|
|
||||||
GtkMenuShellAccessiblePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuShellAccessibleClass
|
|
||||||
{
|
|
||||||
GtkContainerAccessibleClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_shell_accessible_get_type (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_SHELL_ACCESSIBLE_H__ */
|
|
@ -1,117 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2002 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include "gtkradiomenuitemaccessible.h"
|
|
||||||
|
|
||||||
struct _GtkRadioMenuItemAccessiblePrivate
|
|
||||||
{
|
|
||||||
GSList *old_group;
|
|
||||||
};
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkRadioMenuItemAccessible,
|
|
||||||
gtk_radio_menu_item_accessible,
|
|
||||||
GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE)
|
|
||||||
|
|
||||||
|
|
||||||
static AtkRelationSet *
|
|
||||||
gtk_radio_menu_item_accessible_ref_relation_set (AtkObject *obj)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
AtkRelationSet *relation_set;
|
|
||||||
GSList *list;
|
|
||||||
GtkRadioMenuItemAccessible *radio_menu_item;
|
|
||||||
|
|
||||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
|
||||||
if (widget == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
radio_menu_item = GTK_RADIO_MENU_ITEM_ACCESSIBLE (obj);
|
|
||||||
|
|
||||||
relation_set = ATK_OBJECT_CLASS (gtk_radio_menu_item_accessible_parent_class)->ref_relation_set (obj);
|
|
||||||
|
|
||||||
/* If the radio menu_item's group has changed remove the relation */
|
|
||||||
list = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (widget));
|
|
||||||
|
|
||||||
if (radio_menu_item->priv->old_group != list)
|
|
||||||
{
|
|
||||||
AtkRelation *relation;
|
|
||||||
|
|
||||||
relation = atk_relation_set_get_relation_by_type (relation_set, ATK_RELATION_MEMBER_OF);
|
|
||||||
atk_relation_set_remove (relation_set, relation);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!atk_relation_set_contains (relation_set, ATK_RELATION_MEMBER_OF))
|
|
||||||
{
|
|
||||||
/* Get the members of the menu_item group */
|
|
||||||
radio_menu_item->priv->old_group = list;
|
|
||||||
if (list)
|
|
||||||
{
|
|
||||||
AtkObject **accessible_array;
|
|
||||||
guint list_length;
|
|
||||||
AtkRelation* relation;
|
|
||||||
gint i = 0;
|
|
||||||
|
|
||||||
list_length = g_slist_length (list);
|
|
||||||
accessible_array = g_new (AtkObject *, list_length);
|
|
||||||
while (list != NULL)
|
|
||||||
{
|
|
||||||
GtkWidget* list_item = list->data;
|
|
||||||
|
|
||||||
accessible_array[i++] = gtk_widget_get_accessible (list_item);
|
|
||||||
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
relation = atk_relation_new (accessible_array, list_length,
|
|
||||||
ATK_RELATION_MEMBER_OF);
|
|
||||||
g_free (accessible_array);
|
|
||||||
|
|
||||||
atk_relation_set_add (relation_set, relation);
|
|
||||||
|
|
||||||
/* Unref the relation so that it is not leaked */
|
|
||||||
g_object_unref (relation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return relation_set;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_accessible_initialize (AtkObject *obj,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
ATK_OBJECT_CLASS (gtk_radio_menu_item_accessible_parent_class)->initialize (obj, data);
|
|
||||||
|
|
||||||
obj->role = ATK_ROLE_RADIO_MENU_ITEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_accessible_class_init (GtkRadioMenuItemAccessibleClass *klass)
|
|
||||||
{
|
|
||||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
class->ref_relation_set = gtk_radio_menu_item_accessible_ref_relation_set;
|
|
||||||
class->initialize = gtk_radio_menu_item_accessible_initialize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_accessible_init (GtkRadioMenuItemAccessible *radio_menu_item)
|
|
||||||
{
|
|
||||||
radio_menu_item->priv = gtk_radio_menu_item_accessible_get_instance_private (radio_menu_item);
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/* GTK+ - accessibility implementations
|
|
||||||
* Copyright 2002 Sun Microsystems Inc.
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Library General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Library General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_RADIO_MENU_ITEM_ACCESSIBLE_H__
|
|
||||||
#define __GTK_RADIO_MENU_ITEM_ACCESSIBLE_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/a11y/gtkcheckmenuitemaccessible.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE (gtk_radio_menu_item_accessible_get_type ())
|
|
||||||
#define GTK_RADIO_MENU_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE, GtkRadioMenuItemAccessible))
|
|
||||||
#define GTK_RADIO_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE, GtkRadioMenuItemAccessibleClass))
|
|
||||||
#define GTK_IS_RADIO_MENU_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE))
|
|
||||||
#define GTK_IS_RADIO_MENU_ITEM_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE))
|
|
||||||
#define GTK_RADIO_MENU_ITEM_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE, GtkRadioMenuItemAccessibleClass))
|
|
||||||
|
|
||||||
typedef struct _GtkRadioMenuItemAccessible GtkRadioMenuItemAccessible;
|
|
||||||
typedef struct _GtkRadioMenuItemAccessibleClass GtkRadioMenuItemAccessibleClass;
|
|
||||||
typedef struct _GtkRadioMenuItemAccessiblePrivate GtkRadioMenuItemAccessiblePrivate;
|
|
||||||
|
|
||||||
struct _GtkRadioMenuItemAccessible
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemAccessible parent;
|
|
||||||
|
|
||||||
GtkRadioMenuItemAccessiblePrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkRadioMenuItemAccessibleClass
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemAccessibleClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_radio_menu_item_accessible_get_type (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_RADIO_MENU_ITEM_ACCESSIBLE_H__ */
|
|
@ -22,8 +22,6 @@
|
|||||||
|
|
||||||
#include <gtk/gtkscrolledwindow.h>
|
#include <gtk/gtkscrolledwindow.h>
|
||||||
#include <gtk/gtkframe.h>
|
#include <gtk/gtkframe.h>
|
||||||
#include <gtk/gtkmenu.h>
|
|
||||||
#include <gtk/gtkmenuitem.h>
|
|
||||||
#include <gtk/gtkbutton.h>
|
#include <gtk/gtkbutton.h>
|
||||||
#include <gtk/gtkwindow.h>
|
#include <gtk/gtkwindow.h>
|
||||||
|
|
||||||
@ -91,25 +89,6 @@ gtk_toplevel_accessible_get_name (AtkObject *obj)
|
|||||||
return g_get_prgname ();
|
return g_get_prgname ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_attached_menu_window (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (widget));
|
|
||||||
if (GTK_IS_MENU (child))
|
|
||||||
{
|
|
||||||
GtkWidget *attach;
|
|
||||||
|
|
||||||
attach = gtk_menu_get_attach_widget (GTK_MENU (child));
|
|
||||||
/* Allow for menu belonging to the Panel Menu, which is a GtkButton */
|
|
||||||
if (GTK_IS_MENU_ITEM (attach) || GTK_IS_BUTTON (attach))
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
|
gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
|
||||||
{
|
{
|
||||||
@ -177,8 +156,7 @@ show_event_watcher (GSignalInvocationHint *ihint,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
widget = GTK_WIDGET (object);
|
widget = GTK_WIDGET (object);
|
||||||
if (gtk_widget_get_parent (widget) ||
|
if (gtk_widget_get_parent (widget))
|
||||||
is_attached_menu_window (widget))
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
child = gtk_widget_get_accessible (widget);
|
child = gtk_widget_get_accessible (widget);
|
||||||
@ -236,7 +214,6 @@ gtk_toplevel_accessible_init (GtkToplevelAccessible *toplevel)
|
|||||||
widget = GTK_WIDGET (window);
|
widget = GTK_WIDGET (window);
|
||||||
if (!window ||
|
if (!window ||
|
||||||
!gtk_widget_get_visible (widget) ||
|
!gtk_widget_get_visible (widget) ||
|
||||||
is_attached_menu_window (widget) ||
|
|
||||||
gtk_widget_get_parent (GTK_WIDGET (window)))
|
gtk_widget_get_parent (GTK_WIDGET (window)))
|
||||||
{
|
{
|
||||||
GList *temp_l = l->next;
|
GList *temp_l = l->next;
|
||||||
|
@ -5,7 +5,6 @@ a11y_sources = files([
|
|||||||
'gtkbuttonaccessible.c',
|
'gtkbuttonaccessible.c',
|
||||||
'gtkcellaccessible.c',
|
'gtkcellaccessible.c',
|
||||||
'gtkcellaccessibleparent.c',
|
'gtkcellaccessibleparent.c',
|
||||||
'gtkcheckmenuitemaccessible.c',
|
|
||||||
'gtkcolorswatchaccessible.c',
|
'gtkcolorswatchaccessible.c',
|
||||||
'gtkcomboboxaccessible.c',
|
'gtkcomboboxaccessible.c',
|
||||||
'gtkcontaineraccessible.c',
|
'gtkcontaineraccessible.c',
|
||||||
@ -24,10 +23,7 @@ a11y_sources = files([
|
|||||||
'gtklistboxaccessible.c',
|
'gtklistboxaccessible.c',
|
||||||
'gtklistboxrowaccessible.c',
|
'gtklistboxrowaccessible.c',
|
||||||
'gtklockbuttonaccessible.c',
|
'gtklockbuttonaccessible.c',
|
||||||
'gtkmenuaccessible.c',
|
|
||||||
'gtkmenubuttonaccessible.c',
|
'gtkmenubuttonaccessible.c',
|
||||||
'gtkmenuitemaccessible.c',
|
|
||||||
'gtkmenushellaccessible.c',
|
|
||||||
'gtknotebookaccessible.c',
|
'gtknotebookaccessible.c',
|
||||||
'gtknotebookpageaccessible.c',
|
'gtknotebookpageaccessible.c',
|
||||||
'gtkpanedaccessible.c',
|
'gtkpanedaccessible.c',
|
||||||
@ -35,7 +31,6 @@ a11y_sources = files([
|
|||||||
'gtkpopoveraccessible.c',
|
'gtkpopoveraccessible.c',
|
||||||
'gtkprogressbaraccessible.c',
|
'gtkprogressbaraccessible.c',
|
||||||
'gtkradiobuttonaccessible.c',
|
'gtkradiobuttonaccessible.c',
|
||||||
'gtkradiomenuitemaccessible.c',
|
|
||||||
'gtkrangeaccessible.c',
|
'gtkrangeaccessible.c',
|
||||||
'gtkrenderercellaccessible.c',
|
'gtkrenderercellaccessible.c',
|
||||||
'gtkscaleaccessible.c',
|
'gtkscaleaccessible.c',
|
||||||
@ -62,7 +57,6 @@ a11y_headers = files([
|
|||||||
'gtkbuttonaccessible.h',
|
'gtkbuttonaccessible.h',
|
||||||
'gtkcellaccessible.h',
|
'gtkcellaccessible.h',
|
||||||
'gtkcellaccessibleparent.h',
|
'gtkcellaccessibleparent.h',
|
||||||
'gtkcheckmenuitemaccessible.h',
|
|
||||||
'gtkcomboboxaccessible.h',
|
'gtkcomboboxaccessible.h',
|
||||||
'gtkcontaineraccessible.h',
|
'gtkcontaineraccessible.h',
|
||||||
'gtkcontainercellaccessible.h',
|
'gtkcontainercellaccessible.h',
|
||||||
@ -80,17 +74,13 @@ a11y_headers = files([
|
|||||||
'gtklistboxaccessible.h',
|
'gtklistboxaccessible.h',
|
||||||
'gtklistboxrowaccessible.h',
|
'gtklistboxrowaccessible.h',
|
||||||
'gtklockbuttonaccessible.h',
|
'gtklockbuttonaccessible.h',
|
||||||
'gtkmenuaccessible.h',
|
|
||||||
'gtkmenubuttonaccessible.h',
|
'gtkmenubuttonaccessible.h',
|
||||||
'gtkmenuitemaccessible.h',
|
|
||||||
'gtkmenushellaccessible.h',
|
|
||||||
'gtknotebookaccessible.h',
|
'gtknotebookaccessible.h',
|
||||||
'gtknotebookpageaccessible.h',
|
'gtknotebookpageaccessible.h',
|
||||||
'gtkpanedaccessible.h',
|
'gtkpanedaccessible.h',
|
||||||
'gtkpopoveraccessible.h',
|
'gtkpopoveraccessible.h',
|
||||||
'gtkprogressbaraccessible.h',
|
'gtkprogressbaraccessible.h',
|
||||||
'gtkradiobuttonaccessible.h',
|
'gtkradiobuttonaccessible.h',
|
||||||
'gtkradiomenuitemaccessible.h',
|
|
||||||
'gtkrangeaccessible.h',
|
'gtkrangeaccessible.h',
|
||||||
'gtkrenderercellaccessible.h',
|
'gtkrenderercellaccessible.h',
|
||||||
'gtkscaleaccessible.h',
|
'gtkscaleaccessible.h',
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include <gtk/a11y/gtkbuttonaccessible.h>
|
#include <gtk/a11y/gtkbuttonaccessible.h>
|
||||||
#include <gtk/a11y/gtkcellaccessible.h>
|
#include <gtk/a11y/gtkcellaccessible.h>
|
||||||
#include <gtk/a11y/gtkcellaccessibleparent.h>
|
#include <gtk/a11y/gtkcellaccessibleparent.h>
|
||||||
#include <gtk/a11y/gtkcheckmenuitemaccessible.h>
|
|
||||||
#include <gtk/a11y/gtkcomboboxaccessible.h>
|
#include <gtk/a11y/gtkcomboboxaccessible.h>
|
||||||
#include <gtk/a11y/gtkcontaineraccessible.h>
|
#include <gtk/a11y/gtkcontaineraccessible.h>
|
||||||
#include <gtk/a11y/gtkcontainercellaccessible.h>
|
#include <gtk/a11y/gtkcontainercellaccessible.h>
|
||||||
@ -50,17 +49,13 @@
|
|||||||
#include <gtk/a11y/gtklistboxaccessible.h>
|
#include <gtk/a11y/gtklistboxaccessible.h>
|
||||||
#include <gtk/a11y/gtklistboxrowaccessible.h>
|
#include <gtk/a11y/gtklistboxrowaccessible.h>
|
||||||
#include <gtk/a11y/gtklockbuttonaccessible.h>
|
#include <gtk/a11y/gtklockbuttonaccessible.h>
|
||||||
#include <gtk/a11y/gtkmenuaccessible.h>
|
|
||||||
#include <gtk/a11y/gtkmenubuttonaccessible.h>
|
#include <gtk/a11y/gtkmenubuttonaccessible.h>
|
||||||
#include <gtk/a11y/gtkmenuitemaccessible.h>
|
|
||||||
#include <gtk/a11y/gtkmenushellaccessible.h>
|
|
||||||
#include <gtk/a11y/gtknotebookaccessible.h>
|
#include <gtk/a11y/gtknotebookaccessible.h>
|
||||||
#include <gtk/a11y/gtknotebookpageaccessible.h>
|
#include <gtk/a11y/gtknotebookpageaccessible.h>
|
||||||
#include <gtk/a11y/gtkpanedaccessible.h>
|
#include <gtk/a11y/gtkpanedaccessible.h>
|
||||||
#include <gtk/a11y/gtkpopoveraccessible.h>
|
#include <gtk/a11y/gtkpopoveraccessible.h>
|
||||||
#include <gtk/a11y/gtkprogressbaraccessible.h>
|
#include <gtk/a11y/gtkprogressbaraccessible.h>
|
||||||
#include <gtk/a11y/gtkradiobuttonaccessible.h>
|
#include <gtk/a11y/gtkradiobuttonaccessible.h>
|
||||||
#include <gtk/a11y/gtkradiomenuitemaccessible.h>
|
|
||||||
#include <gtk/a11y/gtkrangeaccessible.h>
|
#include <gtk/a11y/gtkrangeaccessible.h>
|
||||||
#include <gtk/a11y/gtkrenderercellaccessible.h>
|
#include <gtk/a11y/gtkrenderercellaccessible.h>
|
||||||
#include <gtk/a11y/gtkscaleaccessible.h>
|
#include <gtk/a11y/gtkscaleaccessible.h>
|
||||||
|
@ -53,7 +53,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererText, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererToggle, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererToggle, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellView, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellView, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCheckButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCheckButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCheckMenuItem, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkClipboard, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkClipboard, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorChooser, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorChooser, g_object_unref)
|
||||||
@ -105,9 +104,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLevelBar, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLinkButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLinkButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListStore, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListStore, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLockButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLockButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuBar, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuItem, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuToolButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuToolButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMessageDialog, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMessageDialog, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMountOperation, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMountOperation, g_object_unref)
|
||||||
@ -124,7 +121,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPrintOperationPreview, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPrintSettings, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkPrintSettings, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkProgressBar, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkProgressBar, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioMenuItem, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioToolButton, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRadioToolButton, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRange, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRange, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRecentManager, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkRecentManager, g_object_unref)
|
||||||
@ -137,7 +133,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkScrolledWindow, g_object_unref)
|
|||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSearchBar, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSearchBar, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSearchEntry, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSearchEntry, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparator, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparator, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorMenuItem, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorToolItem, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSeparatorToolItem, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSettings, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkSettings, g_object_unref)
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStackSidebar, g_object_unref)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkStackSidebar, g_object_unref)
|
||||||
|
@ -76,7 +76,6 @@
|
|||||||
#include <gtk/gtkcenterbox.h>
|
#include <gtk/gtkcenterbox.h>
|
||||||
#include <gtk/gtkcenterlayout.h>
|
#include <gtk/gtkcenterlayout.h>
|
||||||
#include <gtk/gtkcheckbutton.h>
|
#include <gtk/gtkcheckbutton.h>
|
||||||
#include <gtk/gtkcheckmenuitem.h>
|
|
||||||
#include <gtk/gtkcolorbutton.h>
|
#include <gtk/gtkcolorbutton.h>
|
||||||
#include <gtk/gtkcolorchooser.h>
|
#include <gtk/gtkcolorchooser.h>
|
||||||
#include <gtk/gtkcolorchooserdialog.h>
|
#include <gtk/gtkcolorchooserdialog.h>
|
||||||
@ -156,11 +155,7 @@
|
|||||||
#include <gtk/gtkmediacontrols.h>
|
#include <gtk/gtkmediacontrols.h>
|
||||||
#include <gtk/gtkmediafile.h>
|
#include <gtk/gtkmediafile.h>
|
||||||
#include <gtk/gtkmediastream.h>
|
#include <gtk/gtkmediastream.h>
|
||||||
#include <gtk/gtkmenu.h>
|
|
||||||
#include <gtk/gtkmenubar.h>
|
|
||||||
#include <gtk/gtkmenubutton.h>
|
#include <gtk/gtkmenubutton.h>
|
||||||
#include <gtk/gtkmenuitem.h>
|
|
||||||
#include <gtk/gtkmenushell.h>
|
|
||||||
#include <gtk/gtkmenutoolbutton.h>
|
#include <gtk/gtkmenutoolbutton.h>
|
||||||
#include <gtk/gtkmessagedialog.h>
|
#include <gtk/gtkmessagedialog.h>
|
||||||
#include <gtk/gtkmountoperation.h>
|
#include <gtk/gtkmountoperation.h>
|
||||||
@ -185,7 +180,6 @@
|
|||||||
#include <gtk/gtkprintsettings.h>
|
#include <gtk/gtkprintsettings.h>
|
||||||
#include <gtk/gtkprogressbar.h>
|
#include <gtk/gtkprogressbar.h>
|
||||||
#include <gtk/gtkradiobutton.h>
|
#include <gtk/gtkradiobutton.h>
|
||||||
#include <gtk/gtkradiomenuitem.h>
|
|
||||||
#include <gtk/gtkradiotoolbutton.h>
|
#include <gtk/gtkradiotoolbutton.h>
|
||||||
#include <gtk/gtkrange.h>
|
#include <gtk/gtkrange.h>
|
||||||
#include <gtk/gtkrecentmanager.h>
|
#include <gtk/gtkrecentmanager.h>
|
||||||
@ -202,7 +196,6 @@
|
|||||||
#include <gtk/gtkselection.h>
|
#include <gtk/gtkselection.h>
|
||||||
#include <gtk/gtkselectionmodel.h>
|
#include <gtk/gtkselectionmodel.h>
|
||||||
#include <gtk/gtkseparator.h>
|
#include <gtk/gtkseparator.h>
|
||||||
#include <gtk/gtkseparatormenuitem.h>
|
|
||||||
#include <gtk/gtkseparatortoolitem.h>
|
#include <gtk/gtkseparatortoolitem.h>
|
||||||
#include <gtk/gtksettings.h>
|
#include <gtk/gtksettings.h>
|
||||||
#include <gtk/gtkshortcutlabel.h>
|
#include <gtk/gtkshortcutlabel.h>
|
||||||
|
@ -1,623 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "gtkcheckmenuitemprivate.h"
|
|
||||||
#include "gtkmenuitemprivate.h"
|
|
||||||
#include "gtkaccellabel.h"
|
|
||||||
#include "gtkmarshalers.h"
|
|
||||||
#include "gtkprivate.h"
|
|
||||||
#include "gtkintl.h"
|
|
||||||
#include "a11y/gtkcheckmenuitemaccessible.h"
|
|
||||||
#include "gtkcssnodeprivate.h"
|
|
||||||
#include "gtkcssstylepropertyprivate.h"
|
|
||||||
#include "gtkwidgetprivate.h"
|
|
||||||
#include "gtkiconprivate.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:gtkcheckmenuitem
|
|
||||||
* @Short_description: A menu item with a check box
|
|
||||||
* @Title: GtkCheckMenuItem
|
|
||||||
*
|
|
||||||
* A #GtkCheckMenuItem is a menu item that maintains the state of a boolean
|
|
||||||
* value in addition to a #GtkMenuItem usual role in activating application
|
|
||||||
* code.
|
|
||||||
*
|
|
||||||
* A check box indicating the state of the boolean value is displayed
|
|
||||||
* at the left side of the #GtkMenuItem. Activating the #GtkMenuItem
|
|
||||||
* toggles the value.
|
|
||||||
*
|
|
||||||
* # CSS nodes
|
|
||||||
*
|
|
||||||
* |[<!-- language="plain" -->
|
|
||||||
* menuitem
|
|
||||||
* ├── check.left
|
|
||||||
* ╰── <child>
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* GtkCheckMenuItem has a main CSS node with name menuitem, and a subnode
|
|
||||||
* with name check, which gets the .left or .right style class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _GtkCheckMenuItemPrivate GtkCheckMenuItemPrivate;
|
|
||||||
|
|
||||||
struct _GtkCheckMenuItemPrivate
|
|
||||||
{
|
|
||||||
GtkWidget *indicator_widget;
|
|
||||||
|
|
||||||
guint active : 1;
|
|
||||||
guint draw_as_radio : 1;
|
|
||||||
guint inconsistent : 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
TOGGLED,
|
|
||||||
LAST_SIGNAL
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
PROP_0,
|
|
||||||
PROP_ACTIVE,
|
|
||||||
PROP_INCONSISTENT,
|
|
||||||
PROP_DRAW_AS_RADIO
|
|
||||||
};
|
|
||||||
|
|
||||||
static void gtk_check_menu_item_activate (GtkMenuItem *menu_item);
|
|
||||||
static void gtk_check_menu_item_toggle_size_request (GtkMenuItem *menu_item,
|
|
||||||
gint *requisition);
|
|
||||||
static void gtk_check_menu_item_set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec);
|
|
||||||
static void gtk_check_menu_item_get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec);
|
|
||||||
|
|
||||||
static void gtk_check_menu_item_state_flags_changed (GtkWidget *widget,
|
|
||||||
GtkStateFlags previous_state);
|
|
||||||
static void gtk_check_menu_item_direction_changed (GtkWidget *widget,
|
|
||||||
GtkTextDirection previous_dir);
|
|
||||||
|
|
||||||
static guint check_menu_item_signals[LAST_SIGNAL] = { 0 };
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_ITEM,
|
|
||||||
G_ADD_PRIVATE (GtkCheckMenuItem))
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_size_allocate (GtkWidget *widget,
|
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
int baseline)
|
|
||||||
{
|
|
||||||
GtkAllocation indicator_alloc;
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (widget);
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
gint toggle_size;
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_check_menu_item_parent_class)->size_allocate (widget,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
baseline);
|
|
||||||
|
|
||||||
gtk_widget_measure (priv->indicator_widget,
|
|
||||||
GTK_ORIENTATION_HORIZONTAL,
|
|
||||||
-1,
|
|
||||||
&indicator_alloc.width, NULL,
|
|
||||||
NULL, NULL);
|
|
||||||
gtk_widget_measure (priv->indicator_widget,
|
|
||||||
GTK_ORIENTATION_VERTICAL,
|
|
||||||
-1,
|
|
||||||
&indicator_alloc.height, NULL,
|
|
||||||
NULL, NULL);
|
|
||||||
toggle_size = GTK_MENU_ITEM (check_menu_item)->priv->toggle_size;
|
|
||||||
|
|
||||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
|
||||||
indicator_alloc.x = (toggle_size - indicator_alloc.width) / 2;
|
|
||||||
else
|
|
||||||
indicator_alloc.x = width - toggle_size +
|
|
||||||
(toggle_size - indicator_alloc.width) / 2;
|
|
||||||
|
|
||||||
indicator_alloc.y = (height - indicator_alloc.height) / 2;
|
|
||||||
|
|
||||||
gtk_widget_size_allocate (priv->indicator_widget,
|
|
||||||
&indicator_alloc,
|
|
||||||
baseline);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_finalize (GObject *object)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM (object);
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (item);
|
|
||||||
|
|
||||||
gtk_widget_unparent (priv->indicator_widget);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gtk_check_menu_item_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *gobject_class;
|
|
||||||
GtkWidgetClass *widget_class;
|
|
||||||
GtkMenuItemClass *menu_item_class;
|
|
||||||
|
|
||||||
gobject_class = G_OBJECT_CLASS (klass);
|
|
||||||
widget_class = (GtkWidgetClass*) klass;
|
|
||||||
menu_item_class = (GtkMenuItemClass*) klass;
|
|
||||||
|
|
||||||
gobject_class->set_property = gtk_check_menu_item_set_property;
|
|
||||||
gobject_class->get_property = gtk_check_menu_item_get_property;
|
|
||||||
gobject_class->finalize = gtk_check_menu_item_finalize;
|
|
||||||
|
|
||||||
widget_class->size_allocate = gtk_check_menu_item_size_allocate;
|
|
||||||
widget_class->state_flags_changed = gtk_check_menu_item_state_flags_changed;
|
|
||||||
widget_class->direction_changed = gtk_check_menu_item_direction_changed;
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_ACTIVE,
|
|
||||||
g_param_spec_boolean ("active",
|
|
||||||
P_("Active"),
|
|
||||||
P_("Whether the menu item is checked"),
|
|
||||||
FALSE,
|
|
||||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_INCONSISTENT,
|
|
||||||
g_param_spec_boolean ("inconsistent",
|
|
||||||
P_("Inconsistent"),
|
|
||||||
P_("Whether to display an “inconsistent” state"),
|
|
||||||
FALSE,
|
|
||||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_DRAW_AS_RADIO,
|
|
||||||
g_param_spec_boolean ("draw-as-radio",
|
|
||||||
P_("Draw as radio menu item"),
|
|
||||||
P_("Whether the menu item looks like a radio menu item"),
|
|
||||||
FALSE,
|
|
||||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
|
|
||||||
menu_item_class->activate = gtk_check_menu_item_activate;
|
|
||||||
menu_item_class->hide_on_activate = FALSE;
|
|
||||||
menu_item_class->toggle_size_request = gtk_check_menu_item_toggle_size_request;
|
|
||||||
|
|
||||||
klass->toggled = NULL;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkCheckMenuItem::toggled:
|
|
||||||
* @checkmenuitem: the object which received the signal.
|
|
||||||
*
|
|
||||||
* This signal is emitted when the state of the check box is changed.
|
|
||||||
*
|
|
||||||
* A signal handler can use gtk_check_menu_item_get_active()
|
|
||||||
* to discover the new state.
|
|
||||||
*/
|
|
||||||
check_menu_item_signals[TOGGLED] =
|
|
||||||
g_signal_new (I_("toggled"),
|
|
||||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (GtkCheckMenuItemClass, toggled),
|
|
||||||
NULL, NULL,
|
|
||||||
NULL,
|
|
||||||
G_TYPE_NONE, 0);
|
|
||||||
|
|
||||||
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE);
|
|
||||||
gtk_widget_class_set_css_name (widget_class, I_("menuitem"));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_new:
|
|
||||||
*
|
|
||||||
* Creates a new #GtkCheckMenuItem.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkCheckMenuItem.
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_check_menu_item_new (void)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_CHECK_MENU_ITEM, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_new_with_label:
|
|
||||||
* @label: the string to use for the label.
|
|
||||||
*
|
|
||||||
* Creates a new #GtkCheckMenuItem with a label.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkCheckMenuItem.
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_check_menu_item_new_with_label (const gchar *label)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_CHECK_MENU_ITEM,
|
|
||||||
"label", label,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_new_with_mnemonic:
|
|
||||||
* @label: The text of the button, with an underscore in front of the
|
|
||||||
* character
|
|
||||||
*
|
|
||||||
* Creates a new #GtkCheckMenuItem containing a label. The label
|
|
||||||
* will be created using gtk_label_new_with_mnemonic(), so underscores
|
|
||||||
* in @label indicate the mnemonic for the menu item.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkCheckMenuItem
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_check_menu_item_new_with_mnemonic (const gchar *label)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_CHECK_MENU_ITEM,
|
|
||||||
"label", label,
|
|
||||||
"use-underline", TRUE,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_set_active:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem.
|
|
||||||
* @is_active: boolean value indicating whether the check box is active.
|
|
||||||
*
|
|
||||||
* Sets the active state of the menu item’s check box.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean is_active)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
|
|
||||||
|
|
||||||
is_active = is_active != 0;
|
|
||||||
|
|
||||||
if (priv->active != is_active)
|
|
||||||
gtk_menu_item_activate (GTK_MENU_ITEM (check_menu_item));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_get_active:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem
|
|
||||||
*
|
|
||||||
* Returns whether the check menu item is active. See
|
|
||||||
* gtk_check_menu_item_set_active ().
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if the menu item is checked.
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item), FALSE);
|
|
||||||
|
|
||||||
return priv->active;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_toggle_size_request (GtkMenuItem *menu_item,
|
|
||||||
gint *requisition)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (menu_item);
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (menu_item));
|
|
||||||
|
|
||||||
gtk_widget_measure (priv->indicator_widget,
|
|
||||||
GTK_ORIENTATION_HORIZONTAL,
|
|
||||||
-1,
|
|
||||||
requisition, NULL,
|
|
||||||
NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_toggled:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem.
|
|
||||||
*
|
|
||||||
* Emits the #GtkCheckMenuItem::toggled signal.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
g_signal_emit (check_menu_item, check_menu_item_signals[TOGGLED], 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
update_node_state (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
GtkStateFlags state;
|
|
||||||
|
|
||||||
state = gtk_widget_get_state_flags (GTK_WIDGET (check_menu_item));
|
|
||||||
state &= ~(GTK_STATE_FLAG_CHECKED | GTK_STATE_FLAG_INCONSISTENT);
|
|
||||||
|
|
||||||
if (priv->inconsistent)
|
|
||||||
state |= GTK_STATE_FLAG_INCONSISTENT;
|
|
||||||
if (priv->active)
|
|
||||||
state |= GTK_STATE_FLAG_CHECKED;
|
|
||||||
|
|
||||||
gtk_widget_set_state_flags (priv->indicator_widget, state, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_set_inconsistent:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem
|
|
||||||
* @setting: %TRUE to display an “inconsistent” third state check
|
|
||||||
*
|
|
||||||
* If the user has selected a range of elements (such as some text or
|
|
||||||
* spreadsheet cells) that are affected by a boolean setting, and the
|
|
||||||
* current values in that range are inconsistent, you may want to
|
|
||||||
* display the check in an “in between” state. This function turns on
|
|
||||||
* “in between” display. Normally you would turn off the inconsistent
|
|
||||||
* state again if the user explicitly selects a setting. This has to be
|
|
||||||
* done manually, gtk_check_menu_item_set_inconsistent() only affects
|
|
||||||
* visual appearance, it doesn’t affect the semantics of the widget.
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean setting)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
|
|
||||||
|
|
||||||
setting = setting != FALSE;
|
|
||||||
|
|
||||||
if (setting != priv->inconsistent)
|
|
||||||
{
|
|
||||||
priv->inconsistent = setting;
|
|
||||||
update_node_state (check_menu_item);
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (check_menu_item));
|
|
||||||
g_object_notify (G_OBJECT (check_menu_item), "inconsistent");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_get_inconsistent:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem
|
|
||||||
*
|
|
||||||
* Retrieves the value set by gtk_check_menu_item_set_inconsistent().
|
|
||||||
*
|
|
||||||
* Returns: %TRUE if inconsistent
|
|
||||||
**/
|
|
||||||
gboolean
|
|
||||||
gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item), FALSE);
|
|
||||||
|
|
||||||
return priv->inconsistent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_set_draw_as_radio:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem
|
|
||||||
* @draw_as_radio: whether @check_menu_item is drawn like a #GtkRadioMenuItem
|
|
||||||
*
|
|
||||||
* Sets whether @check_menu_item is drawn like a #GtkRadioMenuItem
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean draw_as_radio)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
GtkCssNode *indicator_node;
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item));
|
|
||||||
|
|
||||||
draw_as_radio = draw_as_radio != FALSE;
|
|
||||||
|
|
||||||
if (draw_as_radio != priv->draw_as_radio)
|
|
||||||
{
|
|
||||||
priv->draw_as_radio = draw_as_radio;
|
|
||||||
indicator_node = gtk_widget_get_css_node (priv->indicator_widget);
|
|
||||||
if (draw_as_radio)
|
|
||||||
gtk_css_node_set_name (indicator_node, I_("radio"));
|
|
||||||
else
|
|
||||||
gtk_css_node_set_name (indicator_node, I_("check"));
|
|
||||||
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (check_menu_item));
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (check_menu_item), "draw-as-radio");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_check_menu_item_get_draw_as_radio:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem
|
|
||||||
*
|
|
||||||
* Returns whether @check_menu_item looks like a #GtkRadioMenuItem
|
|
||||||
*
|
|
||||||
* Returns: Whether @check_menu_item looks like a #GtkRadioMenuItem
|
|
||||||
**/
|
|
||||||
gboolean
|
|
||||||
gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item), FALSE);
|
|
||||||
|
|
||||||
return priv->draw_as_radio;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
priv->active = FALSE;
|
|
||||||
|
|
||||||
priv->indicator_widget = gtk_icon_new ("check");
|
|
||||||
gtk_widget_set_parent (priv->indicator_widget, GTK_WIDGET (check_menu_item));
|
|
||||||
update_node_state (check_menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_activate (GtkMenuItem *menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (menu_item);
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
priv->active = !priv->active;
|
|
||||||
|
|
||||||
gtk_check_menu_item_toggled (check_menu_item);
|
|
||||||
update_node_state (check_menu_item);
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (check_menu_item));
|
|
||||||
|
|
||||||
GTK_MENU_ITEM_CLASS (gtk_check_menu_item_parent_class)->activate (menu_item);
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (check_menu_item), "active");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_state_flags_changed (GtkWidget *widget,
|
|
||||||
GtkStateFlags previous_state)
|
|
||||||
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (widget);
|
|
||||||
|
|
||||||
update_node_state (check_menu_item);
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_check_menu_item_parent_class)->state_flags_changed (widget, previous_state);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_direction_changed (GtkWidget *widget,
|
|
||||||
GtkTextDirection previous_dir)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (widget);
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
GtkStyleContext *context;
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (priv->indicator_widget);
|
|
||||||
|
|
||||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
|
||||||
{
|
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
|
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_RIGHT);
|
|
||||||
|
|
||||||
child = gtk_widget_get_last_child (widget);
|
|
||||||
|
|
||||||
if (child != priv->indicator_widget)
|
|
||||||
gtk_widget_insert_before (priv->indicator_widget, widget, NULL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
|
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_LEFT);
|
|
||||||
|
|
||||||
child = gtk_widget_get_first_child (widget);
|
|
||||||
|
|
||||||
if (child != priv->indicator_widget)
|
|
||||||
gtk_widget_insert_after (priv->indicator_widget, widget, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_check_menu_item_parent_class)->direction_changed (widget, previous_dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (object);
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_ACTIVE:
|
|
||||||
g_value_set_boolean (value, priv->active);
|
|
||||||
break;
|
|
||||||
case PROP_INCONSISTENT:
|
|
||||||
g_value_set_boolean (value, priv->inconsistent);
|
|
||||||
break;
|
|
||||||
case PROP_DRAW_AS_RADIO:
|
|
||||||
g_value_set_boolean (value, priv->draw_as_radio);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_check_menu_item_set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem *checkitem = GTK_CHECK_MENU_ITEM (object);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_ACTIVE:
|
|
||||||
gtk_check_menu_item_set_active (checkitem, g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
case PROP_INCONSISTENT:
|
|
||||||
gtk_check_menu_item_set_inconsistent (checkitem, g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
case PROP_DRAW_AS_RADIO:
|
|
||||||
gtk_check_menu_item_set_draw_as_radio (checkitem, g_value_get_boolean (value));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Private */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* _gtk_check_menu_item_set_active:
|
|
||||||
* @check_menu_item: a #GtkCheckMenuItem
|
|
||||||
* @is_active: whether the action is active or not
|
|
||||||
*
|
|
||||||
* Sets the #GtkCheckMenuItem:active property directly. This function does
|
|
||||||
* not emit signals or notifications: it is left to the caller to do so.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
_gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean is_active)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
priv->active = is_active;
|
|
||||||
update_node_state (check_menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkWidget *
|
|
||||||
_gtk_check_menu_item_get_indicator_widget (GtkCheckMenuItem *check_menu_item)
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemPrivate *priv = gtk_check_menu_item_get_instance_private (check_menu_item);
|
|
||||||
|
|
||||||
return priv->indicator_widget;
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_CHECK_MENU_ITEM_H__
|
|
||||||
#define __GTK_CHECK_MENU_ITEM_H__
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkmenuitem.h>
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_CHECK_MENU_ITEM (gtk_check_menu_item_get_type ())
|
|
||||||
#define GTK_CHECK_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CHECK_MENU_ITEM, GtkCheckMenuItem))
|
|
||||||
#define GTK_CHECK_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CHECK_MENU_ITEM, GtkCheckMenuItemClass))
|
|
||||||
#define GTK_IS_CHECK_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CHECK_MENU_ITEM))
|
|
||||||
#define GTK_IS_CHECK_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CHECK_MENU_ITEM))
|
|
||||||
#define GTK_CHECK_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CHECK_MENU_ITEM, GtkCheckMenuItemClass))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GtkCheckMenuItem GtkCheckMenuItem;
|
|
||||||
typedef struct _GtkCheckMenuItemClass GtkCheckMenuItemClass;
|
|
||||||
|
|
||||||
struct _GtkCheckMenuItem
|
|
||||||
{
|
|
||||||
GtkMenuItem menu_item;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkCheckMenuItemClass:
|
|
||||||
* @parent_class: The parent class.
|
|
||||||
* @toggled: Signal emitted when the state of the check box is changed.
|
|
||||||
*/
|
|
||||||
struct _GtkCheckMenuItemClass
|
|
||||||
{
|
|
||||||
GtkMenuItemClass parent_class;
|
|
||||||
|
|
||||||
/*< public >*/
|
|
||||||
|
|
||||||
void (* toggled) (GtkCheckMenuItem *check_menu_item);
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
|
|
||||||
gpointer padding[8];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_check_menu_item_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_check_menu_item_new (void);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean is_active);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean setting);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_check_menu_item_get_inconsistent (GtkCheckMenuItem *check_menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean draw_as_radio);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_CHECK_MENU_ITEM_H__ */
|
|
@ -1,31 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_CHECK_MENU_ITEM_PRIVATE_H__
|
|
||||||
#define __GTK_CHECK_MENU_ITEM_PRIVATE_H__
|
|
||||||
|
|
||||||
#include <gtk/gtkcheckmenuitem.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
void _gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
|
|
||||||
gboolean is_active);
|
|
||||||
GtkWidget * _gtk_check_menu_item_get_indicator_widget (GtkCheckMenuItem *check_menu_item);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_CHECK_MENU_ITEM_PRIVATE_H__ */
|
|
@ -32,9 +32,6 @@
|
|||||||
#include "gtkliststore.h"
|
#include "gtkliststore.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkmenuitem.h"
|
|
||||||
#include "gtkmenuprivate.h"
|
|
||||||
#include "gtkmenushellprivate.h"
|
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtktogglebutton.h"
|
#include "gtktogglebutton.h"
|
||||||
#include "gtktreepopoverprivate.h"
|
#include "gtktreepopoverprivate.h"
|
||||||
|
@ -55,7 +55,6 @@
|
|||||||
#include "gtkpopover.h"
|
#include "gtkpopover.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkprogressbar.h"
|
#include "gtkprogressbar.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtkselection.h"
|
#include "gtkselection.h"
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtksnapshot.h"
|
#include "gtksnapshot.h"
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include "gtkcelllayout.h"
|
#include "gtkcelllayout.h"
|
||||||
#include "gtkcellrendererpixbuf.h"
|
#include "gtkcellrendererpixbuf.h"
|
||||||
#include "gtkcellrenderertext.h"
|
#include "gtkcellrenderertext.h"
|
||||||
#include "gtkcheckmenuitem.h"
|
|
||||||
#include "gtkcomboboxtext.h"
|
#include "gtkcomboboxtext.h"
|
||||||
#include "gtkcssnumbervalueprivate.h"
|
#include "gtkcssnumbervalueprivate.h"
|
||||||
#include "gtkdragsource.h"
|
#include "gtkdragsource.h"
|
||||||
@ -55,7 +54,6 @@
|
|||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkrecentmanager.h"
|
#include "gtkrecentmanager.h"
|
||||||
#include "gtksearchentryprivate.h"
|
#include "gtksearchentryprivate.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtksizegroup.h"
|
#include "gtksizegroup.h"
|
||||||
#include "gtksizerequest.h"
|
#include "gtksizerequest.h"
|
||||||
|
@ -41,12 +41,9 @@
|
|||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkmenuitem.h"
|
|
||||||
#include "gtkmenushellprivate.h"
|
|
||||||
#include "gtknotebook.h"
|
#include "gtknotebook.h"
|
||||||
#include "gtkpango.h"
|
#include "gtkpango.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtkshow.h"
|
#include "gtkshow.h"
|
||||||
#include "gtksnapshot.h"
|
#include "gtksnapshot.h"
|
||||||
#include "gtkstylecontextprivate.h"
|
#include "gtkstylecontextprivate.h"
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtk/gtkwindow.h>
|
#include <gtk/gtkwindow.h>
|
||||||
#include <gtk/gtkmenu.h>
|
|
||||||
#include <gtk/gtkwidget.h>
|
#include <gtk/gtkwidget.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -119,7 +119,6 @@
|
|||||||
#include "gtkdndprivate.h"
|
#include "gtkdndprivate.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmediafileprivate.h"
|
#include "gtkmediafileprivate.h"
|
||||||
#include "gtkmenu.h"
|
|
||||||
#include "gtkmodulesprivate.h"
|
#include "gtkmodulesprivate.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkrecentmanager.h"
|
#include "gtkrecentmanager.h"
|
||||||
|
2792
gtk/gtkmenu.c
2792
gtk/gtkmenu.c
File diff suppressed because it is too large
Load Diff
140
gtk/gtkmenu.h
140
gtk/gtkmenu.h
@ -1,140 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_H__
|
|
||||||
#define __GTK_MENU_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkaccelgroup.h>
|
|
||||||
#include <gtk/gtkmenushell.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU (gtk_menu_get_type ())
|
|
||||||
#define GTK_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU, GtkMenu))
|
|
||||||
#define GTK_IS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GtkMenu GtkMenu;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkMenuDetachFunc:
|
|
||||||
* @attach_widget: the #GtkWidget that the menu is being detached from.
|
|
||||||
* @menu: the #GtkMenu being detached.
|
|
||||||
*
|
|
||||||
* A user function supplied when calling gtk_menu_attach_to_widget() which
|
|
||||||
* will be called when the menu is later detached from the widget.
|
|
||||||
*/
|
|
||||||
typedef void (*GtkMenuDetachFunc) (GtkWidget *attach_widget,
|
|
||||||
GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_get_type (void) G_GNUC_CONST;
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_new (void);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_new_from_model (GMenuModel *model);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_popup_at_rect (GtkMenu *menu,
|
|
||||||
GdkSurface *rect_surface,
|
|
||||||
const GdkRectangle *rect,
|
|
||||||
GdkGravity rect_anchor,
|
|
||||||
GdkGravity menu_anchor,
|
|
||||||
const GdkEvent *trigger_event);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_popup_at_widget (GtkMenu *menu,
|
|
||||||
GtkWidget *widget,
|
|
||||||
GdkGravity widget_anchor,
|
|
||||||
GdkGravity menu_anchor,
|
|
||||||
const GdkEvent *trigger_event);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_popup_at_pointer (GtkMenu *menu,
|
|
||||||
const GdkEvent *trigger_event);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_reposition (GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_popdown (GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_get_active (GtkMenu *menu);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_set_active (GtkMenu *menu,
|
|
||||||
guint index);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_set_accel_group (GtkMenu *menu,
|
|
||||||
GtkAccelGroup *accel_group);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkAccelGroup* gtk_menu_get_accel_group (GtkMenu *menu);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_set_accel_path (GtkMenu *menu,
|
|
||||||
const gchar *accel_path);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
const gchar* gtk_menu_get_accel_path (GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_attach_to_widget (GtkMenu *menu,
|
|
||||||
GtkWidget *attach_widget,
|
|
||||||
GtkMenuDetachFunc detacher);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_detach (GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_get_attach_widget (GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_reorder_child (GtkMenu *menu,
|
|
||||||
GtkWidget *child,
|
|
||||||
gint position);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_set_monitor (GtkMenu *menu,
|
|
||||||
gint monitor_num);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gint gtk_menu_get_monitor (GtkMenu *menu);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_place_on_monitor (GtkMenu *menu,
|
|
||||||
GdkMonitor *monitor);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GList* gtk_menu_get_for_attach_widget (GtkWidget *widget);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_set_reserve_toggle_size (GtkMenu *menu,
|
|
||||||
gboolean reserve_toggle_size);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_menu_get_reserve_toggle_size (GtkMenu *menu);
|
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenu, g_object_unref)
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_H__ */
|
|
489
gtk/gtkmenubar.c
489
gtk/gtkmenubar.c
@ -1,489 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:gtkmenubar
|
|
||||||
* @Title: GtkMenuBar
|
|
||||||
* @Short_description: A subclass of GtkMenuShell which holds GtkMenuItem widgets
|
|
||||||
* @See_also: #GtkMenuShell, #GtkMenu, #GtkMenuItem
|
|
||||||
*
|
|
||||||
* The #GtkMenuBar is a subclass of #GtkMenuShell which contains one or
|
|
||||||
* more #GtkMenuItems. The result is a standard menu bar which can hold
|
|
||||||
* many menu items.
|
|
||||||
*
|
|
||||||
* # CSS nodes
|
|
||||||
*
|
|
||||||
* GtkMenuBar has a single CSS node with name menubar.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "gtkmenubar.h"
|
|
||||||
#include "gtkmenubarprivate.h"
|
|
||||||
|
|
||||||
#include "gtkboxlayout.h"
|
|
||||||
#include "gtkbindings.h"
|
|
||||||
#include "gtkmain.h"
|
|
||||||
#include "gtkmarshalers.h"
|
|
||||||
#include "gtkmenuitemprivate.h"
|
|
||||||
#include "gtkmenuprivate.h"
|
|
||||||
#include "gtkmenushellprivate.h"
|
|
||||||
#include "gtksettings.h"
|
|
||||||
#include "gtksizerequest.h"
|
|
||||||
#include "gtkwindow.h"
|
|
||||||
#include "gtkcontainerprivate.h"
|
|
||||||
#include "gtkcheckmenuitem.h"
|
|
||||||
#include "gtkintl.h"
|
|
||||||
#include "gtkprivate.h"
|
|
||||||
#include "gtktypebuiltins.h"
|
|
||||||
#include "gtkwidgetprivate.h"
|
|
||||||
|
|
||||||
#define MENU_BAR_POPUP_DELAY 0
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GtkMenuBarPrivate GtkMenuBarPrivate;
|
|
||||||
typedef struct _GtkMenuBarClass GtkMenuBarClass;
|
|
||||||
|
|
||||||
struct _GtkMenuBar
|
|
||||||
{
|
|
||||||
GtkMenuShell menu_shell;
|
|
||||||
|
|
||||||
int toggle_size;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuBarClass
|
|
||||||
{
|
|
||||||
GtkMenuShellClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void gtk_menu_bar_add (GtkContainer *container,
|
|
||||||
GtkWidget *widget);
|
|
||||||
static void gtk_menu_bar_remove (GtkContainer *container,
|
|
||||||
GtkWidget *widget);
|
|
||||||
|
|
||||||
static void gtk_menu_bar_root (GtkWidget *widget);
|
|
||||||
static void gtk_menu_bar_unroot (GtkWidget *widget);
|
|
||||||
static gint gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell);
|
|
||||||
static void gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
|
|
||||||
GtkMenuDirectionType direction);
|
|
||||||
static void gtk_menu_bar_insert (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *child,
|
|
||||||
gint position);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkMenuBar, gtk_menu_bar, GTK_TYPE_MENU_SHELL)
|
|
||||||
|
|
||||||
static GList *
|
|
||||||
gtk_menu_bar_get_items (GtkMenuShell *menu_shell)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menu_bar = GTK_MENU_BAR (menu_shell);
|
|
||||||
GList *list = NULL;
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
for (child = gtk_widget_get_last_child (GTK_WIDGET (menu_bar));
|
|
||||||
child != NULL;
|
|
||||||
child = gtk_widget_get_prev_sibling (child))
|
|
||||||
{
|
|
||||||
list = g_list_prepend (list, child);
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_finalize (GObject *object)
|
|
||||||
{
|
|
||||||
G_OBJECT_CLASS (gtk_menu_bar_parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_dispose (GObject *object)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menu_bar = GTK_MENU_BAR (object);
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
child = gtk_widget_get_first_child (GTK_WIDGET (menu_bar));
|
|
||||||
while (child)
|
|
||||||
{
|
|
||||||
GtkWidget *next = gtk_widget_get_next_sibling (child);
|
|
||||||
|
|
||||||
gtk_widget_unparent (child);
|
|
||||||
|
|
||||||
child = next;
|
|
||||||
}
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gtk_menu_bar_parent_class)->dispose (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_forall (GtkContainer *container,
|
|
||||||
GtkCallback callback,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menu_bar = GTK_MENU_BAR (container);
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
child = gtk_widget_get_first_child (GTK_WIDGET (menu_bar));
|
|
||||||
while (child)
|
|
||||||
{
|
|
||||||
GtkWidget *next = gtk_widget_get_next_sibling (child);
|
|
||||||
|
|
||||||
(*callback) (child, data);
|
|
||||||
|
|
||||||
child = next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_class_init (GtkMenuBarClass *class)
|
|
||||||
{
|
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
|
||||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
|
||||||
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
|
|
||||||
GtkMenuShellClass *menu_shell_class = GTK_MENU_SHELL_CLASS (class);
|
|
||||||
|
|
||||||
GtkBindingSet *binding_set;
|
|
||||||
|
|
||||||
object_class->finalize = gtk_menu_bar_finalize;
|
|
||||||
object_class->dispose = gtk_menu_bar_dispose;
|
|
||||||
|
|
||||||
widget_class->root = gtk_menu_bar_root;
|
|
||||||
widget_class->unroot = gtk_menu_bar_unroot;
|
|
||||||
|
|
||||||
container_class->add = gtk_menu_bar_add;
|
|
||||||
container_class->remove = gtk_menu_bar_remove;
|
|
||||||
container_class->forall = gtk_menu_bar_forall;
|
|
||||||
|
|
||||||
menu_shell_class->insert = gtk_menu_bar_insert;
|
|
||||||
menu_shell_class->submenu_placement = GTK_TOP_BOTTOM;
|
|
||||||
menu_shell_class->get_popup_delay = gtk_menu_bar_get_popup_delay;
|
|
||||||
menu_shell_class->move_current = gtk_menu_bar_move_current;
|
|
||||||
menu_shell_class->get_items = gtk_menu_bar_get_items;
|
|
||||||
|
|
||||||
binding_set = gtk_binding_set_by_class (class);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_Left, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_PREV);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_KP_Left, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_PREV);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_Right, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_NEXT);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_KP_Right, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_NEXT);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_Up, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_PARENT);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_KP_Up, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_PARENT);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_Down, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_CHILD);
|
|
||||||
gtk_binding_entry_add_signal (binding_set,
|
|
||||||
GDK_KEY_KP_Down, 0,
|
|
||||||
"move-current", 1,
|
|
||||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
|
||||||
GTK_MENU_DIR_CHILD);
|
|
||||||
|
|
||||||
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_MENU_BAR);
|
|
||||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT);
|
|
||||||
gtk_widget_class_set_css_name (widget_class, I_("menubar"));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_init (GtkMenuBar *menu_bar)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_menu_bar_new:
|
|
||||||
*
|
|
||||||
* Creates a new #GtkMenuBar
|
|
||||||
*
|
|
||||||
* Returns: the new menu bar, as a #GtkWidget
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_menu_bar_new (void)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_MENU_BAR, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GList *
|
|
||||||
get_menu_bars (GtkWindow *window)
|
|
||||||
{
|
|
||||||
return g_object_get_data (G_OBJECT (window), "gtk-menu-bar-list");
|
|
||||||
}
|
|
||||||
|
|
||||||
GList *
|
|
||||||
_gtk_menu_bar_get_viewable_menu_bars (GtkWindow *window)
|
|
||||||
{
|
|
||||||
GList *menu_bars;
|
|
||||||
GList *viewable_menu_bars = NULL;
|
|
||||||
|
|
||||||
for (menu_bars = get_menu_bars (window);
|
|
||||||
menu_bars;
|
|
||||||
menu_bars = menu_bars->next)
|
|
||||||
{
|
|
||||||
GtkWidget *widget = menu_bars->data;
|
|
||||||
gboolean viewable = TRUE;
|
|
||||||
|
|
||||||
while (widget)
|
|
||||||
{
|
|
||||||
if (!gtk_widget_get_mapped (widget))
|
|
||||||
viewable = FALSE;
|
|
||||||
|
|
||||||
widget = gtk_widget_get_parent (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (viewable)
|
|
||||||
viewable_menu_bars = g_list_prepend (viewable_menu_bars, menu_bars->data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return g_list_reverse (viewable_menu_bars);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
set_menu_bars (GtkWindow *window,
|
|
||||||
GList *menubars)
|
|
||||||
{
|
|
||||||
g_object_set_data (G_OBJECT (window), I_("gtk-menu-bar-list"), menubars);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
add_to_window (GtkWindow *window,
|
|
||||||
GtkMenuBar *menubar)
|
|
||||||
{
|
|
||||||
GList *menubars = get_menu_bars (window);
|
|
||||||
|
|
||||||
set_menu_bars (window, g_list_prepend (menubars, menubar));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
remove_from_window (GtkWindow *window,
|
|
||||||
GtkMenuBar *menubar)
|
|
||||||
{
|
|
||||||
GList *menubars = get_menu_bars (window);
|
|
||||||
|
|
||||||
menubars = g_list_remove (menubars, menubar);
|
|
||||||
set_menu_bars (window, menubars);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_root (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menubar = GTK_MENU_BAR (widget);
|
|
||||||
GtkWidget *toplevel;
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->root (widget);
|
|
||||||
|
|
||||||
toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
|
|
||||||
add_to_window (GTK_WINDOW (toplevel), menubar);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_unroot (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menubar = GTK_MENU_BAR (widget);
|
|
||||||
GtkWidget *toplevel;
|
|
||||||
|
|
||||||
toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
|
|
||||||
remove_from_window (GTK_WINDOW (toplevel), menubar);
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->unroot (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* _gtk_menu_bar_cycle_focus:
|
|
||||||
* @menubar: a #GtkMenuBar
|
|
||||||
* @dir: direction in which to cycle the focus
|
|
||||||
*
|
|
||||||
* Move the focus between menubars in the toplevel.
|
|
||||||
**/
|
|
||||||
void
|
|
||||||
_gtk_menu_bar_cycle_focus (GtkMenuBar *menubar,
|
|
||||||
GtkDirectionType dir)
|
|
||||||
{
|
|
||||||
GtkWidget *toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (menubar)));
|
|
||||||
GtkMenuItem *to_activate = NULL;
|
|
||||||
|
|
||||||
if (GTK_IS_WINDOW (toplevel))
|
|
||||||
{
|
|
||||||
GList *tmp_menubars = _gtk_menu_bar_get_viewable_menu_bars (GTK_WINDOW (toplevel));
|
|
||||||
GList *l;
|
|
||||||
GPtrArray *menubars;
|
|
||||||
gboolean found;
|
|
||||||
guint index;
|
|
||||||
|
|
||||||
menubars = g_ptr_array_sized_new (g_list_length (tmp_menubars));
|
|
||||||
|
|
||||||
for (l = tmp_menubars; l; l = l->next)
|
|
||||||
g_ptr_array_add (menubars, l->data);
|
|
||||||
|
|
||||||
gtk_widget_focus_sort (toplevel, dir, menubars);
|
|
||||||
|
|
||||||
found = g_ptr_array_find (menubars, menubar, &index);
|
|
||||||
|
|
||||||
if (found && index < menubars->len - 1)
|
|
||||||
{
|
|
||||||
GtkWidget *next = g_ptr_array_index (menubars, index + 1);
|
|
||||||
GtkMenuShell *new_menushell = GTK_MENU_SHELL (next);
|
|
||||||
GList *children = gtk_menu_shell_get_items (new_menushell);
|
|
||||||
|
|
||||||
if (children)
|
|
||||||
to_activate = children->data;
|
|
||||||
g_list_free (children);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_ptr_array_free (menubars, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_menu_shell_cancel (GTK_MENU_SHELL (menubar));
|
|
||||||
|
|
||||||
if (to_activate)
|
|
||||||
g_signal_emit_by_name (to_activate, "activate_item");
|
|
||||||
}
|
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell)
|
|
||||||
{
|
|
||||||
return MENU_BAR_POPUP_DELAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_move_current (GtkMenuShell *menu_shell,
|
|
||||||
GtkMenuDirectionType direction)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menubar = GTK_MENU_BAR (menu_shell);
|
|
||||||
|
|
||||||
if (gtk_widget_get_direction (GTK_WIDGET (menubar)) == GTK_TEXT_DIR_RTL)
|
|
||||||
{
|
|
||||||
switch (direction)
|
|
||||||
{
|
|
||||||
case GTK_MENU_DIR_PREV:
|
|
||||||
direction = GTK_MENU_DIR_NEXT;
|
|
||||||
break;
|
|
||||||
case GTK_MENU_DIR_NEXT:
|
|
||||||
direction = GTK_MENU_DIR_PREV;
|
|
||||||
break;
|
|
||||||
case GTK_MENU_DIR_PARENT:
|
|
||||||
case GTK_MENU_DIR_CHILD:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GTK_MENU_SHELL_CLASS (gtk_menu_bar_parent_class)->move_current (menu_shell, direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_menu_bar_new_from_model:
|
|
||||||
* @model: a #GMenuModel
|
|
||||||
*
|
|
||||||
* Creates a new #GtkMenuBar and populates it with menu items
|
|
||||||
* and submenus according to @model.
|
|
||||||
*
|
|
||||||
* The created menu items are connected to actions found in the
|
|
||||||
* #GtkApplicationWindow to which the menu bar belongs - typically
|
|
||||||
* by means of being contained within the #GtkApplicationWindows
|
|
||||||
* widget hierarchy.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkMenuBar
|
|
||||||
*/
|
|
||||||
GtkWidget *
|
|
||||||
gtk_menu_bar_new_from_model (GMenuModel *model)
|
|
||||||
{
|
|
||||||
GtkWidget *menubar;
|
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_MENU_MODEL (model), NULL);
|
|
||||||
|
|
||||||
menubar = gtk_menu_bar_new ();
|
|
||||||
gtk_menu_shell_bind_model (GTK_MENU_SHELL (menubar), model, NULL, FALSE);
|
|
||||||
|
|
||||||
return menubar;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_add (GtkContainer *container,
|
|
||||||
GtkWidget *widget)
|
|
||||||
{
|
|
||||||
gtk_widget_set_parent (widget, GTK_WIDGET (container));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_remove (GtkContainer *container,
|
|
||||||
GtkWidget *widget)
|
|
||||||
{
|
|
||||||
gtk_widget_unparent (widget);
|
|
||||||
|
|
||||||
GTK_CONTAINER_CLASS (gtk_menu_bar_parent_class)->remove (container, widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_reorder_child (GtkMenuBar *menu_bar,
|
|
||||||
GtkWidget *child,
|
|
||||||
gint position)
|
|
||||||
{
|
|
||||||
GtkWidget *sibling = NULL;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (position < 0)
|
|
||||||
sibling = gtk_widget_get_last_child (GTK_WIDGET (menu_bar));
|
|
||||||
|
|
||||||
for (i = 0; i < position; i++)
|
|
||||||
{
|
|
||||||
if (sibling == NULL)
|
|
||||||
sibling = gtk_widget_get_first_child (GTK_WIDGET (menu_bar));
|
|
||||||
else
|
|
||||||
sibling = gtk_widget_get_next_sibling (sibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_insert_after (child, GTK_WIDGET (menu_bar), sibling);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_menu_bar_insert (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *child,
|
|
||||||
gint position)
|
|
||||||
{
|
|
||||||
GtkMenuBar *menu_bar = GTK_MENU_BAR (menu_shell);
|
|
||||||
|
|
||||||
gtk_widget_set_parent (child, GTK_WIDGET (menu_bar));
|
|
||||||
gtk_menu_bar_reorder_child (menu_bar, child, position);
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_BAR_H__
|
|
||||||
#define __GTK_MENU_BAR_H__
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkmenushell.h>
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU_BAR (gtk_menu_bar_get_type ())
|
|
||||||
#define GTK_MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_BAR, GtkMenuBar))
|
|
||||||
#define GTK_IS_MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_BAR))
|
|
||||||
|
|
||||||
typedef struct _GtkMenuBar GtkMenuBar;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_bar_get_type (void) G_GNUC_CONST;
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_bar_new (void);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_bar_new_from_model (GMenuModel *model);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_BAR_H__ */
|
|
@ -1,43 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_BAR_PRIVATE_H__
|
|
||||||
#define __GTK_MENU_BAR_PRIVATE_H__
|
|
||||||
|
|
||||||
|
|
||||||
#include <gtk/gtkmenubar.h>
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
|
|
||||||
void _gtk_menu_bar_cycle_focus (GtkMenuBar *menubar,
|
|
||||||
GtkDirectionType dir);
|
|
||||||
GList* _gtk_menu_bar_get_viewable_menu_bars (GtkWindow *window);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_BAR_PRIVATE_H__ */
|
|
1951
gtk/gtkmenuitem.c
1951
gtk/gtkmenuitem.c
File diff suppressed because it is too large
Load Diff
@ -1,158 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_ITEM_H__
|
|
||||||
#define __GTK_MENU_ITEM_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkbin.h>
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU_ITEM (gtk_menu_item_get_type ())
|
|
||||||
#define GTK_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItem))
|
|
||||||
#define GTK_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
|
|
||||||
#define GTK_IS_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_ITEM))
|
|
||||||
#define GTK_IS_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_ITEM))
|
|
||||||
#define GTK_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItemClass))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GtkMenuItem GtkMenuItem;
|
|
||||||
typedef struct _GtkMenuItemClass GtkMenuItemClass;
|
|
||||||
typedef struct _GtkMenuItemPrivate GtkMenuItemPrivate;
|
|
||||||
|
|
||||||
struct _GtkMenuItem
|
|
||||||
{
|
|
||||||
GtkBin bin;
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
GtkMenuItemPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkMenuItemClass:
|
|
||||||
* @parent_class: The parent class.
|
|
||||||
* @hide_on_activate: If %TRUE, then we should always
|
|
||||||
* hide the menu when the %GtkMenuItem is activated. Otherwise,
|
|
||||||
* it is up to the caller.
|
|
||||||
* @activate: Signal emitted when the item is activated.
|
|
||||||
* @activate_item: Signal emitted when the item is activated, but also
|
|
||||||
* if the menu item has a submenu.
|
|
||||||
* @toggle_size_request:
|
|
||||||
* @toggle_size_allocate:
|
|
||||||
* @set_label: Sets @text on the #GtkMenuItem label
|
|
||||||
* @get_label: Gets @text from the #GtkMenuItem label
|
|
||||||
* @select: Signal emitted when the item is selected.
|
|
||||||
* @deselect: Signal emitted when the item is deselected.
|
|
||||||
*/
|
|
||||||
struct _GtkMenuItemClass
|
|
||||||
{
|
|
||||||
GtkBinClass parent_class;
|
|
||||||
|
|
||||||
/*< public >*/
|
|
||||||
|
|
||||||
/* If the following flag is true, then we should always
|
|
||||||
* hide the menu when the MenuItem is activated. Otherwise,
|
|
||||||
* it is up to the caller. For instance, when navigating
|
|
||||||
* a menu with the keyboard, <Space> doesn't hide, but
|
|
||||||
* <Return> does.
|
|
||||||
*/
|
|
||||||
guint hide_on_activate : 1;
|
|
||||||
|
|
||||||
void (* activate) (GtkMenuItem *menu_item);
|
|
||||||
void (* activate_item) (GtkMenuItem *menu_item);
|
|
||||||
void (* toggle_size_request) (GtkMenuItem *menu_item,
|
|
||||||
gint *requisition);
|
|
||||||
void (* toggle_size_allocate) (GtkMenuItem *menu_item,
|
|
||||||
gint allocation);
|
|
||||||
void (* set_label) (GtkMenuItem *menu_item,
|
|
||||||
const gchar *label);
|
|
||||||
const gchar * (* get_label) (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
void (* select) (GtkMenuItem *menu_item);
|
|
||||||
void (* deselect) (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
|
|
||||||
gpointer padding[8];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_item_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_item_new (void);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_set_submenu (GtkMenuItem *menu_item,
|
|
||||||
GtkWidget *submenu);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_menu_item_get_submenu (GtkMenuItem *menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_select (GtkMenuItem *menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_deselect (GtkMenuItem *menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_activate (GtkMenuItem *menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_toggle_size_request (GtkMenuItem *menu_item,
|
|
||||||
gint *requisition);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_toggle_size_allocate (GtkMenuItem *menu_item,
|
|
||||||
gint allocation);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
|
|
||||||
const gchar *accel_path);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
const gchar * gtk_menu_item_get_accel_path (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_set_label (GtkMenuItem *menu_item,
|
|
||||||
const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
const gchar * gtk_menu_item_get_label (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_set_use_underline (GtkMenuItem *menu_item,
|
|
||||||
gboolean setting);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_menu_item_get_use_underline (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_item_set_reserve_indicator (GtkMenuItem *menu_item,
|
|
||||||
gboolean reserve);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_menu_item_get_reserve_indicator (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_ITEM_H__ */
|
|
@ -1,63 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_ITEM_PRIVATE_H__
|
|
||||||
#define __GTK_MENU_ITEM_PRIVATE_H__
|
|
||||||
|
|
||||||
#include <gtk/gtkmenuitem.h>
|
|
||||||
#include <gtk/gtkmenushell.h>
|
|
||||||
#include <gtk/gtkactionhelperprivate.h>
|
|
||||||
#include <gtk/gtkcssnodeprivate.h>
|
|
||||||
#include <gtk/gtkeventcontrollermotion.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
struct _GtkMenuItemPrivate
|
|
||||||
{
|
|
||||||
GtkWidget *submenu;
|
|
||||||
|
|
||||||
guint16 toggle_size;
|
|
||||||
guint16 accelerator_width;
|
|
||||||
|
|
||||||
guint timer;
|
|
||||||
|
|
||||||
const char *accel_path;
|
|
||||||
|
|
||||||
GtkActionHelper *action_helper;
|
|
||||||
|
|
||||||
GtkWidget *arrow_widget;
|
|
||||||
|
|
||||||
guint submenu_placement : 1;
|
|
||||||
guint submenu_direction : 1;
|
|
||||||
guint from_menubar : 1;
|
|
||||||
guint reserve_indicator : 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
void _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
|
|
||||||
const gchar *prefix,
|
|
||||||
GtkAccelGroup *accel_group,
|
|
||||||
gboolean group_changed);
|
|
||||||
gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item);
|
|
||||||
void _gtk_menu_item_popup_submenu (GtkWidget *menu_item,
|
|
||||||
gboolean with_delay);
|
|
||||||
void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item);
|
|
||||||
GtkMenuShell *
|
|
||||||
gtk_menu_item_get_menu_shell (GtkMenuItem *menu_item);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_ITEM_PRIVATE_H__ */
|
|
@ -1,96 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_PRIVATE_H__
|
|
||||||
#define __GTK_MENU_PRIVATE_H__
|
|
||||||
|
|
||||||
#include <gtk/gtkmenu.h>
|
|
||||||
#include <gtk/gtkcssnodeprivate.h>
|
|
||||||
#include <gtk/gtkgestureclick.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
typedef struct _GtkMenuClass GtkMenuClass;
|
|
||||||
typedef struct _GtkMenuPrivate GtkMenuPrivate;
|
|
||||||
|
|
||||||
struct _GtkMenu
|
|
||||||
{
|
|
||||||
GtkMenuShell menu_shell;
|
|
||||||
|
|
||||||
GtkMenuPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuClass
|
|
||||||
{
|
|
||||||
GtkMenuShellClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuPrivate
|
|
||||||
{
|
|
||||||
GtkWidget *parent_menu_item;
|
|
||||||
GtkWidget *old_active_menu_item;
|
|
||||||
|
|
||||||
GtkAccelGroup *accel_group;
|
|
||||||
const char *accel_path;
|
|
||||||
|
|
||||||
GdkSurface *rect_surface;
|
|
||||||
GdkRectangle rect;
|
|
||||||
GtkWidget *widget;
|
|
||||||
GdkGravity rect_anchor;
|
|
||||||
GdkGravity menu_anchor;
|
|
||||||
GdkAnchorHints anchor_hints;
|
|
||||||
gint rect_anchor_dx;
|
|
||||||
gint rect_anchor_dy;
|
|
||||||
GdkSurfaceTypeHint menu_type_hint;
|
|
||||||
|
|
||||||
guint toggle_size;
|
|
||||||
guint accel_size;
|
|
||||||
|
|
||||||
/* Do _not_ touch these widgets directly. We hide the reference
|
|
||||||
* count from the toplevel to the menu, so it must be restored
|
|
||||||
* before operating on these widgets
|
|
||||||
*/
|
|
||||||
GtkWidget *toplevel;
|
|
||||||
GtkWidget *swin;
|
|
||||||
GtkWidget *box;
|
|
||||||
|
|
||||||
guint needs_destruction_ref : 1;
|
|
||||||
|
|
||||||
guint ignore_button_release : 1;
|
|
||||||
guint no_toggle_size : 1;
|
|
||||||
|
|
||||||
gint monitor_num;
|
|
||||||
};
|
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
void gtk_menu_update_scroll_offset (GtkMenu *menu,
|
|
||||||
const GdkRectangle *flipped_rect,
|
|
||||||
const GdkRectangle *final_rect,
|
|
||||||
gboolean flipped_x,
|
|
||||||
gboolean flipped_y,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_PRIVATE_H__ */
|
|
1947
gtk/gtkmenushell.c
1947
gtk/gtkmenushell.c
File diff suppressed because it is too large
Load Diff
@ -1,135 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_SHELL_H__
|
|
||||||
#define __GTK_MENU_SHELL_H__
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkcontainer.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_MENU_SHELL (gtk_menu_shell_get_type ())
|
|
||||||
#define GTK_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShell))
|
|
||||||
#define GTK_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
|
|
||||||
#define GTK_IS_MENU_SHELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_SHELL))
|
|
||||||
#define GTK_IS_MENU_SHELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL))
|
|
||||||
#define GTK_MENU_SHELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GtkMenuShell GtkMenuShell;
|
|
||||||
typedef struct _GtkMenuShellClass GtkMenuShellClass;
|
|
||||||
typedef struct _GtkMenuShellPrivate GtkMenuShellPrivate;
|
|
||||||
|
|
||||||
struct _GtkMenuShell
|
|
||||||
{
|
|
||||||
GtkContainer container;
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
GtkMenuShellPrivate *priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkMenuShellClass
|
|
||||||
{
|
|
||||||
GtkContainerClass parent_class;
|
|
||||||
|
|
||||||
guint submenu_placement : 1;
|
|
||||||
|
|
||||||
void (*deactivate) (GtkMenuShell *menu_shell);
|
|
||||||
void (*selection_done) (GtkMenuShell *menu_shell);
|
|
||||||
|
|
||||||
void (*move_current) (GtkMenuShell *menu_shell,
|
|
||||||
GtkMenuDirectionType direction);
|
|
||||||
void (*activate_current) (GtkMenuShell *menu_shell,
|
|
||||||
gboolean force_hide);
|
|
||||||
void (*cancel) (GtkMenuShell *menu_shell);
|
|
||||||
void (*select_item) (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *menu_item);
|
|
||||||
void (*insert) (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *child,
|
|
||||||
gint position);
|
|
||||||
gint (*get_popup_delay) (GtkMenuShell *menu_shell);
|
|
||||||
gboolean (*move_selected) (GtkMenuShell *menu_shell,
|
|
||||||
gint distance);
|
|
||||||
GList * (*get_items) (GtkMenuShell *menu_shell);
|
|
||||||
|
|
||||||
/*< private >*/
|
|
||||||
gpointer padding[8];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_menu_shell_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_append (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *child);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_prepend (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *child);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_insert (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *child,
|
|
||||||
gint position);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_deactivate (GtkMenuShell *menu_shell);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_select_item (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_deselect (GtkMenuShell *menu_shell);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_activate_item (GtkMenuShell *menu_shell,
|
|
||||||
GtkWidget *menu_item,
|
|
||||||
gboolean force_deactivate);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_select_first (GtkMenuShell *menu_shell,
|
|
||||||
gboolean search_sensitive);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_cancel (GtkMenuShell *menu_shell);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
gboolean gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
|
|
||||||
gboolean take_focus);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget *gtk_menu_shell_get_selected_item (GtkMenuShell *menu_shell);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget *gtk_menu_shell_get_parent_shell (GtkMenuShell *menu_shell);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_menu_shell_bind_model (GtkMenuShell *menu_shell,
|
|
||||||
GMenuModel *model,
|
|
||||||
const gchar *action_namespace,
|
|
||||||
gboolean with_separators);
|
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuShell, g_object_unref)
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_SHELL_H__ */
|
|
@ -1,98 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MENU_SHELL_PRIVATE_H__
|
|
||||||
#define __GTK_MENU_SHELL_PRIVATE_H__
|
|
||||||
|
|
||||||
|
|
||||||
#include <gtk/gtkmenushell.h>
|
|
||||||
#include <gtk/gtkmnemonichash.h>
|
|
||||||
#include <gtk/gtkkeyhash.h>
|
|
||||||
#include <gtk/gtkmenutrackerprivate.h>
|
|
||||||
#include <gtk/gtkeventcontroller.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
/* Placement of submenus */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
GTK_TOP_BOTTOM,
|
|
||||||
GTK_LEFT_RIGHT
|
|
||||||
} GtkSubmenuPlacement;
|
|
||||||
|
|
||||||
struct _GtkMenuShellPrivate
|
|
||||||
{
|
|
||||||
GtkWidget *active_menu_item; /* This is not an "active" menu item
|
|
||||||
* (there is no such thing) but rather,
|
|
||||||
* the selected menu item in that MenuShell,
|
|
||||||
* if there is one.
|
|
||||||
*/
|
|
||||||
GtkWidget *parent_menu_shell;
|
|
||||||
GtkMenuTracker *tracker; // if bound to a GMenuModel
|
|
||||||
|
|
||||||
guint button;
|
|
||||||
guint32 activate_time;
|
|
||||||
|
|
||||||
guint active : 1;
|
|
||||||
guint have_grab : 1;
|
|
||||||
guint have_xgrab : 1;
|
|
||||||
guint ignore_enter : 1;
|
|
||||||
guint keyboard_mode : 1;
|
|
||||||
|
|
||||||
guint take_focus : 1;
|
|
||||||
guint activated_submenu : 1;
|
|
||||||
guint in_unselectable_item : 1; /* This flag is a crutch to keep
|
|
||||||
* mnemonics in the same menu if
|
|
||||||
* the user moves the mouse over
|
|
||||||
* an unselectable menuitem.
|
|
||||||
*/
|
|
||||||
|
|
||||||
guint selection_done_coming_soon : 1; /* Set TRUE when a selection-done
|
|
||||||
* signal is coming soon (when checked
|
|
||||||
* from inside of a "hide" handler).
|
|
||||||
*/
|
|
||||||
GtkMnemonicHash *mnemonic_hash;
|
|
||||||
GtkKeyHash *key_hash;
|
|
||||||
|
|
||||||
GdkDevice *grab_pointer;
|
|
||||||
GtkEventController *key_controller;
|
|
||||||
};
|
|
||||||
|
|
||||||
void _gtk_menu_shell_select_last (GtkMenuShell *menu_shell,
|
|
||||||
gboolean search_sensitive);
|
|
||||||
gint _gtk_menu_shell_get_popup_delay (GtkMenuShell *menu_shell);
|
|
||||||
void _gtk_menu_shell_set_grab_device (GtkMenuShell *menu_shell,
|
|
||||||
GdkDevice *device);
|
|
||||||
GdkDevice *_gtk_menu_shell_get_grab_device (GtkMenuShell *menu_shell);
|
|
||||||
|
|
||||||
void _gtk_menu_shell_add_mnemonic (GtkMenuShell *menu_shell,
|
|
||||||
guint keyval,
|
|
||||||
GtkWidget *target);
|
|
||||||
void _gtk_menu_shell_remove_mnemonic (GtkMenuShell *menu_shell,
|
|
||||||
guint keyval,
|
|
||||||
GtkWidget *target);
|
|
||||||
|
|
||||||
void _gtk_menu_shell_update_mnemonics (GtkMenuShell *menu_shell);
|
|
||||||
void _gtk_menu_shell_set_keyboard_mode (GtkMenuShell *menu_shell,
|
|
||||||
gboolean keyboard_mode);
|
|
||||||
gboolean _gtk_menu_shell_get_keyboard_mode (GtkMenuShell *menu_shell);
|
|
||||||
GList *gtk_menu_shell_get_items (GtkMenuShell *menu_shell);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_MENU_SHELL_PRIVATE_H__ */
|
|
@ -25,7 +25,6 @@
|
|||||||
#include "gtkmenubutton.h"
|
#include "gtkmenubutton.h"
|
||||||
#include "gtkmenubuttonprivate.h"
|
#include "gtkmenubuttonprivate.h"
|
||||||
#include "gtkbox.h"
|
#include "gtkbox.h"
|
||||||
#include "gtkmenu.h"
|
|
||||||
#include "gtkpopover.h"
|
#include "gtkpopover.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtksizerequest.h"
|
#include "gtksizerequest.h"
|
||||||
|
@ -1,505 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright © 2011, 2013 Canonical Limited
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the licence, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* Author: Ryan Lortie <desrt@desrt.ca>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "gtkmodelmenuitemprivate.h"
|
|
||||||
|
|
||||||
#include "gtkaccellabel.h"
|
|
||||||
#include "gtklabel.h"
|
|
||||||
#include "gtkcheckmenuitemprivate.h"
|
|
||||||
#include "gtkimage.h"
|
|
||||||
#include "gtkbox.h"
|
|
||||||
|
|
||||||
struct _GtkModelMenuItem
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem parent_instance;
|
|
||||||
GtkMenuTrackerItemRole role;
|
|
||||||
gboolean has_indicator;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef GtkCheckMenuItemClass GtkModelMenuItemClass;
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkModelMenuItem, gtk_model_menu_item, GTK_TYPE_CHECK_MENU_ITEM)
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_0,
|
|
||||||
PROP_ACTION_ROLE,
|
|
||||||
PROP_ICON,
|
|
||||||
PROP_TEXT,
|
|
||||||
PROP_TOGGLED,
|
|
||||||
PROP_ACCEL
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_toggle_size_request (GtkMenuItem *menu_item,
|
|
||||||
gint *requisition)
|
|
||||||
{
|
|
||||||
GtkModelMenuItem *item = GTK_MODEL_MENU_ITEM (menu_item);
|
|
||||||
|
|
||||||
if (item->has_indicator)
|
|
||||||
GTK_MENU_ITEM_CLASS (gtk_model_menu_item_parent_class)
|
|
||||||
->toggle_size_request (menu_item, requisition);
|
|
||||||
|
|
||||||
else
|
|
||||||
*requisition = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_activate (GtkMenuItem *item)
|
|
||||||
{
|
|
||||||
/* block the automatic toggle behaviour -- just do nothing */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_set_has_indicator (GtkModelMenuItem *item,
|
|
||||||
gboolean has_indicator)
|
|
||||||
{
|
|
||||||
if (has_indicator == item->has_indicator)
|
|
||||||
return;
|
|
||||||
|
|
||||||
item->has_indicator = has_indicator;
|
|
||||||
|
|
||||||
gtk_widget_set_visible (_gtk_check_menu_item_get_indicator_widget (GTK_CHECK_MENU_ITEM (item)),
|
|
||||||
item->has_indicator);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_set_action_role (GtkModelMenuItem *item,
|
|
||||||
GtkMenuTrackerItemRole role)
|
|
||||||
{
|
|
||||||
AtkObject *accessible;
|
|
||||||
AtkRole a11y_role;
|
|
||||||
|
|
||||||
if (role == item->role)
|
|
||||||
return;
|
|
||||||
|
|
||||||
gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (item), role == GTK_MENU_TRACKER_ITEM_ROLE_RADIO);
|
|
||||||
gtk_model_menu_item_set_has_indicator (item, role != GTK_MENU_TRACKER_ITEM_ROLE_NORMAL);
|
|
||||||
|
|
||||||
accessible = gtk_widget_get_accessible (GTK_WIDGET (item));
|
|
||||||
switch (role)
|
|
||||||
{
|
|
||||||
case GTK_MENU_TRACKER_ITEM_ROLE_NORMAL:
|
|
||||||
a11y_role = ATK_ROLE_MENU_ITEM;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GTK_MENU_TRACKER_ITEM_ROLE_CHECK:
|
|
||||||
a11y_role = ATK_ROLE_CHECK_MENU_ITEM;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GTK_MENU_TRACKER_ITEM_ROLE_RADIO:
|
|
||||||
a11y_role = ATK_ROLE_RADIO_MENU_ITEM;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
}
|
|
||||||
|
|
||||||
atk_object_set_role (accessible, a11y_role);
|
|
||||||
g_object_notify (G_OBJECT (item), "action-role");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_set_icon (GtkModelMenuItem *item,
|
|
||||||
GIcon *icon)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_MODEL_MENU_ITEM (item));
|
|
||||||
g_return_if_fail (icon == NULL || G_IS_ICON (icon));
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
|
|
||||||
/* There are only three possibilities here:
|
|
||||||
*
|
|
||||||
* - no child
|
|
||||||
* - accel label child
|
|
||||||
* - already a box
|
|
||||||
*
|
|
||||||
* Handle the no-child case by having GtkMenuItem create the accel
|
|
||||||
* label, then we will only have two possible cases.
|
|
||||||
*/
|
|
||||||
if (child == NULL)
|
|
||||||
{
|
|
||||||
gtk_menu_item_get_label (GTK_MENU_ITEM (item));
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
g_assert (GTK_IS_ACCEL_LABEL (child));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If it is a box, make sure there are no images inside of it already.
|
|
||||||
*/
|
|
||||||
if (GTK_IS_BOX (child))
|
|
||||||
{
|
|
||||||
GList *children;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
while (children)
|
|
||||||
{
|
|
||||||
if (GTK_IS_IMAGE (children->data))
|
|
||||||
gtk_widget_destroy (children->data);
|
|
||||||
|
|
||||||
children = g_list_delete_link (children, children);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GtkWidget *box;
|
|
||||||
|
|
||||||
if (icon == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
|
||||||
|
|
||||||
/* Reparent the child without destroying it */
|
|
||||||
g_object_ref (child);
|
|
||||||
gtk_container_remove (GTK_CONTAINER (item), child);
|
|
||||||
gtk_container_add (GTK_CONTAINER (box), child);
|
|
||||||
g_object_unref (child);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (item), box);
|
|
||||||
|
|
||||||
/* Now we have a box */
|
|
||||||
child = box;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_assert (GTK_IS_BOX (child));
|
|
||||||
|
|
||||||
/* child is now a box containing a label and no image. Add the icon,
|
|
||||||
* if appropriate.
|
|
||||||
*/
|
|
||||||
if (icon != NULL)
|
|
||||||
{
|
|
||||||
GtkWidget *image;
|
|
||||||
|
|
||||||
image = gtk_image_new_from_gicon (icon);
|
|
||||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 16);
|
|
||||||
gtk_box_insert_child_after (GTK_BOX (child), image, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (item), "icon");
|
|
||||||
}
|
|
||||||
|
|
||||||
static GIcon *
|
|
||||||
gtk_model_menu_item_get_icon (GtkModelMenuItem *item)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
GIcon *icon = NULL;
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
if (GTK_IS_BOX (child))
|
|
||||||
{
|
|
||||||
GList *children, *l;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
for (l = children; l; l = l->next)
|
|
||||||
{
|
|
||||||
if (GTK_IS_IMAGE (l->data))
|
|
||||||
{
|
|
||||||
icon = gtk_image_get_gicon (GTK_IMAGE (l->data));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_list_free (children);
|
|
||||||
}
|
|
||||||
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_set_text (GtkModelMenuItem *item,
|
|
||||||
const gchar *text)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
GList *children;
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
if (child == NULL)
|
|
||||||
{
|
|
||||||
gtk_menu_item_get_label (GTK_MENU_ITEM (item));
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
g_assert (GTK_IS_ACCEL_LABEL (child));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GTK_IS_LABEL (child))
|
|
||||||
{
|
|
||||||
gtk_label_set_text_with_mnemonic (GTK_LABEL (child), text);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (GTK_IS_ACCEL_LABEL (child))
|
|
||||||
{
|
|
||||||
gtk_accel_label_set_label (GTK_ACCEL_LABEL (child), text);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GTK_IS_CONTAINER (child))
|
|
||||||
return;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
|
|
||||||
while (children)
|
|
||||||
{
|
|
||||||
if (GTK_IS_LABEL (children->data))
|
|
||||||
gtk_label_set_label (GTK_LABEL (children->data), text);
|
|
||||||
|
|
||||||
children = g_list_delete_link (children, children);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (item), "text");
|
|
||||||
}
|
|
||||||
|
|
||||||
static const gchar *
|
|
||||||
gtk_model_menu_item_get_text (GtkModelMenuItem *item)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
|
|
||||||
if (GTK_IS_LABEL (child))
|
|
||||||
return gtk_label_get_text (GTK_LABEL (child));
|
|
||||||
else if (GTK_IS_ACCEL_LABEL (child))
|
|
||||||
return gtk_accel_label_get_label (GTK_ACCEL_LABEL (child));
|
|
||||||
|
|
||||||
if (GTK_IS_CONTAINER (child))
|
|
||||||
{
|
|
||||||
GList *children, *l;
|
|
||||||
const gchar *text = NULL;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
for (l = children; l; l = l->next)
|
|
||||||
{
|
|
||||||
if (GTK_IS_LABEL (l->data))
|
|
||||||
{
|
|
||||||
text = gtk_label_get_text (GTK_LABEL (l->data));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_list_free (children);
|
|
||||||
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_set_accel (GtkModelMenuItem *item,
|
|
||||||
const gchar *accel)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
GList *children;
|
|
||||||
GdkModifierType modifiers;
|
|
||||||
guint key;
|
|
||||||
|
|
||||||
if (accel)
|
|
||||||
{
|
|
||||||
gtk_accelerator_parse (accel, &key, &modifiers);
|
|
||||||
if (!key)
|
|
||||||
modifiers = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
key = 0;
|
|
||||||
modifiers = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
if (child == NULL)
|
|
||||||
{
|
|
||||||
gtk_menu_item_get_label (GTK_MENU_ITEM (item));
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
g_assert (GTK_IS_LABEL (child));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GTK_IS_ACCEL_LABEL (child))
|
|
||||||
{
|
|
||||||
gtk_accel_label_set_accel (GTK_ACCEL_LABEL (child), key, modifiers);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GTK_IS_CONTAINER (child))
|
|
||||||
return;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
|
|
||||||
while (children)
|
|
||||||
{
|
|
||||||
if (GTK_IS_ACCEL_LABEL (children->data))
|
|
||||||
gtk_accel_label_set_accel (children->data, key, modifiers);
|
|
||||||
|
|
||||||
children = g_list_delete_link (children, children);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gchar *
|
|
||||||
gtk_model_menu_item_get_accel (GtkModelMenuItem *item)
|
|
||||||
{
|
|
||||||
GtkWidget *child;
|
|
||||||
GtkWidget *accel_label = NULL;
|
|
||||||
|
|
||||||
child = gtk_bin_get_child (GTK_BIN (item));
|
|
||||||
|
|
||||||
if (GTK_IS_ACCEL_LABEL (child))
|
|
||||||
accel_label = child;
|
|
||||||
else if (GTK_IS_CONTAINER (child))
|
|
||||||
{
|
|
||||||
GList *children, *l;
|
|
||||||
|
|
||||||
children = gtk_container_get_children (GTK_CONTAINER (child));
|
|
||||||
for (l = children; l; l = l->next)
|
|
||||||
{
|
|
||||||
if (GTK_IS_ACCEL_LABEL (l->data))
|
|
||||||
{
|
|
||||||
accel_label = GTK_WIDGET (l->data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_list_free (children);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (accel_label)
|
|
||||||
{
|
|
||||||
guint key;
|
|
||||||
GdkModifierType mods;
|
|
||||||
|
|
||||||
gtk_accel_label_get_accel (GTK_ACCEL_LABEL (accel_label), &key, &mods);
|
|
||||||
|
|
||||||
return gtk_accelerator_name (key, mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
GtkModelMenuItem *item = GTK_MODEL_MENU_ITEM (object);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_ACTION_ROLE:
|
|
||||||
g_value_set_enum (value, item->role);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_ICON:
|
|
||||||
g_value_set_object (value, gtk_model_menu_item_get_icon (item));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_TEXT:
|
|
||||||
g_value_set_string (value, gtk_model_menu_item_get_text (item));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_TOGGLED:
|
|
||||||
g_value_set_boolean (value, gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_ACCEL:
|
|
||||||
g_value_take_string (value, gtk_model_menu_item_get_accel (item));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
GtkModelMenuItem *item = GTK_MODEL_MENU_ITEM (object);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
case PROP_ACTION_ROLE:
|
|
||||||
gtk_model_menu_item_set_action_role (item, g_value_get_enum (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_ICON:
|
|
||||||
gtk_model_menu_item_set_icon (item, g_value_get_object (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_TEXT:
|
|
||||||
gtk_model_menu_item_set_text (item, g_value_get_string (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_TOGGLED:
|
|
||||||
_gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), g_value_get_boolean (value));
|
|
||||||
g_object_notify (object, "active");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_ACCEL:
|
|
||||||
gtk_model_menu_item_set_accel (item, g_value_get_string (value));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_assert_not_reached ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_init (GtkModelMenuItem *item)
|
|
||||||
{
|
|
||||||
item->has_indicator = FALSE;
|
|
||||||
gtk_widget_hide (_gtk_check_menu_item_get_indicator_widget (GTK_CHECK_MENU_ITEM (item)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_model_menu_item_class_init (GtkModelMenuItemClass *class)
|
|
||||||
{
|
|
||||||
GtkMenuItemClass *item_class = GTK_MENU_ITEM_CLASS (class);
|
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
|
||||||
|
|
||||||
item_class->toggle_size_request = gtk_model_menu_item_toggle_size_request;
|
|
||||||
item_class->activate = gtk_model_menu_item_activate;
|
|
||||||
|
|
||||||
object_class->get_property = gtk_model_menu_item_get_property;
|
|
||||||
object_class->set_property = gtk_model_menu_item_set_property;
|
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_ACTION_ROLE,
|
|
||||||
g_param_spec_enum ("action-role", "action role", "action role",
|
|
||||||
GTK_TYPE_MENU_TRACKER_ITEM_ROLE,
|
|
||||||
GTK_MENU_TRACKER_ITEM_ROLE_NORMAL,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
g_object_class_install_property (object_class, PROP_ICON,
|
|
||||||
g_param_spec_object ("icon", "icon", "icon", G_TYPE_ICON,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
g_object_class_install_property (object_class, PROP_TEXT,
|
|
||||||
g_param_spec_string ("text", "text", "text", NULL,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
g_object_class_install_property (object_class, PROP_TOGGLED,
|
|
||||||
g_param_spec_boolean ("toggled", "toggled", "toggled", FALSE,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
g_object_class_install_property (object_class, PROP_ACCEL,
|
|
||||||
g_param_spec_string ("accel", "accel", "accel", NULL,
|
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
|
|
||||||
|
|
||||||
gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_MENU_ITEM);
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkWidget *
|
|
||||||
gtk_model_menu_item_new (void)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_MODEL_MENU_ITEM, NULL);
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright © 2011 Canonical Limited
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the licence, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* Author: Ryan Lortie <desrt@desrt.ca>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_MODEL_MENU_ITEM_PRIVATE_H__
|
|
||||||
#define __GTK_MODEL_MENU_ITEM_PRIVATE_H__
|
|
||||||
|
|
||||||
#include <gtk/gtkcheckmenuitem.h>
|
|
||||||
#include <gtk/gtkmenutrackeritemprivate.h>
|
|
||||||
|
|
||||||
#define GTK_TYPE_MODEL_MENU_ITEM (gtk_model_menu_item_get_type ())
|
|
||||||
#define GTK_MODEL_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
|
|
||||||
GTK_TYPE_MODEL_MENU_ITEM, GtkModelMenuItem))
|
|
||||||
#define GTK_IS_MODEL_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
|
|
||||||
GTK_TYPE_MODEL_MENU_ITEM))
|
|
||||||
|
|
||||||
typedef struct _GtkModelMenuItem GtkModelMenuItem;
|
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
GType gtk_model_menu_item_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
|
||||||
GtkWidget * gtk_model_menu_item_new (void);
|
|
||||||
|
|
||||||
#endif /* __GTK_MODEL_MENU_ITEM_PRIVATE_H__ */
|
|
@ -48,7 +48,6 @@
|
|||||||
#include "gtkcellrendererpixbuf.h"
|
#include "gtkcellrendererpixbuf.h"
|
||||||
#include "gtkscrolledwindow.h"
|
#include "gtkscrolledwindow.h"
|
||||||
#include "gtkicontheme.h"
|
#include "gtkicontheme.h"
|
||||||
#include "gtkmenuitem.h"
|
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtkstylecontextprivate.h"
|
#include "gtkstylecontextprivate.h"
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "gtkgestureclick.h"
|
#include "gtkgestureclick.h"
|
||||||
#include "gtkbox.h"
|
#include "gtkbox.h"
|
||||||
#include "gtkimage.h"
|
#include "gtkimage.h"
|
||||||
#include "gtkcheckmenuitem.h"
|
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
|
@ -40,10 +40,8 @@
|
|||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkmenuitem.h"
|
|
||||||
#include "gtkmountoperation.h"
|
#include "gtkmountoperation.h"
|
||||||
#include "gtkscrolledwindow.h"
|
#include "gtkscrolledwindow.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtktrashmonitor.h"
|
#include "gtktrashmonitor.h"
|
||||||
#include "gtktypebuiltins.h"
|
#include "gtktypebuiltins.h"
|
||||||
@ -195,10 +193,6 @@ struct _GtkPlacesSidebarClass {
|
|||||||
void (* open_location) (GtkPlacesSidebar *sidebar,
|
void (* open_location) (GtkPlacesSidebar *sidebar,
|
||||||
GFile *location,
|
GFile *location,
|
||||||
GtkPlacesOpenFlags open_flags);
|
GtkPlacesOpenFlags open_flags);
|
||||||
void (* populate_popup) (GtkPlacesSidebar *sidebar,
|
|
||||||
GtkMenu *menu,
|
|
||||||
GFile *selected_item,
|
|
||||||
GVolume *selected_volume);
|
|
||||||
void (* show_error_message) (GtkPlacesSidebar *sidebar,
|
void (* show_error_message) (GtkPlacesSidebar *sidebar,
|
||||||
const gchar *primary,
|
const gchar *primary,
|
||||||
const gchar *secondary);
|
const gchar *secondary);
|
||||||
|
@ -1,616 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "gtkaccellabel.h"
|
|
||||||
#include "gtkcheckmenuitemprivate.h"
|
|
||||||
#include "gtkmarshalers.h"
|
|
||||||
#include "gtkradiomenuitem.h"
|
|
||||||
#include "gtkprivate.h"
|
|
||||||
#include "gtkintl.h"
|
|
||||||
#include "a11y/gtkradiomenuitemaccessible.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:gtkradiomenuitem
|
|
||||||
* @Short_description: A choice from multiple check menu items
|
|
||||||
* @Title: GtkRadioMenuItem
|
|
||||||
* @See_also: #GtkMenuItem, #GtkCheckMenuItem
|
|
||||||
*
|
|
||||||
* A radio menu item is a check menu item that belongs to a group. At each
|
|
||||||
* instant exactly one of the radio menu items from a group is selected.
|
|
||||||
*
|
|
||||||
* The group list does not need to be freed, as each #GtkRadioMenuItem will
|
|
||||||
* remove itself and its list item when it is destroyed.
|
|
||||||
*
|
|
||||||
* The correct way to create a group of radio menu items is approximatively
|
|
||||||
* this:
|
|
||||||
*
|
|
||||||
* ## How to create a group of radio menu items.
|
|
||||||
*
|
|
||||||
* |[<!-- language="C" -->
|
|
||||||
* GSList *group = NULL;
|
|
||||||
* GtkWidget *item;
|
|
||||||
* gint i;
|
|
||||||
*
|
|
||||||
* for (i = 0; i < 5; i++)
|
|
||||||
* {
|
|
||||||
* item = gtk_radio_menu_item_new_with_label (group, "This is an example");
|
|
||||||
* group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
|
|
||||||
* if (i == 1)
|
|
||||||
* gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
|
|
||||||
* }
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* # CSS nodes
|
|
||||||
*
|
|
||||||
* |[<!-- language="plain" -->
|
|
||||||
* menuitem
|
|
||||||
* ├── radio.left
|
|
||||||
* ╰── <child>
|
|
||||||
* ]|
|
|
||||||
*
|
|
||||||
* GtkRadioMenuItem has a main CSS node with name menuitem, and a subnode
|
|
||||||
* with name radio, which gets the .left or .right style class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _GtkRadioMenuItemPrivate GtkRadioMenuItemPrivate;
|
|
||||||
typedef struct _GtkRadioMenuItemClass GtkRadioMenuItemClass;
|
|
||||||
|
|
||||||
struct _GtkRadioMenuItem
|
|
||||||
{
|
|
||||||
GtkCheckMenuItem check_menu_item;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkRadioMenuItemClass
|
|
||||||
{
|
|
||||||
GtkCheckMenuItemClass parent_class;
|
|
||||||
|
|
||||||
void (*group_changed) (GtkRadioMenuItem *radio_menu_item);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkRadioMenuItemPrivate
|
|
||||||
{
|
|
||||||
GSList *group;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
|
||||||
PROP_0,
|
|
||||||
PROP_GROUP
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static void gtk_radio_menu_item_destroy (GtkWidget *widget);
|
|
||||||
static void gtk_radio_menu_item_activate (GtkMenuItem *menu_item);
|
|
||||||
static void gtk_radio_menu_item_set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec);
|
|
||||||
static void gtk_radio_menu_item_get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec);
|
|
||||||
|
|
||||||
static guint group_changed_signal = 0;
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkRadioMenuItem, gtk_radio_menu_item, GTK_TYPE_CHECK_MENU_ITEM)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_new:
|
|
||||||
* @group: (element-type GtkRadioMenuItem) (allow-none): the group to which the
|
|
||||||
* radio menu item is to be attached, or %NULL
|
|
||||||
*
|
|
||||||
* Creates a new #GtkRadioMenuItem.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkRadioMenuItem
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_radio_menu_item_new (GSList *group)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *radio_menu_item;
|
|
||||||
|
|
||||||
radio_menu_item = g_object_new (GTK_TYPE_RADIO_MENU_ITEM, NULL);
|
|
||||||
|
|
||||||
gtk_radio_menu_item_set_group (radio_menu_item, group);
|
|
||||||
|
|
||||||
return GTK_WIDGET (radio_menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_set_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
const GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *radio_menu_item;
|
|
||||||
|
|
||||||
radio_menu_item = GTK_RADIO_MENU_ITEM (object);
|
|
||||||
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
GSList *slist;
|
|
||||||
|
|
||||||
case PROP_GROUP:
|
|
||||||
slist = g_value_get_object (value);
|
|
||||||
if (slist)
|
|
||||||
slist = gtk_radio_menu_item_get_group ((GtkRadioMenuItem*) g_value_get_object (value));
|
|
||||||
gtk_radio_menu_item_set_group (radio_menu_item, slist);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_get_property (GObject *object,
|
|
||||||
guint prop_id,
|
|
||||||
GValue *value,
|
|
||||||
GParamSpec *pspec)
|
|
||||||
{
|
|
||||||
switch (prop_id)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_set_group:
|
|
||||||
* @radio_menu_item: a #GtkRadioMenuItem.
|
|
||||||
* @group: (element-type GtkRadioMenuItem) (allow-none): the new group, or %NULL.
|
|
||||||
*
|
|
||||||
* Sets the group of a radio menu item, or changes it.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
|
|
||||||
GSList *group)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItemPrivate *priv = gtk_radio_menu_item_get_instance_private (radio_menu_item);
|
|
||||||
GtkWidget *old_group_singleton = NULL;
|
|
||||||
GtkWidget *new_group_singleton = NULL;
|
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (radio_menu_item));
|
|
||||||
|
|
||||||
if (priv->group == group)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (priv->group)
|
|
||||||
{
|
|
||||||
GSList *slist;
|
|
||||||
|
|
||||||
priv->group = g_slist_remove (priv->group, radio_menu_item);
|
|
||||||
|
|
||||||
if (priv->group && !priv->group->next)
|
|
||||||
old_group_singleton = g_object_ref (priv->group->data);
|
|
||||||
|
|
||||||
for (slist = priv->group; slist; slist = slist->next)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *tmp_item = slist->data;
|
|
||||||
GtkRadioMenuItemPrivate *tmp_priv = gtk_radio_menu_item_get_instance_private (tmp_item);
|
|
||||||
|
|
||||||
tmp_priv->group = priv->group;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (group && !group->next)
|
|
||||||
new_group_singleton = g_object_ref (group->data);
|
|
||||||
|
|
||||||
priv->group = g_slist_prepend (group, radio_menu_item);
|
|
||||||
|
|
||||||
if (group)
|
|
||||||
{
|
|
||||||
GSList *slist;
|
|
||||||
|
|
||||||
for (slist = group; slist; slist = slist->next)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *tmp_item = slist->data;
|
|
||||||
GtkRadioMenuItemPrivate *tmp_priv = gtk_radio_menu_item_get_instance_private (tmp_item);
|
|
||||||
|
|
||||||
tmp_priv->group = priv->group;
|
|
||||||
}
|
|
||||||
|
|
||||||
_gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (radio_menu_item), FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (radio_menu_item), TRUE);
|
|
||||||
/* gtk_widget_set_state (GTK_WIDGET (radio_menu_item), GTK_STATE_ACTIVE);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_ref (radio_menu_item);
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (radio_menu_item), "group");
|
|
||||||
g_signal_emit (radio_menu_item, group_changed_signal, 0);
|
|
||||||
if (old_group_singleton)
|
|
||||||
{
|
|
||||||
g_signal_emit (old_group_singleton, group_changed_signal, 0);
|
|
||||||
g_object_unref (old_group_singleton);
|
|
||||||
}
|
|
||||||
if (new_group_singleton)
|
|
||||||
{
|
|
||||||
g_signal_emit (new_group_singleton, group_changed_signal, 0);
|
|
||||||
g_object_unref (new_group_singleton);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (radio_menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_new_with_label:
|
|
||||||
* @group: (element-type GtkRadioMenuItem) (allow-none):
|
|
||||||
* group the radio menu item is inside, or %NULL
|
|
||||||
* @label: the text for the label
|
|
||||||
*
|
|
||||||
* Creates a new #GtkRadioMenuItem whose child is a simple #GtkLabel.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): A new #GtkRadioMenuItem
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_radio_menu_item_new_with_label (GSList *group,
|
|
||||||
const gchar *label)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_RADIO_MENU_ITEM,
|
|
||||||
"group", (group) ? group->data : NULL,
|
|
||||||
"label", label,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_new_with_mnemonic:
|
|
||||||
* @group: (element-type GtkRadioMenuItem) (allow-none):
|
|
||||||
* group the radio menu item is inside, or %NULL
|
|
||||||
* @label: the text of the button, with an underscore in front of the
|
|
||||||
* mnemonic character
|
|
||||||
*
|
|
||||||
* Creates a new #GtkRadioMenuItem containing a label. The label
|
|
||||||
* will be created using gtk_label_new_with_mnemonic(), so underscores
|
|
||||||
* in @label indicate the mnemonic for the menu item.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkRadioMenuItem
|
|
||||||
*/
|
|
||||||
GtkWidget*
|
|
||||||
gtk_radio_menu_item_new_with_mnemonic (GSList *group,
|
|
||||||
const gchar *label)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_RADIO_MENU_ITEM,
|
|
||||||
"group", (group) ? group->data : NULL,
|
|
||||||
"label", label,
|
|
||||||
"use-underline", TRUE,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_new_from_widget: (constructor)
|
|
||||||
* @group: (allow-none): An existing #GtkRadioMenuItem
|
|
||||||
*
|
|
||||||
* Creates a new #GtkRadioMenuItem adding it to the same group as @group.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): The new #GtkRadioMenuItem
|
|
||||||
**/
|
|
||||||
GtkWidget *
|
|
||||||
gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group)
|
|
||||||
{
|
|
||||||
GSList *list = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_MENU_ITEM (group), NULL);
|
|
||||||
|
|
||||||
if (group)
|
|
||||||
list = gtk_radio_menu_item_get_group (group);
|
|
||||||
|
|
||||||
return gtk_radio_menu_item_new (list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_new_with_mnemonic_from_widget: (constructor)
|
|
||||||
* @group: (allow-none): An existing #GtkRadioMenuItem
|
|
||||||
* @label: (allow-none): the text of the button, with an underscore in front of the
|
|
||||||
* mnemonic character
|
|
||||||
*
|
|
||||||
* Creates a new GtkRadioMenuItem containing a label. The label will be
|
|
||||||
* created using gtk_label_new_with_mnemonic(), so underscores in label
|
|
||||||
* indicate the mnemonic for the menu item.
|
|
||||||
*
|
|
||||||
* The new #GtkRadioMenuItem is added to the same group as @group.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): The new #GtkRadioMenuItem
|
|
||||||
**/
|
|
||||||
GtkWidget *
|
|
||||||
gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group,
|
|
||||||
const gchar *label)
|
|
||||||
{
|
|
||||||
GSList *list = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_MENU_ITEM (group), NULL);
|
|
||||||
|
|
||||||
if (group)
|
|
||||||
list = gtk_radio_menu_item_get_group (group);
|
|
||||||
|
|
||||||
return gtk_radio_menu_item_new_with_mnemonic (list, label);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_new_with_label_from_widget: (constructor)
|
|
||||||
* @group: (allow-none): an existing #GtkRadioMenuItem
|
|
||||||
* @label: (allow-none): the text for the label
|
|
||||||
*
|
|
||||||
* Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
|
|
||||||
* The new #GtkRadioMenuItem is added to the same group as @group.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): The new #GtkRadioMenuItem
|
|
||||||
**/
|
|
||||||
GtkWidget *
|
|
||||||
gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group,
|
|
||||||
const gchar *label)
|
|
||||||
{
|
|
||||||
GSList *list = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (group == NULL || GTK_IS_RADIO_MENU_ITEM (group), NULL);
|
|
||||||
|
|
||||||
if (group)
|
|
||||||
list = gtk_radio_menu_item_get_group (group);
|
|
||||||
|
|
||||||
return gtk_radio_menu_item_new_with_label (list, label);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_get_group:
|
|
||||||
* @radio_menu_item: a #GtkRadioMenuItem
|
|
||||||
*
|
|
||||||
* Returns the group to which the radio menu item belongs, as a #GList of
|
|
||||||
* #GtkRadioMenuItem. The list belongs to GTK+ and should not be freed.
|
|
||||||
*
|
|
||||||
* Returns: (element-type GtkRadioMenuItem) (transfer none): the group
|
|
||||||
* of @radio_menu_item
|
|
||||||
*/
|
|
||||||
GSList*
|
|
||||||
gtk_radio_menu_item_get_group (GtkRadioMenuItem *radio_menu_item)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItemPrivate *priv = gtk_radio_menu_item_get_instance_private (radio_menu_item);
|
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_RADIO_MENU_ITEM (radio_menu_item), NULL);
|
|
||||||
|
|
||||||
return priv->group;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_class_init (GtkRadioMenuItemClass *klass)
|
|
||||||
{
|
|
||||||
GObjectClass *gobject_class;
|
|
||||||
GtkWidgetClass *widget_class;
|
|
||||||
GtkMenuItemClass *menu_item_class;
|
|
||||||
|
|
||||||
gobject_class = G_OBJECT_CLASS (klass);
|
|
||||||
widget_class = GTK_WIDGET_CLASS (klass);
|
|
||||||
menu_item_class = GTK_MENU_ITEM_CLASS (klass);
|
|
||||||
|
|
||||||
gobject_class->set_property = gtk_radio_menu_item_set_property;
|
|
||||||
gobject_class->get_property = gtk_radio_menu_item_get_property;
|
|
||||||
|
|
||||||
widget_class->destroy = gtk_radio_menu_item_destroy;
|
|
||||||
|
|
||||||
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_RADIO_MENU_ITEM_ACCESSIBLE);
|
|
||||||
|
|
||||||
menu_item_class->activate = gtk_radio_menu_item_activate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkRadioMenuItem:group:
|
|
||||||
*
|
|
||||||
* The radio menu item whose group this widget belongs to.
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_GROUP,
|
|
||||||
g_param_spec_object ("group",
|
|
||||||
P_("Group"),
|
|
||||||
P_("The radio menu item whose group this widget belongs to."),
|
|
||||||
GTK_TYPE_RADIO_MENU_ITEM,
|
|
||||||
GTK_PARAM_WRITABLE));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkStyle::group-changed:
|
|
||||||
* @style: the object which received the signal
|
|
||||||
*
|
|
||||||
* Emitted when the group of radio menu items that a radio menu item belongs
|
|
||||||
* to changes. This is emitted when a radio menu item switches from
|
|
||||||
* being alone to being part of a group of 2 or more menu items, or
|
|
||||||
* vice-versa, and when a button is moved from one group of 2 or
|
|
||||||
* more menu items ton a different one, but not when the composition
|
|
||||||
* of the group that a menu item belongs to changes.
|
|
||||||
*/
|
|
||||||
group_changed_signal = g_signal_new (I_("group-changed"),
|
|
||||||
G_OBJECT_CLASS_TYPE (gobject_class),
|
|
||||||
G_SIGNAL_RUN_FIRST,
|
|
||||||
G_STRUCT_OFFSET (GtkRadioMenuItemClass, group_changed),
|
|
||||||
NULL, NULL,
|
|
||||||
NULL,
|
|
||||||
G_TYPE_NONE, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_init (GtkRadioMenuItem *radio_menu_item)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItemPrivate *priv = gtk_radio_menu_item_get_instance_private (radio_menu_item);
|
|
||||||
|
|
||||||
priv->group = g_slist_prepend (NULL, radio_menu_item);
|
|
||||||
gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (radio_menu_item), TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_destroy (GtkWidget *widget)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *radio_menu_item = GTK_RADIO_MENU_ITEM (widget);
|
|
||||||
GtkRadioMenuItemPrivate *priv = gtk_radio_menu_item_get_instance_private (radio_menu_item);
|
|
||||||
GtkWidget *old_group_singleton = NULL;
|
|
||||||
GSList *tmp_list;
|
|
||||||
gboolean was_in_group;
|
|
||||||
|
|
||||||
was_in_group = priv->group && priv->group->next;
|
|
||||||
|
|
||||||
priv->group = g_slist_remove (priv->group, radio_menu_item);
|
|
||||||
if (priv->group && !priv->group->next)
|
|
||||||
old_group_singleton = priv->group->data;
|
|
||||||
|
|
||||||
tmp_list = priv->group;
|
|
||||||
|
|
||||||
while (tmp_list)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *tmp_item = tmp_list->data;
|
|
||||||
GtkRadioMenuItemPrivate *tmp_priv = gtk_radio_menu_item_get_instance_private (tmp_item);
|
|
||||||
tmp_list = tmp_list->next;
|
|
||||||
|
|
||||||
tmp_priv->group = priv->group;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* this radio menu item is no longer in the group */
|
|
||||||
priv->group = NULL;
|
|
||||||
|
|
||||||
if (old_group_singleton)
|
|
||||||
g_signal_emit (old_group_singleton, group_changed_signal, 0);
|
|
||||||
if (was_in_group)
|
|
||||||
g_signal_emit (radio_menu_item, group_changed_signal, 0);
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_radio_menu_item_parent_class)->destroy (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_radio_menu_item_activate (GtkMenuItem *menu_item)
|
|
||||||
{
|
|
||||||
GtkRadioMenuItem *radio_menu_item = GTK_RADIO_MENU_ITEM (menu_item);
|
|
||||||
GtkRadioMenuItemPrivate *priv = gtk_radio_menu_item_get_instance_private (radio_menu_item);
|
|
||||||
GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM (menu_item);
|
|
||||||
GtkCheckMenuItem *tmp_menu_item;
|
|
||||||
GSList *tmp_list;
|
|
||||||
gboolean active;
|
|
||||||
gint toggled;
|
|
||||||
|
|
||||||
toggled = FALSE;
|
|
||||||
|
|
||||||
active = gtk_check_menu_item_get_active (check_menu_item);
|
|
||||||
if (active)
|
|
||||||
{
|
|
||||||
tmp_menu_item = NULL;
|
|
||||||
tmp_list = priv->group;
|
|
||||||
|
|
||||||
while (tmp_list)
|
|
||||||
{
|
|
||||||
tmp_menu_item = tmp_list->data;
|
|
||||||
tmp_list = tmp_list->next;
|
|
||||||
|
|
||||||
if (gtk_check_menu_item_get_active (tmp_menu_item) &&
|
|
||||||
tmp_menu_item != check_menu_item)
|
|
||||||
break;
|
|
||||||
|
|
||||||
tmp_menu_item = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmp_menu_item)
|
|
||||||
{
|
|
||||||
toggled = TRUE;
|
|
||||||
_gtk_check_menu_item_set_active (check_menu_item, !active);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
toggled = TRUE;
|
|
||||||
_gtk_check_menu_item_set_active (check_menu_item, !active);
|
|
||||||
|
|
||||||
tmp_list = priv->group;
|
|
||||||
while (tmp_list)
|
|
||||||
{
|
|
||||||
tmp_menu_item = tmp_list->data;
|
|
||||||
tmp_list = tmp_list->next;
|
|
||||||
|
|
||||||
if (gtk_check_menu_item_get_active (tmp_menu_item) &&
|
|
||||||
tmp_menu_item != check_menu_item)
|
|
||||||
{
|
|
||||||
gtk_menu_item_activate (GTK_MENU_ITEM (tmp_menu_item));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toggled)
|
|
||||||
{
|
|
||||||
gtk_check_menu_item_toggled (check_menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_queue_draw (GTK_WIDGET (radio_menu_item));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_radio_menu_item_join_group:
|
|
||||||
* @radio_menu_item: a #GtkRadioMenuItem
|
|
||||||
* @group_source: (allow-none): a #GtkRadioMenuItem whose group we are
|
|
||||||
* joining, or %NULL to remove the @radio_menu_item from its current
|
|
||||||
* group
|
|
||||||
*
|
|
||||||
* Joins a #GtkRadioMenuItem object to the group of another #GtkRadioMenuItem
|
|
||||||
* object.
|
|
||||||
*
|
|
||||||
* This function should be used by language bindings to avoid the memory
|
|
||||||
* manangement of the opaque #GSList of gtk_radio_menu_item_get_group()
|
|
||||||
* and gtk_radio_menu_item_set_group().
|
|
||||||
*
|
|
||||||
* A common way to set up a group of #GtkRadioMenuItem instances is:
|
|
||||||
*
|
|
||||||
* |[
|
|
||||||
* GtkRadioMenuItem *last_item = NULL;
|
|
||||||
*
|
|
||||||
* while ( ...more items to add... )
|
|
||||||
* {
|
|
||||||
* GtkRadioMenuItem *radio_item;
|
|
||||||
*
|
|
||||||
* radio_item = gtk_radio_menu_item_new (...);
|
|
||||||
*
|
|
||||||
* gtk_radio_menu_item_join_group (radio_item, last_item);
|
|
||||||
* last_item = radio_item;
|
|
||||||
* }
|
|
||||||
* ]|
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gtk_radio_menu_item_join_group (GtkRadioMenuItem *radio_menu_item,
|
|
||||||
GtkRadioMenuItem *group_source)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (radio_menu_item));
|
|
||||||
g_return_if_fail (group_source == NULL || GTK_IS_RADIO_MENU_ITEM (group_source));
|
|
||||||
|
|
||||||
if (group_source != NULL)
|
|
||||||
{
|
|
||||||
GSList *group = gtk_radio_menu_item_get_group (group_source);
|
|
||||||
|
|
||||||
if (group == NULL)
|
|
||||||
{
|
|
||||||
/* if the group source does not have a group, we force one */
|
|
||||||
gtk_radio_menu_item_set_group (group_source, NULL);
|
|
||||||
group = gtk_radio_menu_item_get_group (group_source);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_radio_menu_item_set_group (radio_menu_item, group);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
gtk_radio_menu_item_set_group (radio_menu_item, NULL);
|
|
||||||
}
|
|
@ -1,75 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_RADIO_MENU_ITEM_H__
|
|
||||||
#define __GTK_RADIO_MENU_ITEM_H__
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkcheckmenuitem.h>
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_RADIO_MENU_ITEM (gtk_radio_menu_item_get_type ())
|
|
||||||
#define GTK_RADIO_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RADIO_MENU_ITEM, GtkRadioMenuItem))
|
|
||||||
#define GTK_IS_RADIO_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RADIO_MENU_ITEM))
|
|
||||||
|
|
||||||
typedef struct _GtkRadioMenuItem GtkRadioMenuItem;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_radio_menu_item_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_radio_menu_item_new (GSList *group);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group,
|
|
||||||
const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_radio_menu_item_new_with_mnemonic (GSList *group,
|
|
||||||
const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget *gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group,
|
|
||||||
const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget *gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group,
|
|
||||||
const gchar *label);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GSList* gtk_radio_menu_item_get_group (GtkRadioMenuItem *radio_menu_item);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
|
|
||||||
GSList *group);
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_radio_menu_item_join_group (GtkRadioMenuItem *radio_menu_item,
|
|
||||||
GtkRadioMenuItem *group_source);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_RADIO_MENU_ITEM_H__ */
|
|
@ -1,94 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtkintl.h"
|
|
||||||
|
|
||||||
#include "gtkstylecontext.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SECTION:gtkseparatormenuitem
|
|
||||||
* @Short_description: A separator used in menus
|
|
||||||
* @Title: GtkSeparatorMenuItem
|
|
||||||
*
|
|
||||||
* The #GtkSeparatorMenuItem is a separator used to group
|
|
||||||
* items within a menu. It displays a horizontal line with a shadow to
|
|
||||||
* make it appear sunken into the interface.
|
|
||||||
*
|
|
||||||
* # CSS nodes
|
|
||||||
*
|
|
||||||
* GtkSeparatorMenuItem has a single CSS node with name separator.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _GtkSeparatorMenuItemClass GtkSeparatorMenuItemClass;
|
|
||||||
|
|
||||||
struct _GtkSeparatorMenuItem
|
|
||||||
{
|
|
||||||
GtkMenuItem menu_item;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GtkSeparatorMenuItemClass
|
|
||||||
{
|
|
||||||
GtkMenuItemClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM)
|
|
||||||
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
gtk_separator_menu_item_get_label (GtkMenuItem *item)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
|
|
||||||
{
|
|
||||||
GTK_CONTAINER_CLASS (class)->child_type = NULL;
|
|
||||||
|
|
||||||
GTK_MENU_ITEM_CLASS (class)->get_label = gtk_separator_menu_item_get_label;
|
|
||||||
|
|
||||||
gtk_widget_class_set_accessible_role (GTK_WIDGET_CLASS (class), ATK_ROLE_SEPARATOR);
|
|
||||||
gtk_widget_class_set_css_name (GTK_WIDGET_CLASS (class), I_("separator"));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gtk_separator_menu_item_new:
|
|
||||||
*
|
|
||||||
* Creates a new #GtkSeparatorMenuItem.
|
|
||||||
*
|
|
||||||
* Returns: a new #GtkSeparatorMenuItem.
|
|
||||||
*/
|
|
||||||
GtkWidget *
|
|
||||||
gtk_separator_menu_item_new (void)
|
|
||||||
{
|
|
||||||
return g_object_new (GTK_TYPE_SEPARATOR_MENU_ITEM, NULL);
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __GTK_SEPARATOR_MENU_ITEM_H__
|
|
||||||
#define __GTK_SEPARATOR_MENU_ITEM_H__
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gtk/gtk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <gtk/gtkmenuitem.h>
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
#define GTK_TYPE_SEPARATOR_MENU_ITEM (gtk_separator_menu_item_get_type ())
|
|
||||||
#define GTK_SEPARATOR_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SEPARATOR_MENU_ITEM, GtkSeparatorMenuItem))
|
|
||||||
#define GTK_IS_SEPARATOR_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SEPARATOR_MENU_ITEM))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _GtkSeparatorMenuItem GtkSeparatorMenuItem;
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GType gtk_separator_menu_item_get_type (void) G_GNUC_CONST;
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
GtkWidget* gtk_separator_menu_item_new (void);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GTK_SEPARATOR_MENU_ITEM_H__ */
|
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtkstylecontext.h"
|
#include "gtkstylecontext.h"
|
||||||
#include "gtktoolbarprivate.h"
|
#include "gtktoolbarprivate.h"
|
||||||
#include "gtkwidgetprivate.h"
|
#include "gtkwidgetprivate.h"
|
||||||
|
@ -52,7 +52,6 @@
|
|||||||
#include "gtkpango.h"
|
#include "gtkpango.h"
|
||||||
#include "gtkpopovermenu.h"
|
#include "gtkpopovermenu.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtkselection.h"
|
#include "gtkselection.h"
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtksnapshot.h"
|
#include "gtksnapshot.h"
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkrenderbackgroundprivate.h"
|
#include "gtkrenderbackgroundprivate.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtktextiterprivate.h"
|
#include "gtktextiterprivate.h"
|
||||||
#include "gtkimmulticontext.h"
|
#include "gtkimmulticontext.h"
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gtktoggletoolbutton.h"
|
#include "gtktoggletoolbutton.h"
|
||||||
#include "gtkcheckmenuitem.h"
|
|
||||||
#include "gtklabel.h"
|
#include "gtklabel.h"
|
||||||
#include "gtktogglebutton.h"
|
#include "gtktogglebutton.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
|
@ -51,11 +51,8 @@
|
|||||||
#include "gtkpopovermenuprivate.h"
|
#include "gtkpopovermenuprivate.h"
|
||||||
#include "gtkmodelbuttonprivate.h"
|
#include "gtkmodelbuttonprivate.h"
|
||||||
#include "gtkseparator.h"
|
#include "gtkseparator.h"
|
||||||
#include "gtkradiomenuitem.h"
|
|
||||||
#include "gtkcheckmenuitem.h"
|
|
||||||
#include "gtkradiobutton.h"
|
#include "gtkradiobutton.h"
|
||||||
#include "gtkradiotoolbutton.h"
|
#include "gtkradiotoolbutton.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtkseparatortoolitem.h"
|
#include "gtkseparatortoolitem.h"
|
||||||
#include "gtktoolshell.h"
|
#include "gtktoolshell.h"
|
||||||
#include "gtktypebuiltins.h"
|
#include "gtktypebuiltins.h"
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtktoolshell.h"
|
#include "gtktoolshell.h"
|
||||||
#include "gtkseparatormenuitem.h"
|
|
||||||
#include "gtksizerequest.h"
|
#include "gtksizerequest.h"
|
||||||
#include "gtkintl.h"
|
#include "gtkintl.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <gtk/gtkbin.h>
|
#include <gtk/gtkbin.h>
|
||||||
#include <gtk/gtkmenuitem.h>
|
|
||||||
#include <gtk/gtksizegroup.h>
|
#include <gtk/gtksizegroup.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
#include "gtklayoutmanagerprivate.h"
|
#include "gtklayoutmanagerprivate.h"
|
||||||
#include "gtkmain.h"
|
#include "gtkmain.h"
|
||||||
#include "gtkmarshalers.h"
|
#include "gtkmarshalers.h"
|
||||||
#include "gtkmenu.h"
|
|
||||||
#include "gtkpopover.h"
|
#include "gtkpopover.h"
|
||||||
#include "gtkprivate.h"
|
#include "gtkprivate.h"
|
||||||
#include "gtkrenderbackgroundprivate.h"
|
#include "gtkrenderbackgroundprivate.h"
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#include "gtkiconview.h"
|
#include "gtkiconview.h"
|
||||||
#include "gtklabel.h"
|
#include "gtklabel.h"
|
||||||
#include "gtklistbox.h"
|
#include "gtklistbox.h"
|
||||||
#include "gtkmenuitem.h"
|
|
||||||
#include "gtkpopover.h"
|
#include "gtkpopover.h"
|
||||||
#include "gtksettings.h"
|
#include "gtksettings.h"
|
||||||
#include "gtksizegroup.h"
|
#include "gtksizegroup.h"
|
||||||
|
@ -199,7 +199,6 @@ gtk_public_sources = files([
|
|||||||
'gtkcenterbox.c',
|
'gtkcenterbox.c',
|
||||||
'gtkcenterlayout.c',
|
'gtkcenterlayout.c',
|
||||||
'gtkcheckbutton.c',
|
'gtkcheckbutton.c',
|
||||||
'gtkcheckmenuitem.c',
|
|
||||||
'gtkcolorbutton.c',
|
'gtkcolorbutton.c',
|
||||||
'gtkcolorchooser.c',
|
'gtkcolorchooser.c',
|
||||||
'gtkcolorchooserdialog.c',
|
'gtkcolorchooserdialog.c',
|
||||||
@ -284,15 +283,10 @@ gtk_public_sources = files([
|
|||||||
'gtkmediacontrols.c',
|
'gtkmediacontrols.c',
|
||||||
'gtkmediafile.c',
|
'gtkmediafile.c',
|
||||||
'gtkmediastream.c',
|
'gtkmediastream.c',
|
||||||
'gtkmenu.c',
|
|
||||||
'gtkmenubar.c',
|
|
||||||
'gtkmenubutton.c',
|
'gtkmenubutton.c',
|
||||||
'gtkmenuitem.c',
|
|
||||||
'gtkmenushell.c',
|
|
||||||
'gtkmenutoolbutton.c',
|
'gtkmenutoolbutton.c',
|
||||||
'gtkmessagedialog.c',
|
'gtkmessagedialog.c',
|
||||||
'gtkmodelbutton.c',
|
'gtkmodelbutton.c',
|
||||||
'gtkmodelmenuitem.c',
|
|
||||||
'gtkmodules.c',
|
'gtkmodules.c',
|
||||||
'gtkmountoperation.c',
|
'gtkmountoperation.c',
|
||||||
'gtknativedialog.c',
|
'gtknativedialog.c',
|
||||||
@ -318,7 +312,6 @@ gtk_public_sources = files([
|
|||||||
'gtkprogressbar.c',
|
'gtkprogressbar.c',
|
||||||
'gtkpropertylookuplistmodel.c',
|
'gtkpropertylookuplistmodel.c',
|
||||||
'gtkradiobutton.c',
|
'gtkradiobutton.c',
|
||||||
'gtkradiomenuitem.c',
|
|
||||||
'gtkradiotoolbutton.c',
|
'gtkradiotoolbutton.c',
|
||||||
'gtkrange.c',
|
'gtkrange.c',
|
||||||
'gtktreerbtree.c',
|
'gtktreerbtree.c',
|
||||||
@ -342,7 +335,6 @@ gtk_public_sources = files([
|
|||||||
'gtkselection.c',
|
'gtkselection.c',
|
||||||
'gtkselectionmodel.c',
|
'gtkselectionmodel.c',
|
||||||
'gtkseparator.c',
|
'gtkseparator.c',
|
||||||
'gtkseparatormenuitem.c',
|
|
||||||
'gtkseparatortoolitem.c',
|
'gtkseparatortoolitem.c',
|
||||||
'gtksettings.c',
|
'gtksettings.c',
|
||||||
'gtkshortcutlabel.c',
|
'gtkshortcutlabel.c',
|
||||||
@ -465,7 +457,6 @@ gtk_public_headers = files([
|
|||||||
'gtkcellrenderertoggle.h',
|
'gtkcellrenderertoggle.h',
|
||||||
'gtkcellview.h',
|
'gtkcellview.h',
|
||||||
'gtkcheckbutton.h',
|
'gtkcheckbutton.h',
|
||||||
'gtkcheckmenuitem.h',
|
|
||||||
'gtkcolorbutton.h',
|
'gtkcolorbutton.h',
|
||||||
'gtkcolorchooser.h',
|
'gtkcolorchooser.h',
|
||||||
'gtkcolorchooserdialog.h',
|
'gtkcolorchooserdialog.h',
|
||||||
@ -547,11 +538,7 @@ gtk_public_headers = files([
|
|||||||
'gtkmediacontrols.h',
|
'gtkmediacontrols.h',
|
||||||
'gtkmediafile.h',
|
'gtkmediafile.h',
|
||||||
'gtkmediastream.h',
|
'gtkmediastream.h',
|
||||||
'gtkmenu.h',
|
|
||||||
'gtkmenubar.h',
|
|
||||||
'gtkmenubutton.h',
|
'gtkmenubutton.h',
|
||||||
'gtkmenuitem.h',
|
|
||||||
'gtkmenushell.h',
|
|
||||||
'gtkmenutoolbutton.h',
|
'gtkmenutoolbutton.h',
|
||||||
'gtkmessagedialog.h',
|
'gtkmessagedialog.h',
|
||||||
'gtkmountoperation.h',
|
'gtkmountoperation.h',
|
||||||
@ -576,7 +563,6 @@ gtk_public_headers = files([
|
|||||||
'gtkprintsettings.h',
|
'gtkprintsettings.h',
|
||||||
'gtkprogressbar.h',
|
'gtkprogressbar.h',
|
||||||
'gtkradiobutton.h',
|
'gtkradiobutton.h',
|
||||||
'gtkradiomenuitem.h',
|
|
||||||
'gtkradiotoolbutton.h',
|
'gtkradiotoolbutton.h',
|
||||||
'gtkrange.h',
|
'gtkrange.h',
|
||||||
'gtkrecentmanager.h',
|
'gtkrecentmanager.h',
|
||||||
@ -593,7 +579,6 @@ gtk_public_headers = files([
|
|||||||
'gtkselection.h',
|
'gtkselection.h',
|
||||||
'gtkselectionmodel.h',
|
'gtkselectionmodel.h',
|
||||||
'gtkseparator.h',
|
'gtkseparator.h',
|
||||||
'gtkseparatormenuitem.h',
|
|
||||||
'gtkseparatortoolitem.h',
|
'gtkseparatortoolitem.h',
|
||||||
'gtksettings.h',
|
'gtksettings.h',
|
||||||
'gtkshortcutlabel.h',
|
'gtkshortcutlabel.h',
|
||||||
|
@ -50,7 +50,6 @@ gtk/a11y/gtkentryaccessible.c
|
|||||||
gtk/a11y/gtkexpanderaccessible.c
|
gtk/a11y/gtkexpanderaccessible.c
|
||||||
gtk/a11y/gtkimageaccessible.c
|
gtk/a11y/gtkimageaccessible.c
|
||||||
gtk/a11y/gtkmenubuttonaccessible.c
|
gtk/a11y/gtkmenubuttonaccessible.c
|
||||||
gtk/a11y/gtkmenuitemaccessible.c
|
|
||||||
gtk/a11y/gtkrenderercellaccessible.c
|
gtk/a11y/gtkrenderercellaccessible.c
|
||||||
gtk/a11y/gtkscalebuttonaccessible.c
|
gtk/a11y/gtkscalebuttonaccessible.c
|
||||||
gtk/a11y/gtkspinneraccessible.c
|
gtk/a11y/gtkspinneraccessible.c
|
||||||
@ -194,11 +193,7 @@ gtk/gtkmaplistmodel.c
|
|||||||
gtk/gtkmediacontrols.c
|
gtk/gtkmediacontrols.c
|
||||||
gtk/gtkmediafile.c
|
gtk/gtkmediafile.c
|
||||||
gtk/gtkmediastream.c
|
gtk/gtkmediastream.c
|
||||||
gtk/gtkmenubar.c
|
|
||||||
gtk/gtkmenubutton.c
|
gtk/gtkmenubutton.c
|
||||||
gtk/gtkmenu.c
|
|
||||||
gtk/gtkmenuitem.c
|
|
||||||
gtk/gtkmenushell.c
|
|
||||||
gtk/gtkmenutoolbutton.c
|
gtk/gtkmenutoolbutton.c
|
||||||
gtk/gtkmenutrackeritem.c
|
gtk/gtkmenutrackeritem.c
|
||||||
gtk/gtkmessagedialog.c
|
gtk/gtkmessagedialog.c
|
||||||
|
Loading…
Reference in New Issue
Block a user