1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/bnema/puregotk/v4/gobject"
9 "github.com/bnema/puregotk/v4/gobject/types"
10)
11
12type ShortcutsShortcutClass struct {
13 _ structs.HostLayout
14}
15
16func (x *ShortcutsShortcutClass) GoPointer() uintptr {
17 return uintptr(unsafe.Pointer(x))
18}
19
20// GtkShortcutType specifies the kind of shortcut that is being described.
21//
22// More values may be added to this enumeration over time.
23type ShortcutType int
24
25var xShortcutTypeGLibType func() types.GType
26
27func ShortcutTypeGLibType() types.GType {
28 return xShortcutTypeGLibType()
29}
30
31const (
32
33 // The shortcut is a keyboard accelerator. The GtkShortcutsShortcut:accelerator
34 // property will be used.
35 ShortcutAcceleratorValue ShortcutType = 0
36 // The shortcut is a pinch gesture. GTK provides an icon and subtitle.
37 ShortcutGesturePinchValue ShortcutType = 1
38 // The shortcut is a stretch gesture. GTK provides an icon and subtitle.
39 ShortcutGestureStretchValue ShortcutType = 2
40 // The shortcut is a clockwise rotation gesture. GTK provides an icon and subtitle.
41 ShortcutGestureRotateClockwiseValue ShortcutType = 3
42 // The shortcut is a counterclockwise rotation gesture. GTK provides an icon and subtitle.
43 ShortcutGestureRotateCounterclockwiseValue ShortcutType = 4
44 // The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle.
45 ShortcutGestureTwoFingerSwipeLeftValue ShortcutType = 5
46 // The shortcut is a two-finger swipe gesture. GTK provides an icon and subtitle.
47 ShortcutGestureTwoFingerSwipeRightValue ShortcutType = 6
48 // The shortcut is a gesture. The GtkShortcutsShortcut:icon property will be
49 // used.
50 ShortcutGestureValue ShortcutType = 7
51 // The shortcut is a swipe gesture. GTK provides an icon and subtitle.
52 ShortcutGestureSwipeLeftValue ShortcutType = 8
53 // The shortcut is a swipe gesture. GTK provides an icon and subtitle.
54 ShortcutGestureSwipeRightValue ShortcutType = 9
55)
56
57// A `GtkShortcutsShortcut` represents a single keyboard shortcut or gesture
58// with a short text.
59//
60// This widget is only meant to be used with `GtkShortcutsWindow`.
61type ShortcutsShortcut struct {
62 Widget
63}
64
65var xShortcutsShortcutGLibType func() types.GType
66
67func ShortcutsShortcutGLibType() types.GType {
68 return xShortcutsShortcutGLibType()
69}
70
71func ShortcutsShortcutNewFromInternalPtr(ptr uintptr) *ShortcutsShortcut {
72 cls := &ShortcutsShortcut{}
73 cls.Ptr = ptr
74 return cls
75}
76
77func (c *ShortcutsShortcut) GoPointer() uintptr {
78 if c == nil {
79 return 0
80 }
81 return c.Ptr
82}
83
84func (c *ShortcutsShortcut) SetGoPointer(ptr uintptr) {
85 c.Ptr = ptr
86}
87
88// SetPropertyAccelerator sets the "accelerator" property.
89// The accelerator(s) represented by this object.
90//
91// This property is used if [property@Gtk.ShortcutsShortcut:shortcut-type]
92// is set to %GTK_SHORTCUT_ACCELERATOR.
93//
94// The syntax of this property is (an extension of) the syntax understood
95// by [func@Gtk.accelerator_parse]. Multiple accelerators can be specified
96// by separating them with a space, but keep in mind that the available width
97// is limited.
98//
99// It is also possible to specify ranges of shortcuts, using `...` between
100// the keys. Sequences of keys can be specified using a `+` or `&` between
101// the keys.
102//
103// Examples:
104//
105// - A single shortcut: `<ctl><alt>delete`
106// - Two alternative shortcuts: `<shift>a Home`
107// - A range of shortcuts: `<alt>1...<alt>9`
108// - Several keys pressed together: `Control_L&Control_R`
109// - A sequence of shortcuts or keys: `<ctl>c+<ctl>x`
110//
111// Use "+" instead of "&" when the keys may (or have to be) pressed
112// sequentially (e.g use "t+t" for 'press the t key twice').
113//
114// Note that `<`, `>` and `&` need to be escaped as `&lt;`, `&gt`; and `&amp`; when used
115// in .ui files.
116func (x *ShortcutsShortcut) SetPropertyAccelerator(value string) {
117 var v gobject.Value
118 v.Init(gobject.TypeStringVal)
119 v.SetString(&value)
120 x.SetProperty("accelerator", &v)
121}
122
123// GetPropertyAccelerator gets the "accelerator" property.
124// The accelerator(s) represented by this object.
125//
126// This property is used if [property@Gtk.ShortcutsShortcut:shortcut-type]
127// is set to %GTK_SHORTCUT_ACCELERATOR.
128//
129// The syntax of this property is (an extension of) the syntax understood
130// by [func@Gtk.accelerator_parse]. Multiple accelerators can be specified
131// by separating them with a space, but keep in mind that the available width
132// is limited.
133//
134// It is also possible to specify ranges of shortcuts, using `...` between
135// the keys. Sequences of keys can be specified using a `+` or `&` between
136// the keys.
137//
138// Examples:
139//
140// - A single shortcut: `<ctl><alt>delete`
141// - Two alternative shortcuts: `<shift>a Home`
142// - A range of shortcuts: `<alt>1...<alt>9`
143// - Several keys pressed together: `Control_L&Control_R`
144// - A sequence of shortcuts or keys: `<ctl>c+<ctl>x`
145//
146// Use "+" instead of "&" when the keys may (or have to be) pressed
147// sequentially (e.g use "t+t" for 'press the t key twice').
148//
149// Note that `<`, `>` and `&` need to be escaped as `&lt;`, `&gt`; and `&amp`; when used
150// in .ui files.
151func (x *ShortcutsShortcut) GetPropertyAccelerator() string {
152 var v gobject.Value
153 x.GetProperty("accelerator", &v)
154 return v.GetString()
155}
156
157// SetPropertyActionName sets the "action-name" property.
158// A detailed action name.
159//
160// If this is set for a shortcut of type %GTK_SHORTCUT_ACCELERATOR,
161// then GTK will use the accelerators that are associated with the
162// action via [method@Gtk.Application.set_accels_for_action], and
163// setting [property@Gtk.ShortcutsShortcut:accelerator] is not necessary.
164func (x *ShortcutsShortcut) SetPropertyActionName(value string) {
165 var v gobject.Value
166 v.Init(gobject.TypeStringVal)
167 v.SetString(&value)
168 x.SetProperty("action-name", &v)
169}
170
171// GetPropertyActionName gets the "action-name" property.
172// A detailed action name.
173//
174// If this is set for a shortcut of type %GTK_SHORTCUT_ACCELERATOR,
175// then GTK will use the accelerators that are associated with the
176// action via [method@Gtk.Application.set_accels_for_action], and
177// setting [property@Gtk.ShortcutsShortcut:accelerator] is not necessary.
178func (x *ShortcutsShortcut) GetPropertyActionName() string {
179 var v gobject.Value
180 x.GetProperty("action-name", &v)
181 return v.GetString()
182}
183
184// SetPropertyIconSet sets the "icon-set" property.
185// %TRUE if an icon has been set.
186func (x *ShortcutsShortcut) SetPropertyIconSet(value bool) {
187 var v gobject.Value
188 v.Init(gobject.TypeBooleanVal)
189 v.SetBoolean(value)
190 x.SetProperty("icon-set", &v)
191}
192
193// GetPropertyIconSet gets the "icon-set" property.
194// %TRUE if an icon has been set.
195func (x *ShortcutsShortcut) GetPropertyIconSet() bool {
196 var v gobject.Value
197 x.GetProperty("icon-set", &v)
198 return v.GetBoolean()
199}
200
201// SetPropertySubtitle sets the "subtitle" property.
202// The subtitle for the shortcut or gesture.
203//
204// This is typically used for gestures and should be a short, one-line
205// text that describes the gesture itself. For the predefined gesture
206// types, GTK provides a subtitle on its own.
207func (x *ShortcutsShortcut) SetPropertySubtitle(value string) {
208 var v gobject.Value
209 v.Init(gobject.TypeStringVal)
210 v.SetString(&value)
211 x.SetProperty("subtitle", &v)
212}
213
214// GetPropertySubtitle gets the "subtitle" property.
215// The subtitle for the shortcut or gesture.
216//
217// This is typically used for gestures and should be a short, one-line
218// text that describes the gesture itself. For the predefined gesture
219// types, GTK provides a subtitle on its own.
220func (x *ShortcutsShortcut) GetPropertySubtitle() string {
221 var v gobject.Value
222 x.GetProperty("subtitle", &v)
223 return v.GetString()
224}
225
226// SetPropertySubtitleSet sets the "subtitle-set" property.
227// %TRUE if a subtitle has been set.
228func (x *ShortcutsShortcut) SetPropertySubtitleSet(value bool) {
229 var v gobject.Value
230 v.Init(gobject.TypeBooleanVal)
231 v.SetBoolean(value)
232 x.SetProperty("subtitle-set", &v)
233}
234
235// GetPropertySubtitleSet gets the "subtitle-set" property.
236// %TRUE if a subtitle has been set.
237func (x *ShortcutsShortcut) GetPropertySubtitleSet() bool {
238 var v gobject.Value
239 x.GetProperty("subtitle-set", &v)
240 return v.GetBoolean()
241}
242
243// SetPropertyTitle sets the "title" property.
244// The textual description for the shortcut or gesture represented by
245// this object.
246//
247// This should be a short string that can fit in a single line.
248func (x *ShortcutsShortcut) SetPropertyTitle(value string) {
249 var v gobject.Value
250 v.Init(gobject.TypeStringVal)
251 v.SetString(&value)
252 x.SetProperty("title", &v)
253}
254
255// GetPropertyTitle gets the "title" property.
256// The textual description for the shortcut or gesture represented by
257// this object.
258//
259// This should be a short string that can fit in a single line.
260func (x *ShortcutsShortcut) GetPropertyTitle() string {
261 var v gobject.Value
262 x.GetProperty("title", &v)
263 return v.GetString()
264}
265
266// Requests the user's screen reader to announce the given message.
267//
268// This kind of notification is useful for messages that
269// either have only a visual representation or that are not
270// exposed visually at all, e.g. a notification about a
271// successful operation.
272//
273// Also, by using this API, you can ensure that the message
274// does not interrupts the user's current screen reader output.
275func (x *ShortcutsShortcut) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
276
277 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
278
279}
280
281// Retrieves the accessible parent for an accessible object.
282//
283// This function returns `NULL` for top level widgets.
284func (x *ShortcutsShortcut) GetAccessibleParent() *AccessibleBase {
285 var cls *AccessibleBase
286
287 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
288
289 if cret == 0 {
290 return nil
291 }
292 cls = &AccessibleBase{}
293 cls.Ptr = cret
294 return cls
295}
296
297// Retrieves the accessible role of an accessible object.
298func (x *ShortcutsShortcut) GetAccessibleRole() AccessibleRole {
299
300 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
301 return cret
302}
303
304// Retrieves the implementation for the given accessible object.
305func (x *ShortcutsShortcut) GetAtContext() *ATContext {
306 var cls *ATContext
307
308 cret := XGtkAccessibleGetAtContext(x.GoPointer())
309
310 if cret == 0 {
311 return nil
312 }
313 cls = &ATContext{}
314 cls.Ptr = cret
315 return cls
316}
317
318// Queries the coordinates and dimensions of this accessible
319//
320// This functionality can be overridden by `GtkAccessible`
321// implementations, e.g. to get the bounds from an ignored
322// child widget.
323func (x *ShortcutsShortcut) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
324
325 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
326 return cret
327}
328
329// Retrieves the first accessible child of an accessible object.
330func (x *ShortcutsShortcut) GetFirstAccessibleChild() *AccessibleBase {
331 var cls *AccessibleBase
332
333 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
334
335 if cret == 0 {
336 return nil
337 }
338 cls = &AccessibleBase{}
339 cls.Ptr = cret
340 return cls
341}
342
343// Retrieves the next accessible sibling of an accessible object
344func (x *ShortcutsShortcut) GetNextAccessibleSibling() *AccessibleBase {
345 var cls *AccessibleBase
346
347 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
348
349 if cret == 0 {
350 return nil
351 }
352 cls = &AccessibleBase{}
353 cls.Ptr = cret
354 return cls
355}
356
357// Queries a platform state, such as focus.
358//
359// This functionality can be overridden by `GtkAccessible`
360// implementations, e.g. to get platform state from an ignored
361// child widget, as is the case for `GtkText` wrappers.
362func (x *ShortcutsShortcut) GetPlatformState(StateVar AccessiblePlatformState) bool {
363
364 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
365 return cret
366}
367
368// Resets the accessible property to its default value.
369func (x *ShortcutsShortcut) ResetProperty(PropertyVar AccessibleProperty) {
370
371 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
372
373}
374
375// Resets the accessible relation to its default value.
376func (x *ShortcutsShortcut) ResetRelation(RelationVar AccessibleRelation) {
377
378 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
379
380}
381
382// Resets the accessible state to its default value.
383func (x *ShortcutsShortcut) ResetState(StateVar AccessibleState) {
384
385 XGtkAccessibleResetState(x.GoPointer(), StateVar)
386
387}
388
389// Sets the parent and sibling of an accessible object.
390//
391// This function is meant to be used by accessible implementations that are
392// not part of the widget hierarchy, and but act as a logical bridge between
393// widgets. For instance, if a widget creates an object that holds metadata
394// for each child, and you want that object to implement the `GtkAccessible`
395// interface, you will use this function to ensure that the parent of each
396// child widget is the metadata object, and the parent of each metadata
397// object is the container widget.
398func (x *ShortcutsShortcut) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
399
400 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
401
402}
403
404// Updates the next accessible sibling.
405//
406// That might be useful when a new child of a custom accessible
407// is created, and it needs to be linked to a previous child.
408func (x *ShortcutsShortcut) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
409
410 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
411
412}
413
414// Informs ATs that the platform state has changed.
415//
416// This function should be used by `GtkAccessible` implementations that
417// have a platform state but are not widgets. Widgets handle platform
418// states automatically.
419func (x *ShortcutsShortcut) UpdatePlatformState(StateVar AccessiblePlatformState) {
420
421 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
422
423}
424
425// Updates a list of accessible properties.
426//
427// See the [enum@Gtk.AccessibleProperty] documentation for the
428// value types of accessible properties.
429//
430// This function should be called by `GtkWidget` types whenever
431// an accessible property change must be communicated to assistive
432// technologies.
433//
434// Example:
435// ```c
436// value = gtk_adjustment_get_value (adjustment);
437// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
438//
439// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
440// -1);
441//
442// ```
443func (x *ShortcutsShortcut) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
444
445 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
446
447}
448
449// Updates an array of accessible properties.
450//
451// This function should be called by `GtkWidget` types whenever an accessible
452// property change must be communicated to assistive technologies.
453//
454// This function is meant to be used by language bindings.
455func (x *ShortcutsShortcut) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
456
457 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
458
459}
460
461// Updates a list of accessible relations.
462//
463// This function should be called by `GtkWidget` types whenever an accessible
464// relation change must be communicated to assistive technologies.
465//
466// If the [enum@Gtk.AccessibleRelation] requires a list of references,
467// you should pass each reference individually, followed by `NULL`, e.g.
468//
469// ```c
470// gtk_accessible_update_relation (accessible,
471//
472// GTK_ACCESSIBLE_RELATION_CONTROLS,
473// ref1, NULL,
474// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
475// ref1, ref2, ref3, NULL,
476// -1);
477//
478// ```
479func (x *ShortcutsShortcut) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
480
481 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
482
483}
484
485// Updates an array of accessible relations.
486//
487// This function should be called by `GtkWidget` types whenever an accessible
488// relation change must be communicated to assistive technologies.
489//
490// This function is meant to be used by language bindings.
491func (x *ShortcutsShortcut) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
492
493 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
494
495}
496
497// Updates a list of accessible states.
498//
499// See the [enum@Gtk.AccessibleState] documentation for the
500// value types of accessible states.
501//
502// This function should be called by `GtkWidget` types whenever
503// an accessible state change must be communicated to assistive
504// technologies.
505//
506// Example:
507//
508// ```c
509// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
510// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
511//
512// GTK_ACCESSIBLE_STATE_CHECKED, value,
513// -1);
514//
515// ```
516func (x *ShortcutsShortcut) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
517
518 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
519
520}
521
522// Updates an array of accessible states.
523//
524// This function should be called by `GtkWidget` types whenever an accessible
525// state change must be communicated to assistive technologies.
526//
527// This function is meant to be used by language bindings.
528func (x *ShortcutsShortcut) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
529
530 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
531
532}
533
534// Gets the ID of the @buildable object.
535//
536// `GtkBuilder` sets the name based on the ID attribute
537// of the `<object>` tag used to construct the @buildable.
538func (x *ShortcutsShortcut) GetBuildableId() string {
539
540 cret := XGtkBuildableGetBuildableId(x.GoPointer())
541 return cret
542}