v0.2.1 c0399be

gtkcolordialogbutton.go RawHistoryFolder

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/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/gdk"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17type ColorDialogButtonClass struct {
18	_ structs.HostLayout
19
20	ParentClass WidgetClass
21}
22
23func (x *ColorDialogButtonClass) GoPointer() uintptr {
24	return uintptr(unsafe.Pointer(x))
25}
26
27// Opens a color chooser dialog to select a color.
28//
29// <picture>
30//
31//	<source srcset="color-button-dark.png" media="(prefers-color-scheme: dark)">
32//	<img alt="An example GtkColorDialogButton" src="color-button.png">
33//
34// </picture>
35//
36// It is suitable widget for selecting a color in a preference dialog.
37//
38// # CSS nodes
39//
40// ```
41// colorbutton
42// ╰── button.color
43//
44//	╰── [content]
45//
46// ```
47//
48// `GtkColorDialogButton` has a single CSS node with name colorbutton which
49// contains a button node. To differentiate it from a plain `GtkButton`,
50// it gets the .color style class.
51type ColorDialogButton struct {
52	Widget
53}
54
55var xColorDialogButtonGLibType func() types.GType
56
57func ColorDialogButtonGLibType() types.GType {
58	return xColorDialogButtonGLibType()
59}
60
61func ColorDialogButtonNewFromInternalPtr(ptr uintptr) *ColorDialogButton {
62	cls := &ColorDialogButton{}
63	cls.Ptr = ptr
64	return cls
65}
66
67var xNewColorDialogButton func(uintptr) uintptr
68
69// Creates a new `GtkColorDialogButton` with the
70// given `GtkColorDialog`.
71//
72// You can pass `NULL` to this function and set a `GtkColorDialog`
73// later. The button will be insensitive until that happens.
74func NewColorDialogButton(DialogVar *ColorDialog) *ColorDialogButton {
75	var cls *ColorDialogButton
76
77	cret := xNewColorDialogButton(DialogVar.GoPointer())
78
79	if cret == 0 {
80		return nil
81	}
82	gobject.IncreaseRef(cret)
83	cls = &ColorDialogButton{}
84	cls.Ptr = cret
85	return cls
86}
87
88var xColorDialogButtonGetDialog func(uintptr) uintptr
89
90// Returns the `GtkColorDialog` of @self.
91func (x *ColorDialogButton) GetDialog() *ColorDialog {
92	var cls *ColorDialog
93
94	cret := xColorDialogButtonGetDialog(x.GoPointer())
95
96	if cret == 0 {
97		return nil
98	}
99	gobject.IncreaseRef(cret)
100	cls = &ColorDialog{}
101	cls.Ptr = cret
102	return cls
103}
104
105var xColorDialogButtonGetRgba func(uintptr) *gdk.RGBA
106
107// Returns the color of the button.
108//
109// This function is what should be used to obtain
110// the color that was chosen by the user. To get
111// informed about changes, listen to "notify::rgba".
112func (x *ColorDialogButton) GetRgba() *gdk.RGBA {
113
114	cret := xColorDialogButtonGetRgba(x.GoPointer())
115	return cret
116}
117
118var xColorDialogButtonSetDialog func(uintptr, uintptr)
119
120// Sets a `GtkColorDialog` object to use for
121// creating the color chooser dialog that is
122// presented when the user clicks the button.
123func (x *ColorDialogButton) SetDialog(DialogVar *ColorDialog) {
124
125	xColorDialogButtonSetDialog(x.GoPointer(), DialogVar.GoPointer())
126
127}
128
129var xColorDialogButtonSetRgba func(uintptr, *gdk.RGBA)
130
131// Sets the color of the button.
132func (x *ColorDialogButton) SetRgba(ColorVar *gdk.RGBA) {
133
134	xColorDialogButtonSetRgba(x.GoPointer(), ColorVar)
135
136}
137
138func (c *ColorDialogButton) GoPointer() uintptr {
139	if c == nil {
140		return 0
141	}
142	return c.Ptr
143}
144
145func (c *ColorDialogButton) SetGoPointer(ptr uintptr) {
146	c.Ptr = ptr
147}
148
149// SetPropertyRgba sets the "rgba" property.
150// The selected color.
151//
152// This property can be set to give the button its initial
153// color, and it will be updated to reflect the users choice
154// in the color chooser dialog.
155//
156// Listen to `notify::rgba` to get informed about changes
157// to the buttons color.
158func (x *ColorDialogButton) SetPropertyRgba(value uintptr) {
159	var v gobject.Value
160	v.Init(gobject.TypePointerVal)
161	v.SetPointer(value)
162	x.SetProperty("rgba", &v)
163}
164
165// GetPropertyRgba gets the "rgba" property.
166// The selected color.
167//
168// This property can be set to give the button its initial
169// color, and it will be updated to reflect the users choice
170// in the color chooser dialog.
171//
172// Listen to `notify::rgba` to get informed about changes
173// to the buttons color.
174func (x *ColorDialogButton) GetPropertyRgba() uintptr {
175	var v gobject.Value
176	x.GetProperty("rgba", &v)
177	return v.GetPointer()
178}
179
180// Emitted when the color dialog button is activated.
181//
182// The `::activate` signal on `GtkColorDialogButton` is an action signal
183// and emitting it causes the button to pop up its dialog.
184func (x *ColorDialogButton) ConnectActivate(cb *func(ColorDialogButton)) uint {
185	cbPtr := uintptr(unsafe.Pointer(cb))
186	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
187		handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
188		glib.SaveHandlerMapping(handlerID, cbPtr)
189		return handlerID
190	}
191
192	fcb := func(clsPtr uintptr) {
193		fa := ColorDialogButton{}
194		fa.Ptr = clsPtr
195		cbFn := *cb
196
197		cbFn(fa)
198
199	}
200	cbRefPtr := purego.NewCallback(fcb)
201	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
202	handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
203	glib.SaveHandlerMapping(handlerID, cbPtr)
204	return handlerID
205}
206
207// Requests the user's screen reader to announce the given message.
208//
209// This kind of notification is useful for messages that
210// either have only a visual representation or that are not
211// exposed visually at all, e.g. a notification about a
212// successful operation.
213//
214// Also, by using this API, you can ensure that the message
215// does not interrupts the user's current screen reader output.
216func (x *ColorDialogButton) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
217
218	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
219
220}
221
222// Retrieves the accessible parent for an accessible object.
223//
224// This function returns `NULL` for top level widgets.
225func (x *ColorDialogButton) GetAccessibleParent() *AccessibleBase {
226	var cls *AccessibleBase
227
228	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
229
230	if cret == 0 {
231		return nil
232	}
233	cls = &AccessibleBase{}
234	cls.Ptr = cret
235	return cls
236}
237
238// Retrieves the accessible role of an accessible object.
239func (x *ColorDialogButton) GetAccessibleRole() AccessibleRole {
240
241	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
242	return cret
243}
244
245// Retrieves the implementation for the given accessible object.
246func (x *ColorDialogButton) GetAtContext() *ATContext {
247	var cls *ATContext
248
249	cret := XGtkAccessibleGetAtContext(x.GoPointer())
250
251	if cret == 0 {
252		return nil
253	}
254	cls = &ATContext{}
255	cls.Ptr = cret
256	return cls
257}
258
259// Queries the coordinates and dimensions of this accessible
260//
261// This functionality can be overridden by `GtkAccessible`
262// implementations, e.g. to get the bounds from an ignored
263// child widget.
264func (x *ColorDialogButton) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
265
266	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
267	return cret
268}
269
270// Retrieves the first accessible child of an accessible object.
271func (x *ColorDialogButton) GetFirstAccessibleChild() *AccessibleBase {
272	var cls *AccessibleBase
273
274	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
275
276	if cret == 0 {
277		return nil
278	}
279	cls = &AccessibleBase{}
280	cls.Ptr = cret
281	return cls
282}
283
284// Retrieves the next accessible sibling of an accessible object
285func (x *ColorDialogButton) GetNextAccessibleSibling() *AccessibleBase {
286	var cls *AccessibleBase
287
288	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
289
290	if cret == 0 {
291		return nil
292	}
293	cls = &AccessibleBase{}
294	cls.Ptr = cret
295	return cls
296}
297
298// Queries a platform state, such as focus.
299//
300// This functionality can be overridden by `GtkAccessible`
301// implementations, e.g. to get platform state from an ignored
302// child widget, as is the case for `GtkText` wrappers.
303func (x *ColorDialogButton) GetPlatformState(StateVar AccessiblePlatformState) bool {
304
305	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
306	return cret
307}
308
309// Resets the accessible property to its default value.
310func (x *ColorDialogButton) ResetProperty(PropertyVar AccessibleProperty) {
311
312	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
313
314}
315
316// Resets the accessible relation to its default value.
317func (x *ColorDialogButton) ResetRelation(RelationVar AccessibleRelation) {
318
319	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
320
321}
322
323// Resets the accessible state to its default value.
324func (x *ColorDialogButton) ResetState(StateVar AccessibleState) {
325
326	XGtkAccessibleResetState(x.GoPointer(), StateVar)
327
328}
329
330// Sets the parent and sibling of an accessible object.
331//
332// This function is meant to be used by accessible implementations that are
333// not part of the widget hierarchy, and but act as a logical bridge between
334// widgets. For instance, if a widget creates an object that holds metadata
335// for each child, and you want that object to implement the `GtkAccessible`
336// interface, you will use this function to ensure that the parent of each
337// child widget is the metadata object, and the parent of each metadata
338// object is the container widget.
339func (x *ColorDialogButton) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
340
341	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
342
343}
344
345// Updates the next accessible sibling.
346//
347// That might be useful when a new child of a custom accessible
348// is created, and it needs to be linked to a previous child.
349func (x *ColorDialogButton) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
350
351	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
352
353}
354
355// Informs ATs that the platform state has changed.
356//
357// This function should be used by `GtkAccessible` implementations that
358// have a platform state but are not widgets. Widgets handle platform
359// states automatically.
360func (x *ColorDialogButton) UpdatePlatformState(StateVar AccessiblePlatformState) {
361
362	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
363
364}
365
366// Updates a list of accessible properties.
367//
368// See the [enum@Gtk.AccessibleProperty] documentation for the
369// value types of accessible properties.
370//
371// This function should be called by `GtkWidget` types whenever
372// an accessible property change must be communicated to assistive
373// technologies.
374//
375// Example:
376// ```c
377// value = gtk_adjustment_get_value (adjustment);
378// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
379//
380//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
381//	-1);
382//
383// ```
384func (x *ColorDialogButton) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
385
386	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
387
388}
389
390// Updates an array of accessible properties.
391//
392// This function should be called by `GtkWidget` types whenever an accessible
393// property change must be communicated to assistive technologies.
394//
395// This function is meant to be used by language bindings.
396func (x *ColorDialogButton) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
397
398	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
399
400}
401
402// Updates a list of accessible relations.
403//
404// This function should be called by `GtkWidget` types whenever an accessible
405// relation change must be communicated to assistive technologies.
406//
407// If the [enum@Gtk.AccessibleRelation] requires a list of references,
408// you should pass each reference individually, followed by `NULL`, e.g.
409//
410// ```c
411// gtk_accessible_update_relation (accessible,
412//
413//	GTK_ACCESSIBLE_RELATION_CONTROLS,
414//	  ref1, NULL,
415//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
416//	  ref1, ref2, ref3, NULL,
417//	-1);
418//
419// ```
420func (x *ColorDialogButton) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
421
422	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
423
424}
425
426// Updates an array of accessible relations.
427//
428// This function should be called by `GtkWidget` types whenever an accessible
429// relation change must be communicated to assistive technologies.
430//
431// This function is meant to be used by language bindings.
432func (x *ColorDialogButton) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
433
434	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
435
436}
437
438// Updates a list of accessible states.
439//
440// See the [enum@Gtk.AccessibleState] documentation for the
441// value types of accessible states.
442//
443// This function should be called by `GtkWidget` types whenever
444// an accessible state change must be communicated to assistive
445// technologies.
446//
447// Example:
448//
449// ```c
450// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
451// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
452//
453//	GTK_ACCESSIBLE_STATE_CHECKED, value,
454//	-1);
455//
456// ```
457func (x *ColorDialogButton) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
458
459	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
460
461}
462
463// Updates an array of accessible states.
464//
465// This function should be called by `GtkWidget` types whenever an accessible
466// state change must be communicated to assistive technologies.
467//
468// This function is meant to be used by language bindings.
469func (x *ColorDialogButton) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
470
471	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
472
473}
474
475// Gets the ID of the @buildable object.
476//
477// `GtkBuilder` sets the name based on the ID attribute
478// of the `<object>` tag used to construct the @buildable.
479func (x *ColorDialogButton) GetBuildableId() string {
480
481	cret := XGtkBuildableGetBuildableId(x.GoPointer())
482	return cret
483}
484
485func init() {
486	core.SetPackageName("GTK", "gtk4")
487	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
488	var libs []uintptr
489	for _, libPath := range core.GetPaths("GTK") {
490		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
491		if err != nil {
492			panic(err)
493		}
494		libs = append(libs, lib)
495	}
496
497	core.PuregoSafeRegister(&xColorDialogButtonGLibType, libs, "gtk_color_dialog_button_get_type")
498
499	core.PuregoSafeRegister(&xNewColorDialogButton, libs, "gtk_color_dialog_button_new")
500
501	core.PuregoSafeRegister(&xColorDialogButtonGetDialog, libs, "gtk_color_dialog_button_get_dialog")
502	core.PuregoSafeRegister(&xColorDialogButtonGetRgba, libs, "gtk_color_dialog_button_get_rgba")
503	core.PuregoSafeRegister(&xColorDialogButtonSetDialog, libs, "gtk_color_dialog_button_set_dialog")
504	core.PuregoSafeRegister(&xColorDialogButtonSetRgba, libs, "gtk_color_dialog_button_set_rgba")
505
506}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close