gnomerr

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CONNECTOR_TYPE_PANEL = "Panel"

Variables

GType values.

GType values.

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

GType values.

GType values.

GType values.

Functions

func ErrorQuark

func ErrorQuark() glib.Quark

ErrorQuark returns the error domain used by the GnomeRR API.

The function returns the following values:

  • quark: gnomeRR error domain.

Types

type CTM

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

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

type Config

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

func NewConfigCurrent

func NewConfigCurrent(screen *Screen) (*Config, error)

The function takes the following parameters:

The function returns the following values:

func (*Config) Applicable

func (self *Config) Applicable(screen *Screen) error

The function takes the following parameters:

func (*Config) Apply

func (self *Config) Apply(screen *Screen) error

The function takes the following parameters:

func (*Config) ApplyPersistent

func (self *Config) ApplyPersistent(screen *Screen) error

The function takes the following parameters:

func (*Config) Clone

func (self *Config) 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 (*Config) EnsurePrimary

func (self *Config) EnsurePrimary() bool

The function returns the following values:

func (*Config) Equal

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

The function takes the following parameters:

The function returns the following values:

func (*Config) LoadCurrent

func (self *Config) LoadCurrent() error

func (*Config) Match

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

The function takes the following parameters:

The function returns the following values:

func (*Config) Outputs

func (self *Config) Outputs() []*OutputInfo

The function returns the following values:

  • outputInfos: output configuration for this RRConfig.

func (*Config) Sanitize

func (self *Config) Sanitize()

func (*Config) SetClone

func (self *Config) SetClone(clone bool)

The function takes the following parameters:

type ConfigClass

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

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

type ConfigOverrides

type ConfigOverrides struct {
}

ConfigOverrides contains methods that are overridable.

type Crtc

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

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

func (*Crtc) CanDriveOutput

func (crtc *Crtc) CanDriveOutput(output *Output) bool

The function takes the following parameters:

The function returns the following values:

func (*Crtc) CurrentMode

func (crtc *Crtc) CurrentMode() *Mode

The function returns the following values:

  • mode: current mode of this crtc.

func (*Crtc) CurrentRotation

func (crtc *Crtc) CurrentRotation() Rotation

The function returns the following values:

func (*Crtc) Gamma

func (crtc *Crtc) 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 (*Crtc) ID

func (crtc *Crtc) ID() uint32

The function returns the following values:

func (*Crtc) Position

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

The function returns the following values:

  • x (optional)
  • y (optional)

func (*Crtc) Rotations

func (crtc *Crtc) Rotations() Rotation

The function returns the following values:

func (*Crtc) SetGamma

func (crtc *Crtc) 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 (*Crtc) SupportsRotation

func (crtc *Crtc) SupportsRotation(rotation Rotation) bool

The function takes the following parameters:

The function returns the following values:

type DpmsMode

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

func (DpmsMode) String

func (d DpmsMode) String() string

String returns the name in string for DpmsMode.

type DpmsModeType

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

func (DpmsModeType) String

func (d DpmsModeType) String() string

String returns the name in string for DpmsModeType.

type Error

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

func (Error) String

func (e Error) String() string

String returns the name in string for Error.

type Mode

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

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

func (*Mode) Freq

func (mode *Mode) Freq() int

The function returns the following values:

func (*Mode) FreqF

func (mode *Mode) FreqF() float64

The function returns the following values:

func (*Mode) Height

func (mode *Mode) Height() uint

The function returns the following values:

func (*Mode) ID

func (mode *Mode) ID() uint32

The function returns the following values:

func (*Mode) IsInterlaced

func (mode *Mode) IsInterlaced() bool

The function returns the following values:

func (*Mode) IsTiled

func (mode *Mode) 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 (*Mode) Width

func (mode *Mode) Width() uint

The function returns the following values:

type Output

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

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

func (*Output) Backlight

func (output *Output) Backlight() int

Backlight retrieves the backlight brightness of the given output.

The function returns the following values:

  • gint: currently set backlight brightness.

func (*Output) CanClone

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

CanClone checks whether the given output can clone another output.

The function takes the following parameters:

  • clone: output to compare.

The function returns the following values:

  • ok: TRUE if the output can clone another output.

func (*Output) Crtc

func (output *Output) Crtc() *Crtc

Crtc retrieves the CRTC of the given output.

The function returns the following values:

  • crtc: CRTC of the output.

func (*Output) CurrentMode

func (output *Output) CurrentMode() *Mode

CurrentMode retrieves the current mode of the given output.

The function returns the following values:

  • mode: current mode of this output.

func (*Output) DisplayName

func (output *Output) DisplayName() string

DisplayName retrieves the display name of the given output.

The function returns the following values:

  • utf8: display name.

func (*Output) EdidData

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

The function takes the following parameters:

The function returns the following values:

func (*Output) ID

func (output *Output) ID() uint32

The function returns the following values:

func (*Output) IDsFromEdid

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

IDsFromEdid retrieves the model identifiers from the EDID of the given output.

The function returns the following values:

  • vendor (optional) output's vendor string.
  • product (optional) output's product string.
  • serial (optional) output's serial string.

func (*Output) IsBuiltinDisplay

func (output *Output) IsBuiltinDisplay() bool

IsBuiltinDisplay checks whether the given output is a built-in display.

The function returns the following values:

  • ok: TRUE if the output is a built-in display.

func (*Output) IsPrimary

func (output *Output) IsPrimary() bool

IsPrimary checks whether the given output is the primary output.

The function returns the following values:

  • ok: TRUE if the output is the primary one.

func (*Output) IsUnderscanning

func (output *Output) IsUnderscanning() bool

The function returns the following values:

func (*Output) ListModes

func (output *Output) ListModes() []*Mode

ListModes retrieves all available modes of the given output.

The function returns the following values:

  • modes: list of modes.

func (*Output) MinBacklightStep

func (output *Output) MinBacklightStep() int

MinBacklightStep retrieves the value of the minimum backlight step for the given output, as a percentage.

The function returns the following values:

  • gint: minimum backlight step available in percent.

func (*Output) Name

func (output *Output) Name() string

Name retrieves the name of the given output.

The function returns the following values:

  • utf8: name of the output.

func (*Output) PhysicalSize

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

PhysicalSize retrieves the physical size of the given output.

The function returns the following values:

  • widthMm (optional): width of the output, in millimeters.
  • heightMm (optional): height of the output, in millimeters.

func (*Output) Position

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

The function returns the following values:

  • x (optional): x coordinate of the output.
  • y (optional): y coordinate of the output.

func (*Output) PossibleCrtcs

func (output *Output) PossibleCrtcs() []*Crtc

PossibleCrtcs retrieves all the possible CRTC for the given output.

The function returns the following values:

  • crtcs: list of possible CRTC.

func (*Output) PreferredMode

func (output *Output) PreferredMode() *Mode

PreferredMode retrieves the preferred mode of the given output.

The function returns the following values:

  • mode: preferred mode of the output.

func (*Output) SetBacklight

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

SetBacklight sets the backlight level for the given output.

The value is a percentage, with a range of [0, 100].

The function takes the following parameters:

  • value: absolute value of the backlight.

func (*Output) SetColorTransform

func (output *Output) SetColorTransform(ctm *CTM) error

SetColorTransform sets the color transformation matrix for the given output.

The function takes the following parameters:

  • ctm: color transformation matrix.

func (*Output) SupportsColorTransform

func (output *Output) SupportsColorTransform() bool

The function returns the following values:

func (*Output) SupportsMode

func (output *Output) SupportsMode(mode *Mode) bool

SupportsMode checks whether the given output supports a mode.

The function takes the following parameters:

  • mode to compare.

The function returns the following values:

  • ok: TRUE if the mode is supported.

func (*Output) SupportsUnderscanning

func (output *Output) SupportsUnderscanning() bool

The function returns the following values:

type OutputInfo

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

OutputInfo: representation of an output, which can be used for querying and setting display state.

func (*OutputInfo) AspectRatio

func (self *OutputInfo) AspectRatio() float64

The function returns the following values:

func (*OutputInfo) DisplayName

func (self *OutputInfo) DisplayName() string

The function returns the following values:

  • utf8: display name of this output.

func (*OutputInfo) Geometry

func (self *OutputInfo) 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 (*OutputInfo) IsActive

func (self *OutputInfo) 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 (*OutputInfo) IsConnected

func (self *OutputInfo) IsConnected() bool

The function returns the following values:

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

func (*OutputInfo) IsPrimaryTile

func (self *OutputInfo) 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 (*OutputInfo) Name

func (self *OutputInfo) Name() string

Name retrieves the output name.

The function returns the following values:

  • utf8: output name.

func (*OutputInfo) PreferredHeight

func (self *OutputInfo) PreferredHeight() int

The function returns the following values:

func (*OutputInfo) PreferredWidth

func (self *OutputInfo) PreferredWidth() int

The function returns the following values:

func (*OutputInfo) Primary

func (self *OutputInfo) Primary() bool

The function returns the following values:

func (*OutputInfo) Product

func (self *OutputInfo) Product() string

The function returns the following values:

func (*OutputInfo) RefreshRate

func (self *OutputInfo) RefreshRate() int

The function returns the following values:

func (*OutputInfo) Rotation

func (self *OutputInfo) Rotation() Rotation

The function returns the following values:

func (*OutputInfo) Serial

func (self *OutputInfo) Serial() string

The function returns the following values:

func (*OutputInfo) SetActive

func (self *OutputInfo) SetActive(active bool)

The function takes the following parameters:

func (*OutputInfo) SetGeometry

func (self *OutputInfo) 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 (*OutputInfo) SetPrimary

func (self *OutputInfo) SetPrimary(primary bool)

The function takes the following parameters:

func (*OutputInfo) SetRefreshRate

func (self *OutputInfo) SetRefreshRate(rate int)

The function takes the following parameters:

func (*OutputInfo) SetRotation

func (self *OutputInfo) SetRotation(rotation Rotation)

The function takes the following parameters:

func (*OutputInfo) SetUnderscanning

func (self *OutputInfo) SetUnderscanning(underscanning bool)

The function takes the following parameters:

func (*OutputInfo) SupportsRotation

func (self *OutputInfo) SupportsRotation(rotation Rotation) bool

The function takes the following parameters:

The function returns the following values:

func (*OutputInfo) Underscanning

func (self *OutputInfo) Underscanning() bool

The function returns the following values:

func (*OutputInfo) Vendor

func (self *OutputInfo) Vendor() string

The function returns the following values:

  • utf8 output's vendor string.

type OutputInfoClass

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

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

type OutputInfoOverrides

type OutputInfoOverrides struct {
}

OutputInfoOverrides contains methods that are overridable.

type Rotation

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

func (Rotation) Has

func (r Rotation) Has(other Rotation) bool

Has returns true if r contains other.

func (Rotation) String

func (r Rotation) String() string

String returns the names in string for Rotation.

type Screen

type Screen struct {
	*coreglib.Object

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

func NewScreen

func NewScreen(display *gdk.Display) (*Screen, error)

NewScreen creates a unique RRScreen instance for the specified display.

The function takes the following parameters:

  • display: windowing system connection used to query the display data.

The function returns the following values:

  • screen: 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 Display thus has a single instance of RRScreen.

func NewScreenFinish

func NewScreenFinish(result gio.AsyncResulter) (*Screen, error)

NewScreenFinish finishes the asynchronous creation of a new RRScreen instance.

The function takes the following parameters:

  • result of the asynchronous operation.

The function returns the following values:

  • screen: newly created instance; on error, this function will return NULL and set the given #GError.

func (*Screen) ConnectChanged

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

func (*Screen) ConnectOutputConnected

func (screen *Screen) ConnectOutputConnected(f func(output *Output)) 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 (*Screen) ConnectOutputDisconnected

func (screen *Screen) ConnectOutputDisconnected(f func(output *Output)) 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 (*Screen) CrtcByID

func (screen *Screen) CrtcByID(id uint32) *Crtc

CrtcByID retrieves the CRTC of the screen using the given identifier.

The function takes the following parameters:

  • id: identifier of a CRTC.

The function returns the following values:

  • crtc: CRTC identified by id.

func (*Screen) DpmsMode

func (screen *Screen) DpmsMode() (DpmsMode, error)

The function returns the following values:

  • mode: current RRDpmsMode of this screen.

func (*Screen) ListCloneModes

func (screen *Screen) ListCloneModes() []*Mode

ListCloneModes lists all available XRandR clone modes.

The function returns the following values:

  • modes: available XRandR clone modes.

func (*Screen) ListCrtcs

func (screen *Screen) ListCrtcs() []*Crtc

ListCrtcs: list all CRTCs of the given screen.

The function returns the following values:

  • crtcs: available CRTCs.

func (*Screen) ListModes

func (screen *Screen) ListModes() []*Mode

ListModes lists all available XRandR modes.

The function returns the following values:

  • modes: available XRandR modes.

func (*Screen) ListOutputs

func (screen *Screen) ListOutputs() []*Output

ListOutputs: list all outputs of the given screen.

The function returns the following values:

  • outputs: available outputs.

func (*Screen) OutputByID

func (screen *Screen) OutputByID(id uint32) *Output

OutputByID retrieves the output of a screen using the given identifier.

The function takes the following parameters:

  • id: identifier of an output.

The function returns the following values:

  • output identified by id.

func (*Screen) OutputByName

func (screen *Screen) OutputByName(name string) *Output

OutputByName retrieves the output for the given name.

The function takes the following parameters:

The function returns the following values:

  • output identified by name.

func (*Screen) Ranges

func (screen *Screen) 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 (*Screen) Refresh

func (screen *Screen) Refresh() error

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

func (*Screen) SetDpmsMode

func (screen *Screen) SetDpmsMode(mode DpmsMode) error

SetDpmsMode: this method also disables the DPMS timeouts.

The function takes the following parameters:

type ScreenClass

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

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

type ScreenOverrides

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

ScreenOverrides contains methods that are overridable.

Jump to

Keyboard shortcuts

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