gnomedesktop

package
v0.0.0-...-17bcd5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DESKTOP_PLATFORM_VERSION = 44
View Source
const RR_CONNECTOR_TYPE_PANEL = "Panel"

Variables

View Source
var (
	GTypeRRConfig     = coreglib.Type(C.gnome_rr_config_get_type())
	GTypeRROutputInfo = coreglib.Type(C.gnome_rr_output_info_get_type())
)

GType values.

GType values.

GType values.

View Source
var (
	GTypeBGCrossfade = coreglib.Type(C.gnome_bg_crossfade_get_type())
)

GType values.

View Source
var (
	GTypeBGSlideShow = coreglib.Type(C.gnome_bg_slide_show_get_type())
)

GType values.

View Source
var (
	GTypeDesktopThumbnailFactory = coreglib.Type(C.gnome_desktop_thumbnail_factory_get_type())
)

GType values.

View Source
var (
	GTypeIdleMonitor = coreglib.Type(C.gnome_idle_monitor_get_type())
)

GType values.

View Source
var (
	GTypePnpIDs = coreglib.Type(C.gnome_pnp_ids_get_type())
)

GType values.

View Source
var (
	GTypeRRDpmsModeType = coreglib.Type(C.gnome_rr_dpms_mode_get_type())
)

GType values.

View Source
var (
	GTypeWallClock = coreglib.Type(C.gnome_wall_clock_get_type())
)

GType values.

View Source
var (
	GTypeXkbInfo = coreglib.Type(C.gnome_xkb_info_get_type())
)

GType values.

Functions

func DesktopThumbnailIsValid

func DesktopThumbnailIsValid(pixbuf *gdkpixbuf.Pixbuf, uri string, mtime int32) bool

DesktopThumbnailIsValid returns whether the thumbnail has the correct uri and mtime embedded in the png options. This function is threadsafe and does no blocking I/O.

The function takes the following parameters:

  • pixbuf: loaded thumbnail Pixbuf.
  • uri: uri.
  • mtime: mtime.

The function returns the following values:

  • ok: TRUE if the thumbnail has the right uri and mtime.

func DesktopThumbnailPathForURI

func DesktopThumbnailPathForURI(uri string, size DesktopThumbnailSize) string

DesktopThumbnailPathForURI returns the filename that a thumbnail of size size for uri would have. This function is threadsafe and does no blocking I/O.

The function takes the following parameters:

  • uri: uri.
  • size: thumbnail size.

The function returns the following values:

  • utf8: absolute filename.

func GetAllLocales

func GetAllLocales() []string

GetAllLocales gets all locales.

The function returns the following values:

  • utf8s: a newly allocated NULL-terminated string array containing the all locales. Free with g_strfreev().

func GetCountryFromCode

func GetCountryFromCode(code, translation string) string

GetCountryFromCode gets the country name for code. If translation is provided the returned string is translated accordingly.

The function takes the following parameters:

  • code: ISO 3166 code string.
  • translation (optional): locale string.

The function returns the following values:

  • utf8: country name. Caller takes ownership.

func GetCountryFromLocale

func GetCountryFromLocale(locale, translation string) string

GetCountryFromLocale gets the country description for locale. If translation is provided the returned string is translated accordingly.

The function takes the following parameters:

  • locale string.
  • translation (optional): locale string.

The function returns the following values:

  • utf8: country description. Caller takes ownership.

func GetInputSourceFromLocale

func GetInputSourceFromLocale(locale string) (typ, id string, ok bool)

GetInputSourceFromLocale gets the default input source's type and identifier for a given locale.

The function takes the following parameters:

  • locale string.

The function returns the following values:

  • typ: location to store the input source type.
  • id: location to store the input source identifier.
  • ok: TRUE if a input source exists or FALSE otherwise.

func GetLanguageFromCode

func GetLanguageFromCode(code, translation string) string

GetLanguageFromCode gets the language name for code. If translation is provided the returned string is translated accordingly.

The function takes the following parameters:

  • code: ISO 639 code string.
  • translation (optional): locale string.

The function returns the following values:

  • utf8: language name. Caller takes ownership.

func GetLanguageFromLocale

func GetLanguageFromLocale(locale, translation string) string

GetLanguageFromLocale gets the language description for locale. If translation is provided the returned string is translated accordingly.

The function takes the following parameters:

  • locale string.
  • translation (optional): locale string.

The function returns the following values:

  • utf8: language description. Caller takes ownership.

func GetPlatformVersion

func GetPlatformVersion() int

GetPlatformVersion returns an integer with the major version of GNOME. Useful for dynamic languages like Javascript or Python (static languages like C should use GNOME_DESKTOP_PLATFORM_VERSION). If this function doesn't exist, it can be presumed that the GNOME platform version is 42 or previous.

The function returns the following values:

  • gint: integer with the major version of GNOME.

func GetTranslatedModifier

func GetTranslatedModifier(modifier, translation string) string

GetTranslatedModifier gets a translation of the raw modifier string. If translation is provided the returned string is translated accordingly.

The function takes the following parameters:

  • modifier part of a locale name.
  • translation (optional): locale string.

The function returns the following values:

  • utf8: translated modifier string. Caller takes ownership.

func LanguageHasTranslations

func LanguageHasTranslations(code string) bool

LanguageHasTranslations returns TRUE if there are translations for language code.

The function takes the following parameters:

  • code: ISO 639 code string.

The function returns the following values:

  • ok: TRUE if there are translations for language code.

func NormalizeLocale

func NormalizeLocale(locale string) string

NormalizeLocale gets the normalized locale string in the form [language[_country][.codeset][modifier]] for name.

The function takes the following parameters:

  • locale string.

The function returns the following values:

  • utf8: normalized locale string. Caller takes ownership.

func ParseLocale

func ParseLocale(locale string) (languageCodep, countryCodep, codesetp, modifierp string, ok bool)

ParseLocale extracts the various components of a locale string in XPG format. ([language[_country][.codeset][modifier]]). See http://en.wikipedia.org/wiki/Locale.

The function takes the following parameters:

  • locale string.

The function returns the following values:

  • languageCodep (optional): location to store the language code, or NULL.
  • countryCodep (optional): location to store the country code, or NULL.
  • codesetp (optional): location to store the codeset, or NULL.
  • modifierp (optional): location to store the modifier, or NULL.
  • ok: TRUE if parsing was successful.

func RrErrorQuark

func RrErrorQuark() glib.Quark

RrErrorQuark returns the #GQuark that will be used for #GError values returned by the GnomeRR API.

The function returns the following values:

  • quark used to identify errors coming from the GnomeRR API.

func StartSystemdScopeFinish

func StartSystemdScopeFinish(res gio.AsyncResulter) error

StartSystemdScopeFinish: finish an asynchronous operation to create a transient scope that was started with gnome_start_systemd_scope().

Note that a successful return code does not imply that a unit has been created. It solely means that no error condition was hit sending the request.

The function takes the following parameters:

  • res: Result.

Types

type BG

type BG struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewBG

func NewBG() *BG

The function returns the following values:

func (*BG) ChangesWithTime

func (bg *BG) ChangesWithTime() bool

The function returns the following values:

func (*BG) ConnectChanged

func (bg *BG) ConnectChanged(f func()) coreglib.SignalHandle

func (*BG) ConnectTransitioned

func (bg *BG) ConnectTransitioned(f func()) coreglib.SignalHandle

func (*BG) CreateFrameThumbnail

func (bg *BG) CreateFrameThumbnail(factory *DesktopThumbnailFactory, screen *gdk.Screen, destWidth, destHeight, frameNum int) *gdkpixbuf.Pixbuf

CreateFrameThumbnail creates a thumbnail for a certain frame, where 'frame' is somewhat vaguely defined as 'suitable point to show while single-stepping through the slideshow'.

The function takes the following parameters:

  • factory
  • screen
  • destWidth
  • destHeight
  • frameNum

The function returns the following values:

  • pixbuf: newly created thumbnail or or NULL if frame_num is out of bounds.

func (*BG) CreateSurface

func (bg *BG) CreateSurface(window gdk.Windower, width, height int) *cairo.Surface

CreateSurface: create a surface that can be set as background for window.

The function takes the following parameters:

  • window
  • width
  • height

The function returns the following values:

  • surface: NULL on error (e.g. out of X connections).

func (*BG) CreateThumbnail

func (bg *BG) CreateThumbnail(factory *DesktopThumbnailFactory, screen *gdk.Screen, destWidth, destHeight int) *gdkpixbuf.Pixbuf

The function takes the following parameters:

  • factory
  • screen
  • destWidth
  • destHeight

The function returns the following values:

  • pixbuf showing the background as a thumbnail.

func (*BG) Draw

func (bg *BG) Draw(dest *gdkpixbuf.Pixbuf)

The function takes the following parameters:

func (*BG) Filename

func (bg *BG) Filename() string

The function returns the following values:

func (*BG) HasMultipleSizes

func (bg *BG) HasMultipleSizes() bool

The function returns the following values:

func (*BG) ImageSize

func (bg *BG) ImageSize(factory *DesktopThumbnailFactory, bestWidth, bestHeight int, width, height *int) bool

The function takes the following parameters:

  • factory
  • bestWidth
  • bestHeight
  • width
  • height

The function returns the following values:

func (*BG) IsDark

func (bg *BG) IsDark(destWidth, destHeight int) bool

The function takes the following parameters:

  • destWidth
  • destHeight

The function returns the following values:

func (*BG) LoadFromPreferences

func (bg *BG) LoadFromPreferences(settings *gio.Settings)

The function takes the following parameters:

func (*BG) SaveToPreferences

func (bg *BG) SaveToPreferences(settings *gio.Settings)

The function takes the following parameters:

func (*BG) SetFilename

func (bg *BG) SetFilename(filename string)

The function takes the following parameters:

type BGCrossfade

type BGCrossfade struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewBGCrossfade

func NewBGCrossfade(width, height int) *BGCrossfade

NewBGCrossfade creates a new object to manage crossfading a window background between two #cairo_surface_ts.

The function takes the following parameters:

  • width of the crossfading window.
  • height of the crossfading window.

The function returns the following values:

  • bgCrossfade: new BGCrossfade.

func (*BGCrossfade) ConnectFinished

func (fade *BGCrossfade) ConnectFinished(f func(window *coreglib.Object)) coreglib.SignalHandle

ConnectFinished: when a crossfade finishes, window will have a copy of the end surface as its background, and this signal will get emitted.

func (*BGCrossfade) IsStarted

func (fade *BGCrossfade) IsStarted() bool

IsStarted: this function reveals whether or not fade is currently running on a window. See gnome_bg_crossfade_start() for information on how to initiate a crossfade.

The function returns the following values:

  • ok: TRUE if fading, or FALSE if not fading.

func (*BGCrossfade) SetEndSurface

func (fade *BGCrossfade) SetEndSurface(surface *cairo.Surface) bool

SetEndSurface: before initiating a crossfade with gnome_bg_crossfade_start() a start and end surface have to be set. This function sets the surface shown at the end of the crossfade effect.

The function takes the following parameters:

  • surface: cairo surface to fade to.

The function returns the following values:

  • ok: TRUE if successful, or FALSE if the surface could not be copied.

func (*BGCrossfade) SetStartSurface

func (fade *BGCrossfade) SetStartSurface(surface *cairo.Surface) bool

SetStartSurface: before initiating a crossfade with gnome_bg_crossfade_start() a start and end surface have to be set. This function sets the surface shown at the beginning of the crossfade effect.

The function takes the following parameters:

  • surface: cairo surface to fade from.

The function returns the following values:

  • ok: TRUE if successful, or FALSE if the surface could not be copied.

func (*BGCrossfade) Start

func (fade *BGCrossfade) Start(window gdk.Windower)

Start: this function initiates a quick crossfade between two surfaces on the background of window. Before initiating the crossfade both gnome_bg_crossfade_start() and gnome_bg_crossfade_end() need to be called. If animations are disabled, the crossfade is skipped, and the window background is set immediately to the end surface.

The function takes the following parameters:

  • window to draw crossfade on.

func (*BGCrossfade) Stop

func (fade *BGCrossfade) Stop()

Stop: this function stops any in progress crossfades that may be happening. It's harmless to call this function if fade is already stopped.

type BGCrossfadeClass

type BGCrossfadeClass struct {
	// contains filtered or unexported fields
}

BGCrossfadeClass: instance of this type is always passed by reference.

type BGCrossfadeOverrides

type BGCrossfadeOverrides struct {
	// The function takes the following parameters:
	//
	Finished func(window gdk.Windower)
}

BGCrossfadeOverrides contains methods that are overridable.

type BGSlideShow

type BGSlideShow struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewBGSlideShow

func NewBGSlideShow(filename string) *BGSlideShow

NewBGSlideShow creates a new object to manage a slide show. window background between two #cairo_surface_ts.

The function takes the following parameters:

  • filename of the slide show.

The function returns the following values:

  • bgSlideShow: new BGSlideShow.

func (*BGSlideShow) CurrentSlide

func (self *BGSlideShow) CurrentSlide(width, height int) (progress, duration float64, isFixed bool, file1, file2 string)

CurrentSlide returns the current slides progress.

The function takes the following parameters:

  • width: monitor width.
  • height: monitor height.

The function returns the following values:

  • progress (optional): slide progress.
  • duration (optional): slide duration.
  • isFixed (optional): if slide is fixed.
  • file1 (optional): first file in slide.
  • file2 (optional): second file in slide.

func (*BGSlideShow) HasMultipleSizes

func (self *BGSlideShow) HasMultipleSizes() bool

HasMultipleSizes gets whether or not the slide show has multiple sizes for different monitors.

The function returns the following values:

  • ok: TRUE if multiple sizes.

func (*BGSlideShow) Load

func (self *BGSlideShow) Load() error

Load tries to load the slide show.

func (*BGSlideShow) NumSlides

func (self *BGSlideShow) NumSlides() int

NumSlides returns number of slides in slide show.

The function returns the following values:

func (*BGSlideShow) Slide

func (self *BGSlideShow) Slide(frameNumber, width, height int) (progress, duration float64, isFixed bool, file1, file2 string, ok bool)

Slide retrieves slide by frame number.

The function takes the following parameters:

  • frameNumber: frame number.
  • width: monitor width.
  • height: monitor height.

The function returns the following values:

  • progress (optional): slide progress.
  • duration (optional): slide duration.
  • isFixed (optional): if slide is fixed.
  • file1 (optional): first file in slide.
  • file2 (optional): second file in slide.
  • ok: TRUE if successful.

func (*BGSlideShow) StartTime

func (self *BGSlideShow) StartTime() float64

StartTime gets the start time of the slide show.

The function returns the following values:

  • gdouble: timestamp.

func (*BGSlideShow) TotalDuration

func (self *BGSlideShow) TotalDuration() float64

TotalDuration gets the total duration of the slide show.

The function returns the following values:

  • gdouble: timestamp.

type BGSlideShowClass

type BGSlideShowClass struct {
	// contains filtered or unexported fields
}

BGSlideShowClass: instance of this type is always passed by reference.

type BGSlideShowOverrides

type BGSlideShowOverrides struct {
}

BGSlideShowOverrides contains methods that are overridable.

type DesktopThumbnailFactory

type DesktopThumbnailFactory struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewDesktopThumbnailFactory

func NewDesktopThumbnailFactory(size DesktopThumbnailSize) *DesktopThumbnailFactory

NewDesktopThumbnailFactory creates a new DesktopThumbnailFactory.

This function must be called on the main thread and is non-blocking.

The function takes the following parameters:

  • size: thumbnail size to use.

The function returns the following values:

  • desktopThumbnailFactory: new DesktopThumbnailFactory.

func (*DesktopThumbnailFactory) CanThumbnail

func (factory *DesktopThumbnailFactory) CanThumbnail(uri, mimeType string, mtime int32) bool

CanThumbnail returns TRUE if this GnomeDesktopThumbnailFactory can (at least try) to thumbnail this file. Thumbnails or files with failed thumbnails won't be thumbnailed.

Usage of this function is threadsafe and does blocking I/O.

The function takes the following parameters:

  • uri of a file.
  • mimeType: mime type of the file.
  • mtime of the file.

The function returns the following values:

  • ok: TRUE if the file can be thumbnailed.

func (*DesktopThumbnailFactory) CreateFailedThumbnail

func (factory *DesktopThumbnailFactory) CreateFailedThumbnail(ctx context.Context, uri string, mtime int32) error

CreateFailedThumbnail creates a failed thumbnail for the file so that we don't try to re-thumbnail the file later.

Usage of this function is threadsafe and does blocking I/O.

The function takes the following parameters:

  • ctx (optional): GCancellable object, or NULL.
  • uri of a file.
  • mtime: modification time of the file.

func (*DesktopThumbnailFactory) CreateFailedThumbnailFinish

func (factory *DesktopThumbnailFactory) CreateFailedThumbnailFinish(result gio.AsyncResulter) error

The function takes the following parameters:

  • result of the operation.

func (*DesktopThumbnailFactory) GenerateThumbnail

func (factory *DesktopThumbnailFactory) GenerateThumbnail(ctx context.Context, uri, mimeType string) (*gdkpixbuf.Pixbuf, error)

GenerateThumbnail tries to generate a thumbnail for the specified file. If it succeeds it returns a pixbuf that can be used as a thumbnail.

Usage of this function is threadsafe and does blocking I/O.

The function takes the following parameters:

  • ctx (optional) object or NULL.
  • uri of a file.
  • mimeType: mime type of the file.

The function returns the following values:

  • pixbuf: thumbnail pixbuf if thumbnailing succeeded, NULL otherwise and error will be set.

func (*DesktopThumbnailFactory) GenerateThumbnailFinish

func (factory *DesktopThumbnailFactory) GenerateThumbnailFinish(result gio.AsyncResulter) (*gdkpixbuf.Pixbuf, error)

The function takes the following parameters:

  • result of the operation.

The function returns the following values:

  • pixbuf: thumbnail pixbuf if thumbnailing succeeded, NULL otherwise.

    Since 43.0.

func (*DesktopThumbnailFactory) HasValidFailedThumbnail

func (factory *DesktopThumbnailFactory) HasValidFailedThumbnail(uri string, mtime int32) bool

HasValidFailedThumbnail tries to locate an failed thumbnail for the file specified. Writing and looking for failed thumbnails is important to avoid to try to thumbnail e.g. broken images several times.

Usage of this function is threadsafe and does blocking I/O.

The function takes the following parameters:

  • uri of a file.
  • mtime of the file.

The function returns the following values:

  • ok: TRUE if there is a failed thumbnail for the file.

func (*DesktopThumbnailFactory) Lookup

func (factory *DesktopThumbnailFactory) Lookup(uri string, mtime int32) string

Lookup tries to locate an existing thumbnail for the file specified.

Usage of this function is threadsafe and does blocking I/O.

The function takes the following parameters:

  • uri of a file.
  • mtime of the file.

The function returns the following values:

  • utf8: absolute path of the thumbnail, or NULL if none exist.

func (*DesktopThumbnailFactory) SaveThumbnail

func (factory *DesktopThumbnailFactory) SaveThumbnail(ctx context.Context, thumbnail *gdkpixbuf.Pixbuf, uri string, originalMtime int32) error

SaveThumbnail saves thumbnail at the right place. If the save fails a failed thumbnail is written.

Usage of this function is threadsafe and does blocking I/O.

The function takes the following parameters:

  • ctx (optional): GCancellable object, or NULL.
  • thumbnail as a pixbuf.
  • uri of a file.
  • originalMtime: modification time of the original file.

func (*DesktopThumbnailFactory) SaveThumbnailFinish

func (factory *DesktopThumbnailFactory) SaveThumbnailFinish(result gio.AsyncResulter) error

The function takes the following parameters:

  • result of the operation.

type DesktopThumbnailFactoryClass

type DesktopThumbnailFactoryClass struct {
	// contains filtered or unexported fields
}

DesktopThumbnailFactoryClass: instance of this type is always passed by reference.

type DesktopThumbnailFactoryOverrides

type DesktopThumbnailFactoryOverrides struct {
}

DesktopThumbnailFactoryOverrides contains methods that are overridable.

type DesktopThumbnailSize

type DesktopThumbnailSize C.gint
const (
	DesktopThumbnailSizeNormal DesktopThumbnailSize = iota
	DesktopThumbnailSizeLarge
	DesktopThumbnailSizeXlarge
	DesktopThumbnailSizeXxlarge
)

func (DesktopThumbnailSize) String

func (d DesktopThumbnailSize) String() string

String returns the name in string for DesktopThumbnailSize.

type IdleMonitor

type IdleMonitor struct {
	*coreglib.Object

	gio.Initable
	// contains filtered or unexported fields
}

func NewIdleMonitor

func NewIdleMonitor() *IdleMonitor

The function returns the following values:

  • idleMonitor: new IdleMonitor that tracks the server-global idletime for all devices.

func (*IdleMonitor) AddIdleWatch

func (monitor *IdleMonitor) AddIdleWatch(intervalMsec uint64, callback IdleMonitorWatchFunc) uint

The function takes the following parameters:

  • intervalMsec: idletime interval, in milliseconds. It must be a strictly positive value (> 0).
  • callback (optional) to call when the user has accumulated interval_msec milliseconds of idle time.

The function returns the following values:

  • guint: watch id

    Adds a watch for a specific idle time. The callback will be called when the user has accumulated interval_msec milliseconds of idle time. This function will return an ID that can either be passed to gnome_idle_monitor_remove_watch(), or can be used to tell idle time watches apart if you have more than one.

    Also note that this function will only care about positive transitions (user's idle time exceeding a certain time). If you want to know about when the user has become active, use gnome_idle_monitor_add_user_active_watch().

func (*IdleMonitor) AddUserActiveWatch

func (monitor *IdleMonitor) AddUserActiveWatch(callback IdleMonitorWatchFunc) uint

The function takes the following parameters:

  • callback (optional) to call when the user is active again.

The function returns the following values:

  • guint: watch id

    Add a one-time watch to know when the user is active again. Note that this watch is one-time and will de-activate after the function is called, for efficiency purposes. It's most convenient to call this when an idle watch, as added by gnome_idle_monitor_add_idle_watch(), has triggered.

func (*IdleMonitor) Idletime

func (monitor *IdleMonitor) Idletime() uint64

The function returns the following values:

  • guint64: current idle time, in milliseconds.

func (*IdleMonitor) RemoveWatch

func (monitor *IdleMonitor) RemoveWatch(id uint)

RemoveWatch removes an idle time watcher, previously added by gnome_idle_monitor_add_idle_watch() or gnome_idle_monitor_add_user_active_watch().

The function takes the following parameters:

  • id: watch ID.

type IdleMonitorClass

type IdleMonitorClass struct {
	// contains filtered or unexported fields
}

IdleMonitorClass: instance of this type is always passed by reference.

type IdleMonitorOverrides

type IdleMonitorOverrides struct {
}

IdleMonitorOverrides contains methods that are overridable.

type IdleMonitorWatchFunc

type IdleMonitorWatchFunc func(monitor *IdleMonitor, id uint)

type PnpIDs

type PnpIDs struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewPnpIDs

func NewPnpIDs() *PnpIDs

NewPnpIDs returns a reference to a PnpIds object, or creates a new one if none have been created.

The function returns the following values:

  • pnpIds PnpIds object.

func (*PnpIDs) PnpID

func (pnpIds *PnpIDs) PnpID(pnpId string) string

PnpID: find the full manufacturer name for the given PNP ID.

The function takes the following parameters:

  • pnpId: PNP ID to look for.

The function returns the following values:

  • utf8: new string representing the manufacturer name, or NULL when not found.

type PnpIDsClass

type PnpIDsClass struct {
	// contains filtered or unexported fields
}

PnpIDsClass: instance of this type is always passed by reference.

type PnpIDsOverrides

type PnpIDsOverrides struct {
}

PnpIDsOverrides contains methods that are overridable.

type RRCTM

type RRCTM struct {
	// contains filtered or unexported fields
}

RRCTM: instance of this type is always passed by reference.

func (*RRCTM) Matrix

func (r *RRCTM) Matrix() [9]uint64

type RRConfig

type RRConfig struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewRRConfigCurrent

func NewRRConfigCurrent(screen *RRScreen) (*RRConfig, error)

The function takes the following parameters:

The function returns the following values:

func (*RRConfig) Applicable

func (configuration *RRConfig) Applicable(screen *RRScreen) error

The function takes the following parameters:

func (*RRConfig) Apply

func (configuration *RRConfig) Apply(screen *RRScreen) error

The function takes the following parameters:

func (*RRConfig) ApplyPersistent

func (configuration *RRConfig) ApplyPersistent(screen *RRScreen) error

The function takes the following parameters:

func (*RRConfig) Clone

func (configuration *RRConfig) Clone() bool

The function returns the following values:

  • ok: whether at least two outputs are at (0, 0) offset and they have the same width/height. Those outputs are of course connected and on (i.e. they have a CRTC assigned).

func (*RRConfig) EnsurePrimary

func (configuration *RRConfig) EnsurePrimary() bool

The function returns the following values:

func (*RRConfig) Equal

func (config1 *RRConfig) Equal(config2 *RRConfig) bool

The function takes the following parameters:

The function returns the following values:

func (*RRConfig) LoadCurrent

func (self *RRConfig) LoadCurrent() error

func (*RRConfig) Match

func (config1 *RRConfig) Match(config2 *RRConfig) bool

The function takes the following parameters:

The function returns the following values:

func (*RRConfig) Outputs

func (configuration *RRConfig) Outputs() []*RROutputInfo

The function returns the following values:

  • rrOutputInfos: output configuration for this RRConfig.

func (*RRConfig) Sanitize

func (configuration *RRConfig) Sanitize()

func (*RRConfig) SetClone

func (configuration *RRConfig) SetClone(clone bool)

The function takes the following parameters:

type RRConfigClass

type RRConfigClass struct {
	// contains filtered or unexported fields
}

RRConfigClass: instance of this type is always passed by reference.

type RRConfigOverrides

type RRConfigOverrides struct {
}

RRConfigOverrides contains methods that are overridable.

type RRCrtc

type RRCrtc struct {
	// contains filtered or unexported fields
}

RRCrtc: instance of this type is always passed by reference.

func (*RRCrtc) CanDriveOutput

func (crtc *RRCrtc) CanDriveOutput(output *RROutput) bool

The function takes the following parameters:

The function returns the following values:

func (*RRCrtc) CurrentMode

func (crtc *RRCrtc) CurrentMode() *RRMode

The function returns the following values:

  • rrMode: current mode of this crtc.

func (*RRCrtc) CurrentRotation

func (crtc *RRCrtc) CurrentRotation() RRRotation

The function returns the following values:

func (*RRCrtc) Gamma

func (crtc *RRCrtc) Gamma(size *int) (red *uint16, green *uint16, blue *uint16, ok bool)

The function takes the following parameters:

The function returns the following values:

  • red: minimum width.
  • green: maximum width.
  • blue: minimum height.
  • ok: TRUE for success.

func (*RRCrtc) ID

func (crtc *RRCrtc) ID() uint32

The function returns the following values:

func (*RRCrtc) Position

func (crtc *RRCrtc) Position() (x int, y int)

The function returns the following values:

  • x (optional)
  • y (optional)

func (*RRCrtc) Rotations

func (crtc *RRCrtc) Rotations() RRRotation

The function returns the following values:

func (*RRCrtc) SetGamma

func (crtc *RRCrtc) SetGamma(size int, red *uint16, green *uint16, blue *uint16) bool

The function takes the following parameters:

  • size
  • red
  • green
  • blue

The function returns the following values:

func (*RRCrtc) SupportsRotation

func (crtc *RRCrtc) SupportsRotation(rotation RRRotation) bool

The function takes the following parameters:

The function returns the following values:

type RRDpmsMode

type RRDpmsMode C.gint
const (
	RrDpmsOn RRDpmsMode = iota
	RrDpmsStandby
	RrDpmsSuspend
	RrDpmsOff
	RrDpmsUnknown
)

func (RRDpmsMode) String

func (r RRDpmsMode) String() string

String returns the name in string for RRDpmsMode.

type RRDpmsModeType

type RRDpmsModeType C.gint
const (
	RrDpmsOn RRDpmsModeType = iota
	RrDpmsStandby
	RrDpmsSuspend
	RrDpmsOff
	RrDpmsUnknown
)

func (RRDpmsModeType) String

func (r RRDpmsModeType) String() string

String returns the name in string for RRDpmsModeType.

type RRError

type RRError C.gint
const (
	RrErrorUnknown RRError = iota
	RrErrorNoRandrExtension
	RrErrorRandrError
	RrErrorBoundsError
	RrErrorCrtcAssignment
	RrErrorNoMatchingConfig
	RrErrorNoDpmsExtension
)

func (RRError) String

func (r RRError) String() string

String returns the name in string for RRError.

type RRMode

type RRMode struct {
	// contains filtered or unexported fields
}

RRMode: instance of this type is always passed by reference.

func (*RRMode) Freq

func (mode *RRMode) Freq() int

The function returns the following values:

func (*RRMode) FreqF

func (mode *RRMode) FreqF() float64

The function returns the following values:

func (*RRMode) Height

func (mode *RRMode) Height() uint

The function returns the following values:

func (*RRMode) ID

func (mode *RRMode) ID() uint32

The function returns the following values:

func (*RRMode) IsInterlaced

func (mode *RRMode) IsInterlaced() bool

The function returns the following values:

func (*RRMode) IsTiled

func (mode *RRMode) IsTiled() bool

IsTiled returns TRUE if this mode is a tiled mode created for span a tiled monitor.

The function returns the following values:

func (*RRMode) Width

func (mode *RRMode) Width() uint

The function returns the following values:

type RROutput

type RROutput struct {
	// contains filtered or unexported fields
}

RROutput: instance of this type is always passed by reference.

func (*RROutput) Backlight

func (output *RROutput) Backlight() int

The function returns the following values:

  • gint: currently set backlight brightness.

func (*RROutput) CanClone

func (output *RROutput) CanClone(clone *RROutput) bool

The function takes the following parameters:

The function returns the following values:

func (*RROutput) Crtc

func (output *RROutput) Crtc() *RRCrtc

The function returns the following values:

func (*RROutput) CurrentMode

func (output *RROutput) CurrentMode() *RRMode

The function returns the following values:

  • rrMode: current mode of this output.

func (*RROutput) DisplayName

func (output *RROutput) DisplayName() string

The function returns the following values:

func (*RROutput) EdidData

func (output *RROutput) EdidData(size *uint) *byte

The function takes the following parameters:

The function returns the following values:

func (*RROutput) ID

func (output *RROutput) ID() uint32

The function returns the following values:

func (*RROutput) IDsFromEdid

func (output *RROutput) IDsFromEdid() (vendor string, product string, serial string)

The function returns the following values:

  • vendor (optional)
  • product (optional)
  • serial (optional)

func (*RROutput) IsBuiltinDisplay

func (output *RROutput) IsBuiltinDisplay() bool

The function returns the following values:

func (*RROutput) IsPrimary

func (output *RROutput) IsPrimary() bool

The function returns the following values:

func (*RROutput) IsUnderscanning

func (output *RROutput) IsUnderscanning() bool

The function returns the following values:

func (*RROutput) ListModes

func (output *RROutput) ListModes() []*RRMode

The function returns the following values:

func (*RROutput) MinBacklightStep

func (output *RROutput) MinBacklightStep() int

The function returns the following values:

  • gint: minimum backlight step available in percent.

func (*RROutput) Name

func (output *RROutput) Name() string

The function returns the following values:

func (*RROutput) PhysicalSize

func (output *RROutput) PhysicalSize() (widthMm int, heightMm int)

The function returns the following values:

  • widthMm (optional)
  • heightMm (optional)

func (*RROutput) Position

func (output *RROutput) Position() (x int, y int)

The function returns the following values:

  • x (optional)
  • y (optional)

func (*RROutput) PossibleCrtcs

func (output *RROutput) PossibleCrtcs() []*RRCrtc

The function returns the following values:

func (*RROutput) PreferredMode

func (output *RROutput) PreferredMode() *RRMode

The function returns the following values:

func (*RROutput) SetBacklight

func (output *RROutput) SetBacklight(value int) error

The function takes the following parameters:

  • value: absolute value which is 0 >= this <= 100.

func (*RROutput) SetColorTransform

func (output *RROutput) SetColorTransform(value *RRCTM) error

The function takes the following parameters:

func (*RROutput) SupportsColorTransform

func (output *RROutput) SupportsColorTransform() bool

The function returns the following values:

func (*RROutput) SupportsMode

func (output *RROutput) SupportsMode(mode *RRMode) bool

The function takes the following parameters:

The function returns the following values:

func (*RROutput) SupportsUnderscanning

func (output *RROutput) SupportsUnderscanning() bool

The function returns the following values:

type RROutputInfo

type RROutputInfo struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func (*RROutputInfo) AspectRatio

func (self *RROutputInfo) AspectRatio() float64

The function returns the following values:

func (*RROutputInfo) DisplayName

func (self *RROutputInfo) DisplayName() string

The function returns the following values:

  • utf8: display name of this output.

func (*RROutputInfo) Geometry

func (self *RROutputInfo) Geometry() (x, y, width, height int)

Geometry: get the geometry for the monitor connected to the specified output. If the monitor is a tiled monitor, it returns the geometry for the complete monitor.

The function returns the following values:

  • x (optional)
  • y (optional)
  • width (optional)
  • height (optional)

func (*RROutputInfo) IsActive

func (self *RROutputInfo) IsActive() bool

The function returns the following values:

  • ok: whether there is a CRTC assigned to this output (i.e. a signal is being sent to it).

func (*RROutputInfo) IsConnected

func (self *RROutputInfo) IsConnected() bool

The function returns the following values:

  • ok: whether the output is physically connected to a monitor.

func (*RROutputInfo) IsPrimaryTile

func (self *RROutputInfo) IsPrimaryTile() bool

The function returns the following values:

  • ok: TRUE if the specified output is connected to the primary tile of a monitor or to an untiled monitor, FALSE if the output is connected to a secondary tile.

func (*RROutputInfo) Name

func (self *RROutputInfo) Name() string

The function returns the following values:

  • utf8: output name.

func (*RROutputInfo) PreferredHeight

func (self *RROutputInfo) PreferredHeight() int

The function returns the following values:

func (*RROutputInfo) PreferredWidth

func (self *RROutputInfo) PreferredWidth() int

The function returns the following values:

func (*RROutputInfo) Primary

func (self *RROutputInfo) Primary() bool

The function returns the following values:

func (*RROutputInfo) Product

func (self *RROutputInfo) Product() string

The function returns the following values:

func (*RROutputInfo) RefreshRate

func (self *RROutputInfo) RefreshRate() int

The function returns the following values:

func (*RROutputInfo) Rotation

func (self *RROutputInfo) Rotation() RRRotation

The function returns the following values:

func (*RROutputInfo) Serial

func (self *RROutputInfo) Serial() string

The function returns the following values:

func (*RROutputInfo) SetActive

func (self *RROutputInfo) SetActive(active bool)

The function takes the following parameters:

func (*RROutputInfo) SetGeometry

func (self *RROutputInfo) SetGeometry(x, y, width, height int)

SetGeometry: set the geometry for the monitor connected to the specified output. If the monitor is a tiled monitor, it sets the geometry for the complete monitor.

The function takes the following parameters:

  • x offset for monitor.
  • y offset for monitor.
  • width: monitor width.
  • height: monitor height.

func (*RROutputInfo) SetPrimary

func (self *RROutputInfo) SetPrimary(primary bool)

The function takes the following parameters:

func (*RROutputInfo) SetRefreshRate

func (self *RROutputInfo) SetRefreshRate(rate int)

The function takes the following parameters:

func (*RROutputInfo) SetRotation

func (self *RROutputInfo) SetRotation(rotation RRRotation)

The function takes the following parameters:

func (*RROutputInfo) SetUnderscanning

func (self *RROutputInfo) SetUnderscanning(underscanning bool)

The function takes the following parameters:

func (*RROutputInfo) SupportsRotation

func (self *RROutputInfo) SupportsRotation(rotation RRRotation) bool

The function takes the following parameters:

The function returns the following values:

func (*RROutputInfo) Underscanning

func (self *RROutputInfo) Underscanning() bool

The function returns the following values:

func (*RROutputInfo) Vendor

func (self *RROutputInfo) Vendor() string

The function returns the following values:

type RROutputInfoClass

type RROutputInfoClass struct {
	// contains filtered or unexported fields
}

RROutputInfoClass: instance of this type is always passed by reference.

type RROutputInfoOverrides

type RROutputInfoOverrides struct {
}

RROutputInfoOverrides contains methods that are overridable.

type RRRotation

type RRRotation C.guint
const (
	RrRotationNext RRRotation = 0b0
	RrRotation0    RRRotation = 0b1
	RrRotation90   RRRotation = 0b10
	RrRotation180  RRRotation = 0b100
	RrRotation270  RRRotation = 0b1000
	RrReflectX     RRRotation = 0b10000
	RrReflectY     RRRotation = 0b100000
)

func (RRRotation) Has

func (r RRRotation) Has(other RRRotation) bool

Has returns true if r contains other.

func (RRRotation) String

func (r RRRotation) String() string

String returns the names in string for RRRotation.

type RRScreen

type RRScreen struct {
	*coreglib.Object

	gio.AsyncInitable
	gio.Initable
	// contains filtered or unexported fields
}

func NewRRScreen

func NewRRScreen(screen *gdk.Screen) (*RRScreen, error)

NewRRScreen creates a unique RRScreen instance for the specified screen.

The function takes the following parameters:

  • screen on which to operate.

The function returns the following values:

  • rrScreen: unique RRScreen instance, specific to the screen, or NULL if this could not be created, for instance if the driver does not support Xrandr 1.2. Each Screen thus has a single instance of RRScreen.

func NewRRScreenFinish

func NewRRScreenFinish(result gio.AsyncResulter) (*RRScreen, error)

The function takes the following parameters:

The function returns the following values:

func (*RRScreen) ConnectChanged

func (screen *RRScreen) ConnectChanged(f func()) coreglib.SignalHandle

func (*RRScreen) ConnectOutputConnected

func (screen *RRScreen) ConnectOutputConnected(f func(output unsafe.Pointer)) coreglib.SignalHandle

ConnectOutputConnected: this signal is emitted when a display device is connected to a port, or a port is hotplugged with an active output. The latter can happen if a laptop is docked, and the dock provides a new active output.

The output value is not a #GObject. The returned output value can only assume to be valid during the emission of the signal (i.e. within your signal handler only), as it may change later when the screen is modified due to an event from the X server, or due to another place in the application modifying the screen and the output. Therefore, deal with changes to the output right in your signal handler, instead of keeping the output reference for an async or idle function.

func (*RRScreen) ConnectOutputDisconnected

func (screen *RRScreen) ConnectOutputDisconnected(f func(output unsafe.Pointer)) coreglib.SignalHandle

ConnectOutputDisconnected: this signal is emitted when a display device is disconnected from a port, or a port output is hot-unplugged. The latter can happen if a laptop is undocked, and the dock provided the output.

The output value is not a #GObject. The returned output value can only assume to be valid during the emission of the signal (i.e. within your signal handler only), as it may change later when the screen is modified due to an event from the X server, or due to another place in the application modifying the screen and the output. Therefore, deal with changes to the output right in your signal handler, instead of keeping the output reference for an async or idle function.

func (*RRScreen) CrtcByID

func (screen *RRScreen) CrtcByID(id uint32) *RRCrtc

The function takes the following parameters:

The function returns the following values:

  • rrCrtc: CRTC identified by id.

func (*RRScreen) DpmsMode

func (screen *RRScreen) DpmsMode() (RRDpmsMode, error)

The function returns the following values:

  • mode: current RRDpmsMode of this screen.

func (*RRScreen) ListCloneModes

func (screen *RRScreen) ListCloneModes() []*RRMode

ListCloneModes: list available XRandR clone modes.

The function returns the following values:

func (*RRScreen) ListCrtcs

func (screen *RRScreen) ListCrtcs() []*RRCrtc

ListCrtcs: list all CRTCs.

The function returns the following values:

func (*RRScreen) ListModes

func (screen *RRScreen) ListModes() []*RRMode

ListModes: list available XRandR modes.

The function returns the following values:

func (*RRScreen) ListOutputs

func (screen *RRScreen) ListOutputs() []*RROutput

ListOutputs: list all outputs.

The function returns the following values:

func (*RRScreen) OutputByID

func (screen *RRScreen) OutputByID(id uint32) *RROutput

The function takes the following parameters:

The function returns the following values:

  • rrOutput: output identified by id.

func (*RRScreen) OutputByName

func (screen *RRScreen) OutputByName(name string) *RROutput

The function takes the following parameters:

The function returns the following values:

  • rrOutput: output identified by name.

func (*RRScreen) Ranges

func (screen *RRScreen) Ranges() (minWidth, maxWidth, minHeight, maxHeight int)

Ranges: get the ranges of the screen.

The function returns the following values:

  • minWidth: minimum width.
  • maxWidth: maximum width.
  • minHeight: minimum height.
  • maxHeight: maximum height.

func (*RRScreen) Refresh

func (screen *RRScreen) Refresh() error

Refresh refreshes the screen configuration, and calls the screen's callback if it exists and if the screen's configuration changed.

func (*RRScreen) SetDpmsMode

func (screen *RRScreen) SetDpmsMode(mode RRDpmsMode) error

SetDpmsMode: this method also disables the DPMS timeouts.

The function takes the following parameters:

type RRScreenClass

type RRScreenClass struct {
	// contains filtered or unexported fields
}

RRScreenClass: instance of this type is always passed by reference.

type RRScreenOverrides

type RRScreenOverrides struct {
	Changed func()
	// The function takes the following parameters:
	//
	OutputConnected func(output *RROutput)
	// The function takes the following parameters:
	//
	OutputDisconnected func(output *RROutput)
}

RRScreenOverrides contains methods that are overridable.

type WallClock

type WallClock struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewWallClock

func NewWallClock() *WallClock

NewWallClock creates a new WallClock.

The function returns the following values:

  • wallClock: new clock.

func (*WallClock) Clock

func (clock *WallClock) Clock() string

Clock returns the string representing the current time of this clock according to the user settings.

The function returns the following values:

  • utf8: time of the clock as a string. This string points to internally allocated storage and must not be freed, modified or stored.

func (*WallClock) Timezone

func (clock *WallClock) Timezone() *glib.TimeZone

Timezone returns the current local time zone used by this clock.

The function returns the following values:

  • timeZone of the clock.

type WallClockClass

type WallClockClass struct {
	// contains filtered or unexported fields
}

WallClockClass: instance of this type is always passed by reference.

type WallClockOverrides

type WallClockOverrides struct {
}

WallClockOverrides contains methods that are overridable.

type XkbInfo

type XkbInfo struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func NewXkbInfo

func NewXkbInfo() *XkbInfo

The function returns the following values:

  • xkbInfo: new XkbInfo instance.

func (*XkbInfo) AllLayouts

func (self *XkbInfo) AllLayouts() []string

AllLayouts returns a list of all layout identifiers we know about.

The function returns the following values:

  • list: list of layout names. The caller takes ownership of the #GList but not of the strings themselves, those are internally allocated and must not be modified.

func (*XkbInfo) AllOptionGroups

func (self *XkbInfo) AllOptionGroups() []string

AllOptionGroups returns a list of all option group identifiers we know about.

The function returns the following values:

  • list: list of option group ids. The caller takes ownership of the #GList but not of the strings themselves, those are internally allocated and must not be modified.

func (*XkbInfo) ConnectLayoutsChanged

func (self *XkbInfo) ConnectLayoutsChanged(f func()) coreglib.SignalHandle

func (*XkbInfo) DescriptionForGroup

func (self *XkbInfo) DescriptionForGroup(groupId string) string

The function takes the following parameters:

  • groupId: identifier for group.

The function returns the following values:

  • utf8: translated description for the group group_id.

func (*XkbInfo) DescriptionForOption

func (self *XkbInfo) DescriptionForOption(groupId, id string) string

The function takes the following parameters:

  • groupId: identifier for group containing the option.
  • id: option identifier.

The function returns the following values:

  • utf8: translated description for the option id.

func (*XkbInfo) LanguagesForLayout

func (self *XkbInfo) LanguagesForLayout(layoutId string) []string

LanguagesForLayout returns a list of all languages supported by a layout, given by layout_id.

The function takes the following parameters:

  • layoutId: layout identifier.

The function returns the following values:

  • list of ISO 639 code strings. The caller takes ownership of the #GList but not of the strings themselves, those are internally allocated and must not be modified.

func (*XkbInfo) LayoutInfo

func (self *XkbInfo) LayoutInfo(id string) (displayName, shortName, xkbLayout, xkbVariant string, ok bool)

LayoutInfo retrieves information about a layout. Both display_name and short_name are suitable to show in UIs and might be localized if translations are available.

Some layouts don't provide a short name (2 or 3 letters) or don't specify a XKB variant, in those cases short_name or xkb_variant are empty strings, i.e. "".

If the given layout doesn't exist the return value is FALSE and all the (out) parameters are set to NULL.

The function takes the following parameters:

  • id layout's identifier about which to retrieve the info.

The function returns the following values:

  • displayName (optional): location to store the layout's display name, or NULL.
  • shortName (optional): location to store the layout's short name, or NULL.
  • xkbLayout (optional): location to store the layout's XKB name, or NULL.
  • xkbVariant (optional): location to store the layout's XKB variant, or NULL.
  • ok: TRUE if the layout exists or FALSE otherwise.

func (*XkbInfo) LayoutsForCountry

func (self *XkbInfo) LayoutsForCountry(countryCode string) []string

LayoutsForCountry returns a list of all layout identifiers we know about for country_code.

The function takes the following parameters:

  • countryCode: ISO 3166 code string.

The function returns the following values:

  • list: list of layout ids. The caller takes ownership of the #GList but not of the strings themselves, those are internally allocated and must not be modified.

func (*XkbInfo) LayoutsForLanguage

func (self *XkbInfo) LayoutsForLanguage(languageCode string) []string

LayoutsForLanguage returns a list of all layout identifiers we know about for language_code.

The function takes the following parameters:

  • languageCode: ISO 639 code string.

The function returns the following values:

  • list: list of layout ids. The caller takes ownership of the #GList but not of the strings themselves, those are internally allocated and must not be modified.

func (*XkbInfo) OptionsForGroup

func (self *XkbInfo) OptionsForGroup(groupId string) []string

OptionsForGroup returns a list of all option identifiers we know about for group group_id.

The function takes the following parameters:

  • groupId group's identifier about which to retrieve the options.

The function returns the following values:

  • list: list of option ids. The caller takes ownership of the #GList but not of the strings themselves, those are internally allocated and must not be modified.

type XkbInfoClass

type XkbInfoClass struct {
	// contains filtered or unexported fields
}

XkbInfoClass: instance of this type is always passed by reference.

type XkbInfoOverrides

type XkbInfoOverrides struct {
}

XkbInfoOverrides contains methods that are overridable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL