// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type ShortcutsShortcutClass struct { _ structs.HostLayout } func (x *ShortcutsShortcutClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // GtkShortcutType specifies the kind of shortcut that is being described. // // More values may be added to this enumeration over time. type ShortcutType int var xShortcutTypeGLibType func() types.GType func ShortcutTypeGLibType() types.GType { return xShortcutTypeGLibType() } const ( // The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator // property will be used. ShortcutAcceleratorValue ShortcutType = 0 // The shortcut is a pinch gesture. GTK provides an icon and subtitle. ShortcutGesturePinchValue ShortcutType = 1 // The shortcut is a stretch gesture. GTK provides an icon and subtitle. ShortcutGestureStretchValue ShortcutType = 2 // The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle. ShortcutGestureRotateClockwiseValue ShortcutType = 3 // The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle. ShortcutGestureRotateCounterclockwiseValue ShortcutType = 4 // The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. ShortcutGestureTwoFingerSwipeLeftValue ShortcutType = 5 // The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle. ShortcutGestureTwoFingerSwipeRightValue ShortcutType = 6 // The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be // used. ShortcutGestureValue ShortcutType = 7 // The shortcut is a swipe gesture. GTK provides an icon and subtitle. ShortcutGestureSwipeLeftValue ShortcutType = 8 // The shortcut is a swipe gesture. GTK provides an icon and subtitle. ShortcutGestureSwipeRightValue ShortcutType = 9 ) // A `GtkShortcutsShortcut` represents a single keyboard shortcut or gesture // with a short text. // // This widget is only meant to be used with `GtkShortcutsWindow`. type ShortcutsShortcut struct { Widget } var xShortcutsShortcutGLibType func() types.GType func ShortcutsShortcutGLibType() types.GType { return xShortcutsShortcutGLibType() } func ShortcutsShortcutNewFromInternalPtr(ptr uintptr) *ShortcutsShortcut { cls := &ShortcutsShortcut{} cls.Ptr = ptr return cls } func (c *ShortcutsShortcut) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ShortcutsShortcut) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyAccelerator sets the "accelerator" property. // The accelerator(s) represented by this object. // // This property is used if [property@Gtk.ShortcutsShortcut:shortcut-type] // is set to %GTK_SHORTCUT_ACCELERATOR. // // The syntax of this property is (an extension of) the syntax understood // by [func@Gtk.accelerator_parse]. Multiple accelerators can be specified // by separating them with a space, but keep in mind that the available width // is limited. // // It is also possible to specify ranges of shortcuts, using `...` between // the keys. Sequences of keys can be specified using a `+` or `&` between // the keys. // // Examples: // // - A single shortcut: `<ctl><alt>delete` // - Two alternative shortcuts: `<shift>a Home` // - A range of shortcuts: `<alt>1...<alt>9` // - Several keys pressed together: `Control_L&Control_R` // - A sequence of shortcuts or keys: `<ctl>c+<ctl>x` // // Use "+" instead of "&" when the keys may (or have to be) pressed // sequentially (e.g use "t+t" for 'press the t key twice'). // // Note that `<`, `>` and `&` need to be escaped as `&lt;`, `&gt`; and `&amp`; when used // in .ui files. func (x *ShortcutsShortcut) SetPropertyAccelerator(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("accelerator", &v) } // GetPropertyAccelerator gets the "accelerator" property. // The accelerator(s) represented by this object. // // This property is used if [property@Gtk.ShortcutsShortcut:shortcut-type] // is set to %GTK_SHORTCUT_ACCELERATOR. // // The syntax of this property is (an extension of) the syntax understood // by [func@Gtk.accelerator_parse]. Multiple accelerators can be specified // by separating them with a space, but keep in mind that the available width // is limited. // // It is also possible to specify ranges of shortcuts, using `...` between // the keys. Sequences of keys can be specified using a `+` or `&` between // the keys. // // Examples: // // - A single shortcut: `<ctl><alt>delete` // - Two alternative shortcuts: `<shift>a Home` // - A range of shortcuts: `<alt>1...<alt>9` // - Several keys pressed together: `Control_L&Control_R` // - A sequence of shortcuts or keys: `<ctl>c+<ctl>x` // // Use "+" instead of "&" when the keys may (or have to be) pressed // sequentially (e.g use "t+t" for 'press the t key twice'). // // Note that `<`, `>` and `&` need to be escaped as `&lt;`, `&gt`; and `&amp`; when used // in .ui files. func (x *ShortcutsShortcut) GetPropertyAccelerator() string { var v gobject.Value x.GetProperty("accelerator", &v) return v.GetString() } // SetPropertyActionName sets the "action-name" property. // A detailed action name. // // If this is set for a shortcut of type %GTK_SHORTCUT_ACCELERATOR, // then GTK will use the accelerators that are associated with the // action via [method@Gtk.Application.set_accels_for_action], and // setting [property@Gtk.ShortcutsShortcut:accelerator] is not necessary. func (x *ShortcutsShortcut) SetPropertyActionName(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("action-name", &v) } // GetPropertyActionName gets the "action-name" property. // A detailed action name. // // If this is set for a shortcut of type %GTK_SHORTCUT_ACCELERATOR, // then GTK will use the accelerators that are associated with the // action via [method@Gtk.Application.set_accels_for_action], and // setting [property@Gtk.ShortcutsShortcut:accelerator] is not necessary. func (x *ShortcutsShortcut) GetPropertyActionName() string { var v gobject.Value x.GetProperty("action-name", &v) return v.GetString() } // SetPropertyIconSet sets the "icon-set" property. // %TRUE if an icon has been set. func (x *ShortcutsShortcut) SetPropertyIconSet(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("icon-set", &v) } // GetPropertyIconSet gets the "icon-set" property. // %TRUE if an icon has been set. func (x *ShortcutsShortcut) GetPropertyIconSet() bool { var v gobject.Value x.GetProperty("icon-set", &v) return v.GetBoolean() } // SetPropertySubtitle sets the "subtitle" property. // The subtitle for the shortcut or gesture. // // This is typically used for gestures and should be a short, one-line // text that describes the gesture itself. For the predefined gesture // types, GTK provides a subtitle on its own. func (x *ShortcutsShortcut) SetPropertySubtitle(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("subtitle", &v) } // GetPropertySubtitle gets the "subtitle" property. // The subtitle for the shortcut or gesture. // // This is typically used for gestures and should be a short, one-line // text that describes the gesture itself. For the predefined gesture // types, GTK provides a subtitle on its own. func (x *ShortcutsShortcut) GetPropertySubtitle() string { var v gobject.Value x.GetProperty("subtitle", &v) return v.GetString() } // SetPropertySubtitleSet sets the "subtitle-set" property. // %TRUE if a subtitle has been set. func (x *ShortcutsShortcut) SetPropertySubtitleSet(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("subtitle-set", &v) } // GetPropertySubtitleSet gets the "subtitle-set" property. // %TRUE if a subtitle has been set. func (x *ShortcutsShortcut) GetPropertySubtitleSet() bool { var v gobject.Value x.GetProperty("subtitle-set", &v) return v.GetBoolean() } // SetPropertyTitle sets the "title" property. // The textual description for the shortcut or gesture represented by // this object. // // This should be a short string that can fit in a single line. func (x *ShortcutsShortcut) SetPropertyTitle(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("title", &v) } // GetPropertyTitle gets the "title" property. // The textual description for the shortcut or gesture represented by // this object. // // This should be a short string that can fit in a single line. func (x *ShortcutsShortcut) GetPropertyTitle() string { var v gobject.Value x.GetProperty("title", &v) return v.GetString() } // Requests the user's screen reader to announce the given message. // // This kind of notification is useful for messages that // either have only a visual representation or that are not // exposed visually at all, e.g. a notification about a // successful operation. // // Also, by using this API, you can ensure that the message // does not interrupts the user's current screen reader output. func (x *ShortcutsShortcut) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *ShortcutsShortcut) GetAccessibleParent() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *ShortcutsShortcut) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *ShortcutsShortcut) GetAtContext() *ATContext { var cls *ATContext cret := XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = &ATContext{} cls.Ptr = cret return cls } // Queries the coordinates and dimensions of this accessible // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get the bounds from an ignored // child widget. func (x *ShortcutsShortcut) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *ShortcutsShortcut) GetFirstAccessibleChild() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *ShortcutsShortcut) GetNextAccessibleSibling() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Queries a platform state, such as focus. // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get platform state from an ignored // child widget, as is the case for `GtkText` wrappers. func (x *ShortcutsShortcut) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *ShortcutsShortcut) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *ShortcutsShortcut) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *ShortcutsShortcut) ResetState(StateVar AccessibleState) { XGtkAccessibleResetState(x.GoPointer(), StateVar) } // Sets the parent and sibling of an accessible object. // // This function is meant to be used by accessible implementations that are // not part of the widget hierarchy, and but act as a logical bridge between // widgets. For instance, if a widget creates an object that holds metadata // for each child, and you want that object to implement the `GtkAccessible` // interface, you will use this function to ensure that the parent of each // child widget is the metadata object, and the parent of each metadata // object is the container widget. func (x *ShortcutsShortcut) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) } // Updates the next accessible sibling. // // That might be useful when a new child of a custom accessible // is created, and it needs to be linked to a previous child. func (x *ShortcutsShortcut) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) } // Informs ATs that the platform state has changed. // // This function should be used by `GtkAccessible` implementations that // have a platform state but are not widgets. Widgets handle platform // states automatically. func (x *ShortcutsShortcut) UpdatePlatformState(StateVar AccessiblePlatformState) { XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) } // Updates a list of accessible properties. // // See the [enum@Gtk.AccessibleProperty] documentation for the // value types of accessible properties. // // This function should be called by `GtkWidget` types whenever // an accessible property change must be communicated to assistive // technologies. // // Example: // ```c // value = gtk_adjustment_get_value (adjustment); // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), // // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, // -1); // // ``` func (x *ShortcutsShortcut) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) { XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) } // Updates an array of accessible properties. // // This function should be called by `GtkWidget` types whenever an accessible // property change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *ShortcutsShortcut) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) { XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) } // Updates a list of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // If the [enum@Gtk.AccessibleRelation] requires a list of references, // you should pass each reference individually, followed by `NULL`, e.g. // // ```c // gtk_accessible_update_relation (accessible, // // GTK_ACCESSIBLE_RELATION_CONTROLS, // ref1, NULL, // GTK_ACCESSIBLE_RELATION_LABELLED_BY, // ref1, ref2, ref3, NULL, // -1); // // ``` func (x *ShortcutsShortcut) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) { XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) } // Updates an array of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *ShortcutsShortcut) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) { XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) } // Updates a list of accessible states. // // See the [enum@Gtk.AccessibleState] documentation for the // value types of accessible states. // // This function should be called by `GtkWidget` types whenever // an accessible state change must be communicated to assistive // technologies. // // Example: // // ```c // value = GTK_ACCESSIBLE_TRISTATE_MIXED; // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), // // GTK_ACCESSIBLE_STATE_CHECKED, value, // -1); // // ``` func (x *ShortcutsShortcut) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) { XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) } // Updates an array of accessible states. // // This function should be called by `GtkWidget` types whenever an accessible // state change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *ShortcutsShortcut) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // Gets the ID of the @buildable object. // // `GtkBuilder` sets the name based on the ID attribute // of the `<object>` tag used to construct the @buildable. func (x *ShortcutsShortcut) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret }