v0.2.2 9100209

gtkcolorchooserwidget.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"github.com/ebitengine/purego"
6
7	"github.com/bnema/puregotk/pkg/core"
8	"github.com/bnema/puregotk/v4/gdk"
9	"github.com/bnema/puregotk/v4/gobject"
10	"github.com/bnema/puregotk/v4/gobject/types"
11)
12
13// The `GtkColorChooserWidget` widget lets the user select a color.
14//
15// By default, the chooser presents a predefined palette of colors,
16// plus a small number of settable custom colors. It is also possible
17// to select a different color with the single-color editor.
18//
19// To enter the single-color editing mode, use the context menu of any
20// color of the palette, or use the '+' button to add a new custom color.
21//
22// The chooser automatically remembers the last selection, as well
23// as custom colors.
24//
25// To create a `GtkColorChooserWidget`, use [ctor@Gtk.ColorChooserWidget.new].
26//
27// To change the initially selected color, use
28// [method@Gtk.ColorChooser.set_rgba]. To get the selected color use
29// [method@Gtk.ColorChooser.get_rgba].
30//
31// The `GtkColorChooserWidget` is used in the [class@Gtk.ColorChooserDialog]
32// to provide a dialog for selecting colors.
33//
34// # Actions
35//
36// `GtkColorChooserWidget` defines a set of built-in actions:
37//
38//   - `color.customize` activates the color editor for the given color.
39//   - `color.select` emits the [signal@Gtk.ColorChooser::color-activated] signal
40//     for the given color.
41//
42// # CSS names
43//
44// `GtkColorChooserWidget` has a single CSS node with name colorchooser.
45type ColorChooserWidget struct {
46	Widget
47}
48
49var xColorChooserWidgetGLibType func() types.GType
50
51func ColorChooserWidgetGLibType() types.GType {
52	return xColorChooserWidgetGLibType()
53}
54
55func ColorChooserWidgetNewFromInternalPtr(ptr uintptr) *ColorChooserWidget {
56	cls := &ColorChooserWidget{}
57	cls.Ptr = ptr
58	return cls
59}
60
61var xNewColorChooserWidget func() uintptr
62
63// Creates a new `GtkColorChooserWidget`.
64func NewColorChooserWidget() *ColorChooserWidget {
65	var cls *ColorChooserWidget
66
67	cret := xNewColorChooserWidget()
68
69	if cret == 0 {
70		return nil
71	}
72	gobject.IncreaseRef(cret)
73	cls = &ColorChooserWidget{}
74	cls.Ptr = cret
75	return cls
76}
77
78func (c *ColorChooserWidget) GoPointer() uintptr {
79	if c == nil {
80		return 0
81	}
82	return c.Ptr
83}
84
85func (c *ColorChooserWidget) SetGoPointer(ptr uintptr) {
86	c.Ptr = ptr
87}
88
89// SetPropertyShowEditor sets the "show-editor" property.
90// %TRUE when the color chooser is showing the single-color editor.
91//
92// It can be set to switch the color chooser into single-color editing mode.
93func (x *ColorChooserWidget) SetPropertyShowEditor(value bool) {
94	var v gobject.Value
95	v.Init(gobject.TypeBooleanVal)
96	v.SetBoolean(value)
97	x.SetProperty("show-editor", &v)
98}
99
100// GetPropertyShowEditor gets the "show-editor" property.
101// %TRUE when the color chooser is showing the single-color editor.
102//
103// It can be set to switch the color chooser into single-color editing mode.
104func (x *ColorChooserWidget) GetPropertyShowEditor() bool {
105	var v gobject.Value
106	x.GetProperty("show-editor", &v)
107	return v.GetBoolean()
108}
109
110// Requests the user's screen reader to announce the given message.
111//
112// This kind of notification is useful for messages that
113// either have only a visual representation or that are not
114// exposed visually at all, e.g. a notification about a
115// successful operation.
116//
117// Also, by using this API, you can ensure that the message
118// does not interrupts the user's current screen reader output.
119func (x *ColorChooserWidget) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
120
121	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
122
123}
124
125// Retrieves the accessible parent for an accessible object.
126//
127// This function returns `NULL` for top level widgets.
128func (x *ColorChooserWidget) GetAccessibleParent() *AccessibleBase {
129	var cls *AccessibleBase
130
131	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
132
133	if cret == 0 {
134		return nil
135	}
136	cls = &AccessibleBase{}
137	cls.Ptr = cret
138	return cls
139}
140
141// Retrieves the accessible role of an accessible object.
142func (x *ColorChooserWidget) GetAccessibleRole() AccessibleRole {
143
144	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
145	return cret
146}
147
148// Retrieves the implementation for the given accessible object.
149func (x *ColorChooserWidget) GetAtContext() *ATContext {
150	var cls *ATContext
151
152	cret := XGtkAccessibleGetAtContext(x.GoPointer())
153
154	if cret == 0 {
155		return nil
156	}
157	cls = &ATContext{}
158	cls.Ptr = cret
159	return cls
160}
161
162// Queries the coordinates and dimensions of this accessible
163//
164// This functionality can be overridden by `GtkAccessible`
165// implementations, e.g. to get the bounds from an ignored
166// child widget.
167func (x *ColorChooserWidget) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
168
169	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
170	return cret
171}
172
173// Retrieves the first accessible child of an accessible object.
174func (x *ColorChooserWidget) GetFirstAccessibleChild() *AccessibleBase {
175	var cls *AccessibleBase
176
177	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
178
179	if cret == 0 {
180		return nil
181	}
182	cls = &AccessibleBase{}
183	cls.Ptr = cret
184	return cls
185}
186
187// Retrieves the next accessible sibling of an accessible object
188func (x *ColorChooserWidget) GetNextAccessibleSibling() *AccessibleBase {
189	var cls *AccessibleBase
190
191	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
192
193	if cret == 0 {
194		return nil
195	}
196	cls = &AccessibleBase{}
197	cls.Ptr = cret
198	return cls
199}
200
201// Queries a platform state, such as focus.
202//
203// This functionality can be overridden by `GtkAccessible`
204// implementations, e.g. to get platform state from an ignored
205// child widget, as is the case for `GtkText` wrappers.
206func (x *ColorChooserWidget) GetPlatformState(StateVar AccessiblePlatformState) bool {
207
208	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
209	return cret
210}
211
212// Resets the accessible property to its default value.
213func (x *ColorChooserWidget) ResetProperty(PropertyVar AccessibleProperty) {
214
215	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
216
217}
218
219// Resets the accessible relation to its default value.
220func (x *ColorChooserWidget) ResetRelation(RelationVar AccessibleRelation) {
221
222	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
223
224}
225
226// Resets the accessible state to its default value.
227func (x *ColorChooserWidget) ResetState(StateVar AccessibleState) {
228
229	XGtkAccessibleResetState(x.GoPointer(), StateVar)
230
231}
232
233// Sets the parent and sibling of an accessible object.
234//
235// This function is meant to be used by accessible implementations that are
236// not part of the widget hierarchy, and but act as a logical bridge between
237// widgets. For instance, if a widget creates an object that holds metadata
238// for each child, and you want that object to implement the `GtkAccessible`
239// interface, you will use this function to ensure that the parent of each
240// child widget is the metadata object, and the parent of each metadata
241// object is the container widget.
242func (x *ColorChooserWidget) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
243
244	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
245
246}
247
248// Updates the next accessible sibling.
249//
250// That might be useful when a new child of a custom accessible
251// is created, and it needs to be linked to a previous child.
252func (x *ColorChooserWidget) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
253
254	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
255
256}
257
258// Informs ATs that the platform state has changed.
259//
260// This function should be used by `GtkAccessible` implementations that
261// have a platform state but are not widgets. Widgets handle platform
262// states automatically.
263func (x *ColorChooserWidget) UpdatePlatformState(StateVar AccessiblePlatformState) {
264
265	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
266
267}
268
269// Updates a list of accessible properties.
270//
271// See the [enum@Gtk.AccessibleProperty] documentation for the
272// value types of accessible properties.
273//
274// This function should be called by `GtkWidget` types whenever
275// an accessible property change must be communicated to assistive
276// technologies.
277//
278// Example:
279// ```c
280// value = gtk_adjustment_get_value (adjustment);
281// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
282//
283//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
284//	-1);
285//
286// ```
287func (x *ColorChooserWidget) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
288
289	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
290
291}
292
293// Updates an array of accessible properties.
294//
295// This function should be called by `GtkWidget` types whenever an accessible
296// property change must be communicated to assistive technologies.
297//
298// This function is meant to be used by language bindings.
299func (x *ColorChooserWidget) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
300
301	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
302
303}
304
305// Updates a list of accessible relations.
306//
307// This function should be called by `GtkWidget` types whenever an accessible
308// relation change must be communicated to assistive technologies.
309//
310// If the [enum@Gtk.AccessibleRelation] requires a list of references,
311// you should pass each reference individually, followed by `NULL`, e.g.
312//
313// ```c
314// gtk_accessible_update_relation (accessible,
315//
316//	GTK_ACCESSIBLE_RELATION_CONTROLS,
317//	  ref1, NULL,
318//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
319//	  ref1, ref2, ref3, NULL,
320//	-1);
321//
322// ```
323func (x *ColorChooserWidget) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
324
325	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
326
327}
328
329// Updates an array of accessible relations.
330//
331// This function should be called by `GtkWidget` types whenever an accessible
332// relation change must be communicated to assistive technologies.
333//
334// This function is meant to be used by language bindings.
335func (x *ColorChooserWidget) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
336
337	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
338
339}
340
341// Updates a list of accessible states.
342//
343// See the [enum@Gtk.AccessibleState] documentation for the
344// value types of accessible states.
345//
346// This function should be called by `GtkWidget` types whenever
347// an accessible state change must be communicated to assistive
348// technologies.
349//
350// Example:
351//
352// ```c
353// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
354// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
355//
356//	GTK_ACCESSIBLE_STATE_CHECKED, value,
357//	-1);
358//
359// ```
360func (x *ColorChooserWidget) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
361
362	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
363
364}
365
366// Updates an array of accessible states.
367//
368// This function should be called by `GtkWidget` types whenever an accessible
369// state change must be communicated to assistive technologies.
370//
371// This function is meant to be used by language bindings.
372func (x *ColorChooserWidget) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
373
374	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
375
376}
377
378// Gets the ID of the @buildable object.
379//
380// `GtkBuilder` sets the name based on the ID attribute
381// of the `<object>` tag used to construct the @buildable.
382func (x *ColorChooserWidget) GetBuildableId() string {
383
384	cret := XGtkBuildableGetBuildableId(x.GoPointer())
385	return cret
386}
387
388// Adds a palette to the color chooser.
389//
390// If @orientation is horizontal, the colors are grouped in rows,
391// with @colors_per_line colors in each row. If @horizontal is %FALSE,
392// the colors are grouped in columns instead.
393//
394// The default color palette of [class@Gtk.ColorChooserWidget] has
395// 45 colors, organized in columns of 5 colors (this includes some
396// grays).
397//
398// The layout of the color chooser widget works best when the
399// palettes have 9-10 columns.
400//
401// Calling this function for the first time has the side effect
402// of removing the default color palette from the color chooser.
403//
404// If @colors is %NULL, removes all previously added palettes.
405func (x *ColorChooserWidget) AddPalette(OrientationVar Orientation, ColorsPerLineVar int, NColorsVar int, ColorsVar []gdk.RGBA) {
406
407	XGtkColorChooserAddPalette(x.GoPointer(), OrientationVar, ColorsPerLineVar, NColorsVar, ColorsVar)
408
409}
410
411// Gets the currently-selected color.
412func (x *ColorChooserWidget) GetRgba(ColorVar *gdk.RGBA) {
413
414	XGtkColorChooserGetRgba(x.GoPointer(), ColorVar)
415
416}
417
418// Returns whether the color chooser shows the alpha channel.
419func (x *ColorChooserWidget) GetUseAlpha() bool {
420
421	cret := XGtkColorChooserGetUseAlpha(x.GoPointer())
422	return cret
423}
424
425// Sets the color.
426func (x *ColorChooserWidget) SetRgba(ColorVar *gdk.RGBA) {
427
428	XGtkColorChooserSetRgba(x.GoPointer(), ColorVar)
429
430}
431
432// Sets whether or not the color chooser should use the alpha channel.
433func (x *ColorChooserWidget) SetUseAlpha(UseAlphaVar bool) {
434
435	XGtkColorChooserSetUseAlpha(x.GoPointer(), UseAlphaVar)
436
437}
438
439func init() {
440	core.SetPackageName("GTK", "gtk4")
441	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
442	var libs []uintptr
443	for _, libPath := range core.GetPaths("GTK") {
444		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
445		if err != nil {
446			panic(err)
447		}
448		libs = append(libs, lib)
449	}
450
451	core.PuregoSafeRegister(&xColorChooserWidgetGLibType, libs, "gtk_color_chooser_widget_get_type")
452
453	core.PuregoSafeRegister(&xNewColorChooserWidget, libs, "gtk_color_chooser_widget_new")
454
455}

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