Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorQuark() glib.Quark
- type CTM
- type Config
- func (self *Config) Applicable(screen *Screen) error
- func (self *Config) Apply(screen *Screen) error
- func (self *Config) ApplyPersistent(screen *Screen) error
- func (self *Config) Clone() bool
- func (self *Config) EnsurePrimary() bool
- func (config1 *Config) Equal(config2 *Config) bool
- func (self *Config) LoadCurrent() error
- func (config1 *Config) Match(config2 *Config) bool
- func (self *Config) Outputs() []*OutputInfo
- func (self *Config) Sanitize()
- func (self *Config) SetClone(clone bool)
- type ConfigClass
- type ConfigOverrides
- type Crtc
- func (crtc *Crtc) CanDriveOutput(output *Output) bool
- func (crtc *Crtc) CurrentMode() *Mode
- func (crtc *Crtc) CurrentRotation() Rotation
- func (crtc *Crtc) Gamma(size *int) (red *uint16, green *uint16, blue *uint16, ok bool)
- func (crtc *Crtc) ID() uint32
- func (crtc *Crtc) Position() (x int, y int)
- func (crtc *Crtc) Rotations() Rotation
- func (crtc *Crtc) SetGamma(size int, red *uint16, green *uint16, blue *uint16) bool
- func (crtc *Crtc) SupportsRotation(rotation Rotation) bool
- type DpmsMode
- type DpmsModeType
- type Error
- type Mode
- type Output
- func (output *Output) Backlight() int
- func (output *Output) CanClone(clone *Output) bool
- func (output *Output) Crtc() *Crtc
- func (output *Output) CurrentMode() *Mode
- func (output *Output) DisplayName() string
- func (output *Output) EdidData(size *uint) *byte
- func (output *Output) ID() uint32
- func (output *Output) IDsFromEdid() (vendor string, product string, serial string)
- func (output *Output) IsBuiltinDisplay() bool
- func (output *Output) IsPrimary() bool
- func (output *Output) IsUnderscanning() bool
- func (output *Output) ListModes() []*Mode
- func (output *Output) MinBacklightStep() int
- func (output *Output) Name() string
- func (output *Output) PhysicalSize() (widthMm int, heightMm int)
- func (output *Output) Position() (x int, y int)
- func (output *Output) PossibleCrtcs() []*Crtc
- func (output *Output) PreferredMode() *Mode
- func (output *Output) SetBacklight(value int) error
- func (output *Output) SetColorTransform(ctm *CTM) error
- func (output *Output) SupportsColorTransform() bool
- func (output *Output) SupportsMode(mode *Mode) bool
- func (output *Output) SupportsUnderscanning() bool
- type OutputInfo
- func (self *OutputInfo) AspectRatio() float64
- func (self *OutputInfo) DisplayName() string
- func (self *OutputInfo) Geometry() (x, y, width, height int)
- func (self *OutputInfo) IsActive() bool
- func (self *OutputInfo) IsConnected() bool
- func (self *OutputInfo) IsPrimaryTile() bool
- func (self *OutputInfo) Name() string
- func (self *OutputInfo) PreferredHeight() int
- func (self *OutputInfo) PreferredWidth() int
- func (self *OutputInfo) Primary() bool
- func (self *OutputInfo) Product() string
- func (self *OutputInfo) RefreshRate() int
- func (self *OutputInfo) Rotation() Rotation
- func (self *OutputInfo) Serial() string
- func (self *OutputInfo) SetActive(active bool)
- func (self *OutputInfo) SetGeometry(x, y, width, height int)
- func (self *OutputInfo) SetPrimary(primary bool)
- func (self *OutputInfo) SetRefreshRate(rate int)
- func (self *OutputInfo) SetRotation(rotation Rotation)
- func (self *OutputInfo) SetUnderscanning(underscanning bool)
- func (self *OutputInfo) SupportsRotation(rotation Rotation) bool
- func (self *OutputInfo) Underscanning() bool
- func (self *OutputInfo) Vendor() string
- type OutputInfoClass
- type OutputInfoOverrides
- type Rotation
- type Screen
- func (screen *Screen) ConnectChanged(f func()) coreglib.SignalHandle
- func (screen *Screen) ConnectOutputConnected(f func(output *Output)) coreglib.SignalHandle
- func (screen *Screen) ConnectOutputDisconnected(f func(output *Output)) coreglib.SignalHandle
- func (screen *Screen) CrtcByID(id uint32) *Crtc
- func (screen *Screen) DpmsMode() (DpmsMode, error)
- func (screen *Screen) ListCloneModes() []*Mode
- func (screen *Screen) ListCrtcs() []*Crtc
- func (screen *Screen) ListModes() []*Mode
- func (screen *Screen) ListOutputs() []*Output
- func (screen *Screen) OutputByID(id uint32) *Output
- func (screen *Screen) OutputByName(name string) *Output
- func (screen *Screen) Ranges() (minWidth, maxWidth, minHeight, maxHeight int)
- func (screen *Screen) Refresh() error
- func (screen *Screen) SetDpmsMode(mode DpmsMode) error
- type ScreenClass
- type ScreenOverrides
Constants ¶
const CONNECTOR_TYPE_PANEL = "Panel"
Variables ¶
var ( GTypeCrtc = coreglib.Type(C.gnome_rr_crtc_get_type()) GTypeMode = coreglib.Type(C.gnome_rr_mode_get_type()) GTypeOutput = coreglib.Type(C.gnome_rr_output_get_type()) )
GType values.
var (
GTypeConfig = coreglib.Type(C.gnome_rr_config_get_type())
)
GType values.
var (
GTypeDpmsModeType = coreglib.Type(C.gnome_rr_dpms_mode_get_type())
)
GType values.
var (
GTypeOutputInfo = coreglib.Type(C.gnome_rr_output_info_get_type())
)
GType values.
var (
GTypeScreen = coreglib.Type(C.gnome_rr_screen_get_type())
)
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 ¶
func NewConfigCurrent ¶
The function takes the following parameters:
The function returns the following values:
func (*Config) Applicable ¶
The function takes the following parameters:
func (*Config) ApplyPersistent ¶
The function takes the following parameters:
func (*Config) Clone ¶
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 ¶
The function returns the following values:
func (*Config) Equal ¶
The function takes the following parameters:
The function returns the following values:
func (*Config) LoadCurrent ¶
func (*Config) Match ¶
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.
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 ¶
The function takes the following parameters:
The function returns the following values:
func (*Crtc) CurrentMode ¶
The function returns the following values:
- mode: current mode of this crtc.
func (*Crtc) CurrentRotation ¶
The function returns the following values:
func (*Crtc) Gamma ¶
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) SetGamma ¶
The function takes the following parameters:
- size
- red
- green
- blue
The function returns the following values:
func (*Crtc) SupportsRotation ¶
The function takes the following parameters:
The function returns the following values:
type DpmsModeType ¶
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 Mode ¶
type Mode struct {
// contains filtered or unexported fields
}
Mode: instance of this type is always passed by reference.
func (*Mode) IsInterlaced ¶
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 ¶
Backlight retrieves the backlight brightness of the given output.
The function returns the following values:
- gint: currently set backlight brightness.
func (*Output) CanClone ¶
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 ¶
Crtc retrieves the CRTC of the given output.
The function returns the following values:
- crtc: CRTC of the output.
func (*Output) CurrentMode ¶
CurrentMode retrieves the current mode of the given output.
The function returns the following values:
- mode: current mode of this output.
func (*Output) DisplayName ¶
DisplayName retrieves the display name of the given output.
The function returns the following values:
- utf8: display name.
func (*Output) EdidData ¶
The function takes the following parameters:
The function returns the following values:
func (*Output) IDsFromEdid ¶
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 ¶
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 ¶
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 ¶
The function returns the following values:
func (*Output) ListModes ¶
ListModes retrieves all available modes of the given output.
The function returns the following values:
- modes: list of modes.
func (*Output) MinBacklightStep ¶
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 ¶
Name retrieves the name of the given output.
The function returns the following values:
- utf8: name of the output.
func (*Output) PhysicalSize ¶
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 ¶
The function returns the following values:
- x (optional): x coordinate of the output.
- y (optional): y coordinate of the output.
func (*Output) PossibleCrtcs ¶
PossibleCrtcs retrieves all the possible CRTC for the given output.
The function returns the following values:
- crtcs: list of possible CRTC.
func (*Output) PreferredMode ¶
PreferredMode retrieves the preferred mode of the given output.
The function returns the following values:
- mode: preferred mode of the output.
func (*Output) SetBacklight ¶
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 ¶
SetColorTransform sets the color transformation matrix for the given output.
The function takes the following parameters:
- ctm: color transformation matrix.
func (*Output) SupportsColorTransform ¶
The function returns the following values:
func (*Output) SupportsMode ¶
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 ¶
The function returns the following values:
type OutputInfo ¶
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 Screen ¶
type Screen struct { *coreglib.Object gio.AsyncInitable gio.Initable // contains filtered or unexported fields }
func NewScreen ¶
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 ¶
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 ¶
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 ¶
The function returns the following values:
- mode: current RRDpmsMode of this screen.
func (*Screen) ListCloneModes ¶
ListCloneModes lists all available XRandR clone modes.
The function returns the following values:
- modes: available XRandR clone modes.
func (*Screen) ListCrtcs ¶
ListCrtcs: list all CRTCs of the given screen.
The function returns the following values:
- crtcs: available CRTCs.
func (*Screen) ListModes ¶
ListModes lists all available XRandR modes.
The function returns the following values:
- modes: available XRandR modes.
func (*Screen) ListOutputs ¶
ListOutputs: list all outputs of the given screen.
The function returns the following values:
- outputs: available outputs.
func (*Screen) OutputByID ¶
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 ¶
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 ¶
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 ¶
Refresh refreshes the screen configuration, and calls the screen's callback if it exists and if the screen's configuration changed.
func (*Screen) SetDpmsMode ¶
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.