#include "gtkaccelgroup.h"
#include "gtkaccelgroupprivate.h"
-#include "gtkaccellabel.h" /* For _gtk_accel_label_class_get_accelerator_label */
+#include "gtkaccellabel.h"
#include "gtkaccelmap.h"
#include "gtkintl.h"
-#include "gtkmain.h" /* For _gtk_boolean_handled_accumulator */
-#include "gdk/gdkkeysyms.h"
+#include "gtkmainprivate.h"
#include "gtkmarshalers.h"
* @Title: Accelerator Groups
* @See_also:gtk_window_add_accel_group(), gtk_accel_map_change_entry(),
* gtk_item_factory_new(), gtk_label_new_with_mnemonic()
- *
+ *
* A #GtkAccelGroup represents a group of keyboard accelerators,
* typically attached to a toplevel #GtkWindow (with
* gtk_window_add_accel_group()). Usually you won't need to create a
- * #GtkAccelGroup directly; instead, when using #GtkItemFactory, GTK+
- * automatically sets up the accelerators for your menus in the item
- * factory's #GtkAccelGroup.
- *
+ * #GtkAccelGroup directly; instead, when using #GtkUIManager, GTK+
+ * automatically sets up the accelerators for your menus in the ui
+ * manager's #GtkAccelGroup.
*
* Note that <firstterm>accelerators</firstterm> are different from
* <firstterm>mnemonics</firstterm>. Accelerators are shortcuts for
/**
* gtk_accel_group_find:
* @accel_group: a #GtkAccelGroup
- * @find_func: a function to filter the entries of @accel_group with
+ * @find_func: (scope call): a function to filter the entries
+ * of @accel_group with
* @data: data to pass to @find_func
- * @returns: the key of the first entry passing @find_func. The key is
- * owned by GTK+ and must not be freed.
+ * @returns: (transfer none): the key of the first entry passing
+ * @find_func. The key is owned by GTK+ and must not be freed.
*
* Finds the first entry in an accelerator group for which
* @find_func returns %TRUE and returns its #GtkAccelKey.
* @accel_group: the accelerator group to query
* @accel_key: key value of the accelerator
* @accel_mods: modifier combination of the accelerator
- * @n_entries: (allow-none): location to return the number of entries found, or %NULL
- * @returns: (allow-none): an array of @n_entries #GtkAccelGroupEntry elements, or %NULL. The array is owned by GTK+ and must not be freed.
+ * @n_entries: (allow-none): location to return the number of entries found,
+ * or %NULL
+ * @returns: (transfer none) (array length=n_entries): an array of
+ * @n_entries #GtkAccelGroupEntry elements, or %NULL. The array is
+ * owned by GTK+ and must not be freed.
*
* Queries an accelerator group for all entries matching @accel_key and
* @accel_mods.
/**
* gtk_accel_group_from_accel_closure:
* @closure: a #GClosure
- * @returns: (allow-none): the #GtkAccelGroup to which @closure is connected, or %NULL.
+ * @returns: (transfer none): the #GtkAccelGroup to which @closure
+ * is connected, or %NULL.
*
* Finds the #GtkAccelGroup to which @closure is connected;
* see gtk_accel_group_connect().
* @keyval: a GDK keyval
* @modifiers: modifier mask
* @returns: %TRUE if the accelerator is valid
- *
+ *
* Determines whether a given keyval and modifier mask constitute
- * a valid keyboard accelerator. For example, the #GDK_a keyval
+ * a valid keyboard accelerator. For example, the #GDK_KEY_a keyval
* plus #GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator.
- * But, you can't, for instance, use the #GDK_Control_L keyval
+ * But, you can't, for instance, use the #GDK_KEY_Control_L keyval
* as an accelerator.
*/
gboolean
GdkModifierType modifiers)
{
static const guint invalid_accelerator_vals[] = {
- GDK_Shift_L, GDK_Shift_R, GDK_Shift_Lock, GDK_Caps_Lock, GDK_ISO_Lock,
- GDK_Control_L, GDK_Control_R, GDK_Meta_L, GDK_Meta_R,
- GDK_Alt_L, GDK_Alt_R, GDK_Super_L, GDK_Super_R, GDK_Hyper_L, GDK_Hyper_R,
- GDK_ISO_Level3_Shift, GDK_ISO_Next_Group, GDK_ISO_Prev_Group,
- GDK_ISO_First_Group, GDK_ISO_Last_Group,
- GDK_Mode_switch, GDK_Num_Lock, GDK_Multi_key,
- GDK_Scroll_Lock, GDK_Sys_Req,
- GDK_Tab, GDK_ISO_Left_Tab, GDK_KP_Tab,
- GDK_First_Virtual_Screen, GDK_Prev_Virtual_Screen,
- GDK_Next_Virtual_Screen, GDK_Last_Virtual_Screen,
- GDK_Terminate_Server, GDK_AudibleBell_Enable,
+ GDK_KEY_Shift_L, GDK_KEY_Shift_R, GDK_KEY_Shift_Lock, GDK_KEY_Caps_Lock, GDK_KEY_ISO_Lock,
+ GDK_KEY_Control_L, GDK_KEY_Control_R, GDK_KEY_Meta_L, GDK_KEY_Meta_R,
+ GDK_KEY_Alt_L, GDK_KEY_Alt_R, GDK_KEY_Super_L, GDK_KEY_Super_R, GDK_KEY_Hyper_L, GDK_KEY_Hyper_R,
+ GDK_KEY_ISO_Level3_Shift, GDK_KEY_ISO_Next_Group, GDK_KEY_ISO_Prev_Group,
+ GDK_KEY_ISO_First_Group, GDK_KEY_ISO_Last_Group,
+ GDK_KEY_Mode_switch, GDK_KEY_Num_Lock, GDK_KEY_Multi_key,
+ GDK_KEY_Scroll_Lock, GDK_KEY_Sys_Req,
+ GDK_KEY_Tab, GDK_KEY_ISO_Left_Tab, GDK_KEY_KP_Tab,
+ GDK_KEY_First_Virtual_Screen, GDK_KEY_Prev_Virtual_Screen,
+ GDK_KEY_Next_Virtual_Screen, GDK_KEY_Last_Virtual_Screen,
+ GDK_KEY_Terminate_Server, GDK_KEY_AudibleBell_Enable,
0
};
static const guint invalid_unmodified_vals[] = {
- GDK_Up, GDK_Down, GDK_Left, GDK_Right,
- GDK_KP_Up, GDK_KP_Down, GDK_KP_Left, GDK_KP_Right,
+ GDK_KEY_Up, GDK_KEY_Down, GDK_KEY_Left, GDK_KEY_Right,
+ GDK_KEY_KP_Up, GDK_KEY_KP_Down, GDK_KEY_KP_Left, GDK_KEY_KP_Right,
0
};
const guint *ac_val;
/**
* gtk_accelerator_parse:
* @accelerator: string representing an accelerator
- * @accelerator_key: return location for accelerator keyval
- * @accelerator_mods: return location for accelerator modifier mask
+ * @accelerator_key: (out): return location for accelerator keyval
+ * @accelerator_mods: (out): return location for accelerator modifier mask
*
* Parses a string representing an accelerator. The
* format looks like "<Control>a" or "<Shift><Alt>F1" or
* gtk_accelerator_name:
* @accelerator_key: accelerator keyval
* @accelerator_mods: accelerator modifier mask
- *
+ *
* Converts an accelerator keyval and modifier mask
* into a string parseable by gtk_accelerator_parse().
- * For example, if you pass in #GDK_q and #GDK_CONTROL_MASK,
- * this function returns "<Control>q".
+ * For example, if you pass in #GDK_KEY_q and #GDK_CONTROL_MASK,
+ * this function returns "<Control>q".
*
* If you need to display accelerators in the user interface,
* see gtk_accelerator_get_label().
*
* Gets the value set by gtk_accelerator_set_default_mod_mask().
*/
-guint
+GdkModifierType
gtk_accelerator_get_default_mod_mask (void)
{
return default_accel_mod_mask;