Documentation ¶
Index ¶
- Constants
- Variables
- func GetForceScaleFactor() (float64, error)
- func GetRecommendedScaleFactor() float64
- func Init(xConn *x.Conn, useWayland bool, inVM bool)
- func SetGreeterMode(val bool)
- func SetLogLevel(level log.Priority)
- func Start(service *dbusutil.Service) error
- func StartPart2() error
- type ConfigV3D3
- type ConfigV4
- type ConfigV5
- type ConfigV6
- type ConnectInfo
- type CrtcInfo
- type CustomModeConfig
- type ExtendModeConfig
- type FillModeConfigsV5
- type InvalidOutputNameError
- type KModeInfo
- type KOutputInfo
- type KOutputInfos
- type Manager
- func (m *Manager) ApplyChanges() *dbus.Error
- func (m *Manager) AssociateTouch(outputName, touchSerial string) *dbus.Error
- func (m *Manager) AssociateTouchByUUID(outputName, touchUUID string) *dbus.Error
- func (m *Manager) CanRotate() (bool, *dbus.Error)
- func (m *Manager) CanSetBrightness(outputName string) (bool, *dbus.Error)
- func (m *Manager) ChangeBrightness(raised bool) *dbus.Error
- func (m *Manager) DeleteCustomMode(name string) *dbus.Error
- func (m *Manager) GetBrightness() (map[string]float64, *dbus.Error)
- func (m *Manager) GetBuiltinMonitor() (string, dbus.ObjectPath, *dbus.Error)
- func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods
- func (m *Manager) GetInterfaceName() string
- func (m *Manager) GetRealDisplayMode() (uint8, *dbus.Error)
- func (m *Manager) ListOutputNames() ([]string, *dbus.Error)
- func (m *Manager) ListOutputsCommonModes() ([]ModeInfo, *dbus.Error)
- func (m *Manager) ModifyConfigName(name, newName string) *dbus.Error
- func (m *Manager) RefreshBrightness() *dbus.Error
- func (m *Manager) Reset() *dbus.Error
- func (m *Manager) ResetChanges() *dbus.Error
- func (m *Manager) Save() *dbus.Error
- func (m *Manager) SetAndSaveBrightness(outputName string, value float64) *dbus.Error
- func (m *Manager) SetBrightness(outputName string, value float64) *dbus.Error
- func (m *Manager) SetColorTemperature(value int32) *dbus.Error
- func (m *Manager) SetMethodAdjustCCT(adjustMethod int32) *dbus.Error
- func (m *Manager) SetPrimary(outputName string) *dbus.Error
- func (m *Manager) SupportSetColorTemperature() (bool, *dbus.Error)
- func (m *Manager) SwitchMode(mode byte, name string) *dbus.Error
- type MirrorModeConfig
- type ModeConfigsV5
- type ModeInfo
- type ModeInfos
- type Monitor
- func (m *Monitor) Enable(enabled bool) *dbus.Error
- func (v *Monitor) GetExportedMethods() dbusutil.ExportedMethods
- func (m *Monitor) GetInterfaceName() string
- func (m *Monitor) SetMode(mode uint32) *dbus.Error
- func (m *Monitor) SetModeBySize(width, height uint16) *dbus.Error
- func (m *Monitor) SetPosition(X, y int16) *dbus.Error
- func (m *Monitor) SetReflect(value uint16) *dbus.Error
- func (m *Monitor) SetRefreshRate(value float64) *dbus.Error
- func (m *Monitor) SetRotation(value uint16) *dbus.Error
- func (m *Monitor) String() string
- type MonitorBackup
- type MonitorConfigV3D3
- type MonitorConfigV5
- type MonitorConfigsV5
- type MonitorInfo
- type Monitors
- type OnlyOneModeConfig
- type OutputInfo
- type RateFilterMap
- type ScreenConfigV3D3
- type ScreenConfigV4
- type ScreenConfigV5
- type SingleModeConfigV5
- type Size
- type SysCache
- type SysConfig
- type SysMonitorConfig
- type SysMonitorConfigs
- type SysMonitorModeConfig
- type SysRootConfig
- type SysScreenConfig
- type Touchscreen
- type TransformationMatrix
- type UserConfig
- type UserMonitorModeConfig
- type UserScreenConfig
Constants ¶
View Source
const ( // ColorTemperatureModeNone 不调整色温 ColorTemperatureModeNone int32 = iota // ColorTemperatureModeAuto 自动调整色温 ColorTemperatureModeAuto // ColorTemperatureModeManual 手动调整色温 ColorTemperatureModeManual )
View Source
const ( AccuracyLevelNone = 0 AccuracyLevelCountry = 1 AccuracyLevelCity = 4 AccuracyLevelNeighborhood = 5 AccuracyLevelStreet = 6 AccuracyLevelExact = 8 )
View Source
const ( KeyModeMirror = "Mirror" KeyModeExtend = "Extend" KeyModeOnlyOnePrefix = "OnlyOne-" KeySingle = "Single" )
View Source
const ( DisplayModeCustom uint8 = iota DisplayModeMirror DisplayModeExtend DisplayModeOnlyOne DisplayModeUnknown )
View Source
const ( // 1:自动旋转;即未主动调用 SetRotation() 接口(由内部触发)发生的旋转操作,如根据重力传感器自动设定旋转方向 RotationFinishModeAuto uint8 = iota + 1 // 2:手动旋转;即主动调用 SetRotation() 接口完成旋转,如控制中心下拉框方式旋转屏幕 RotationFinishModeManual )
View Source
const ( BusTypeUnknown uint8 = iota BusTypeUSB )
View Source
const ( OutputDeviceTransformNormal = 0 OutputDeviceTransform90 = 1 OutputDeviceTransform180 = 2 OutputDeviceTransform270 = 3 OutputDeviceTransformFlipped = 4 OutputDeviceTransformFlipped90 = 5 OutputDeviceTransformFlipped180 = 6 OutputDeviceTransformFlipped270 = 7 )
View Source
const ( OutputDeviceModeCurrent = 1 << 0 OutputDeviceModePreferred = 1 << 1 )
View Source
const DisplayModeInvalid uint8 = 0
DisplayModeInvalid 无效的模式
Variables ¶
View Source
var ScaleFactorsHelper scaleFactorsHelper
ScaleFactorsHelper 全局的 scale factors 相关 helper,要传给 xsettings 模块。
Functions ¶
func GetForceScaleFactor ¶
GetForceScaleFactor 允许用户通过 force-scale-factor.ini 强制设置全局缩放
func GetRecommendedScaleFactor ¶
func GetRecommendedScaleFactor() float64
func SetGreeterMode ¶
func SetGreeterMode(val bool)
func SetLogLevel ¶
func StartPart2 ¶
func StartPart2() error
Types ¶
type ConfigV3D3 ¶
type ConfigV3D3 map[string]*ScreenConfigV3D3
type ConfigV4 ¶
type ConfigV4 map[string]*ScreenConfigV4
type ConfigV5 ¶
type ConfigV5 map[string]*ScreenConfigV5
type ConfigV6 ¶
type ConfigV6 struct { ConfigV5 ConfigV5 FillMode *FillModeConfigsV5 }
type ConnectInfo ¶
type CrtcInfo ¶
type CrtcInfo randr.GetCrtcInfoReply
type CustomModeConfig ¶
type CustomModeConfig struct { Name string Monitors []*MonitorConfigV5 }
type ExtendModeConfig ¶
type ExtendModeConfig struct {
Monitors []*MonitorConfigV5
}
type FillModeConfigsV5 ¶
type InvalidOutputNameError ¶
type InvalidOutputNameError struct {
Name string
}
func (InvalidOutputNameError) Error ¶
func (err InvalidOutputNameError) Error() string
type KOutputInfo ¶
type KOutputInfo struct { UUID string `json:"uuid"` Name string `json:"name"` EdidBase64 string `json:"edid_base64"` Enabled int32 `json:"enabled"` X int32 `json:"x"` Y int32 `json:"y"` Width int32 `json:"width"` Height int32 `json:"height"` RefreshRate int32 `json:"refresh_rate"` Manufacturer string `json:"manufacturer"` Model string `json:"model"` ModeInfos []KModeInfo `json:"ModeInfo"` PhysHeight int32 `json:"phys_height"` PhysWidth int32 `json:"phys_width"` Transform int32 `json:"transform"` Scale float64 `json:"scale"` // contains filtered or unexported fields }
type KOutputInfos ¶
type KOutputInfos []*KOutputInfo
type Manager ¶
type Manager struct { PropsMu sync.RWMutex // dbusutil-gen: equal=objPathsEqual Monitors []dbus.ObjectPath // dbusutil-gen: equal=nil CustomIdList []string HasChanged bool DisplayMode byte // dbusutil-gen: equal=nil Brightness map[string]float64 // dbusutil-gen: equal=nil Touchscreens dxTouchscreens // dbusutil-gen: equal=nil TouchscreensV2 dxTouchscreens // dbusutil-gen: equal=nil TouchMap map[string]string CurrentCustomId string Primary string PrimaryRect x.Rectangle ScreenWidth uint16 ScreenHeight uint16 MaxBacklightBrightness uint32 // method of adjust color temperature according to time and location ColorTemperatureMode int32 // adjust color temperature by manual adjustment ColorTemperatureManual int32 ColorTemperatureEnabled bool `prop:"access:rw"` SupportColorTemperature bool // contains filtered or unexported fields }
func (*Manager) ApplyChanges ¶
func (m *Manager) ApplyChanges() *dbus.Error
func (*Manager) AssociateTouch ¶
func (*Manager) AssociateTouchByUUID ¶
func (*Manager) CanSetBrightness ¶
func (*Manager) ChangeBrightness ¶
ChangeBrightness 通过键盘控制所有显示器一起亮度加或减,保存配置。
func (*Manager) DeleteCustomMode ¶
DeleteCustomMode 废弃方法
func (*Manager) GetBrightness ¶
func (*Manager) GetBuiltinMonitor ¶
func (*Manager) GetExportedMethods ¶
func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods
func (*Manager) GetInterfaceName ¶
func (*Manager) GetRealDisplayMode ¶
func (*Manager) ListOutputNames ¶
func (*Manager) ListOutputsCommonModes ¶
func (*Manager) ModifyConfigName ¶
ModifyConfigName 废弃方法
func (*Manager) RefreshBrightness ¶
func (m *Manager) RefreshBrightness() *dbus.Error
RefreshBrightness 重置亮度,主要被 session/power 模块调用。从配置恢复亮度。
func (*Manager) ResetChanges ¶
func (m *Manager) ResetChanges() *dbus.Error
func (*Manager) SetAndSaveBrightness ¶
SetAndSaveBrightness 设置并保持亮度
func (*Manager) SetBrightness ¶
SetBrightness 设置亮度但是不保存, 主要被 session/power 模块调用。
func (*Manager) SetColorTemperature ¶
func (*Manager) SetMethodAdjustCCT ¶
func (*Manager) SetPrimary ¶
func (*Manager) SupportSetColorTemperature ¶
func (*Manager) SwitchMode ¶
type MirrorModeConfig ¶
type MirrorModeConfig struct {
Monitors []*MonitorConfigV5
}
type ModeConfigsV5 ¶
type ModeConfigsV5 struct {
Monitors MonitorConfigsV5
}
type Monitor ¶
type Monitor struct { PropsMu sync.RWMutex ID uint32 Name string Connected bool Manufacturer string Model string // dbusutil-gen: equal=uint16SliceEqual Rotations []uint16 // dbusutil-gen: equal=uint16SliceEqual Reflects []uint16 BestMode ModeInfo // dbusutil-gen: equal=modeInfosEqual Modes []ModeInfo // dbusutil-gen: equal=modeInfosEqual PreferredModes []ModeInfo MmWidth uint32 MmHeight uint32 Enabled bool X int16 Y int16 Width uint16 Height uint16 Rotation uint16 Reflect uint16 RefreshRate float64 Brightness float64 CurrentRotateMode uint8 CurrentMode ModeInfo CurrentFillMode string `prop:"access:rw"` // dbusutil-gen: equal=method:Equal AvailableFillModes strv.Strv // contains filtered or unexported fields }
func (*Monitor) GetExportedMethods ¶
func (v *Monitor) GetExportedMethods() dbusutil.ExportedMethods
func (*Monitor) GetInterfaceName ¶
func (*Monitor) SetModeBySize ¶
func (*Monitor) SetPosition ¶
func (*Monitor) SetReflect ¶
func (*Monitor) SetRefreshRate ¶
func (*Monitor) SetRotation ¶
type MonitorBackup ¶
type MonitorConfigV3D3 ¶
type MonitorConfigV5 ¶
type MonitorConfigsV5 ¶
type MonitorConfigsV5 []*MonitorConfigV5
type MonitorInfo ¶
type MonitorInfo struct { Enabled bool ID uint32 UUID string // UUID V1 UuidV0 string Name string Connected bool // 实际的是否连接,对应于 Monitor 的 realConnected VirtualConnected bool // 用于前端,对应于 Monitor 的 Connected Modes []ModeInfo CurrentMode ModeInfo PreferredMode ModeInfo X int16 Y int16 Width uint16 Height uint16 Rotation uint16 Rotations uint16 MmHeight uint32 MmWidth uint32 EDID []byte Manufacturer string Model string CurrentFillMode string AvailableFillModes []string // contains filtered or unexported fields }
MonitorInfo X 和 Wayland 共用的显示器信息
type OnlyOneModeConfig ¶
type OnlyOneModeConfig struct {
Monitors []*MonitorConfigV5
}
type OutputInfo ¶
type OutputInfo randr.GetOutputInfoReply
func (*OutputInfo) PreferredMode ¶
func (oi *OutputInfo) PreferredMode() randr.Mode
type RateFilterMap ¶
RateFilterMap pciId => (size => rates)
type ScreenConfigV3D3 ¶
type ScreenConfigV3D3 struct { Name string Primary string BaseInfos []*MonitorConfigV3D3 }
type ScreenConfigV4 ¶
type ScreenConfigV4 struct { Custom []*CustomModeConfig `json:",omitempty"` Mirror *MirrorModeConfig `json:",omitempty"` Extend *ExtendModeConfig `json:",omitempty"` OnlyOne *OnlyOneModeConfig `json:",omitempty"` Single *MonitorConfigV5 `json:",omitempty"` }
type ScreenConfigV5 ¶
type ScreenConfigV5 struct { Mirror *ModeConfigsV5 `json:",omitempty"` Extend *ModeConfigsV5 `json:",omitempty"` OnlyOne *ModeConfigsV5 `json:",omitempty"` Single *SingleModeConfigV5 `json:",omitempty"` }
type SingleModeConfigV5 ¶
type SingleModeConfigV5 struct { // 这里其实不能用 Monitors,因为是单数 Monitor *MonitorConfigV5 `json:"Monitors"` // 单屏时,该配置文件中色温相关数据未生效;增加json的tag是为了兼容之前配置文件 ColorTemperatureMode int32 ColorTemperatureManual int32 }
type SysConfig ¶
type SysConfig struct { DisplayMode byte Screens map[string]*SysScreenConfig ScaleFactors map[string]float64 // 缩放比例 FillModes map[string]string // key 是特殊的 fillMode Key Cache SysCache }
SysConfig v1
type SysMonitorConfig ¶
type SysMonitorConfigs ¶
type SysMonitorConfigs []*SysMonitorConfig
type SysMonitorModeConfig ¶
type SysMonitorModeConfig struct {
Monitors SysMonitorConfigs
}
type SysRootConfig ¶
type SysScreenConfig ¶
type SysScreenConfig struct { Mirror *SysMonitorModeConfig `json:",omitempty"` Extend *SysMonitorModeConfig `json:",omitempty"` Single *SysMonitorModeConfig `json:",omitempty"` OnlyOneMap map[string]*SysMonitorModeConfig `json:",omitempty"` OnlyOneUuid string `json:",omitempty"` }
SysScreenConfig 系统级屏幕配置 NOTE: Single 可以看作是特殊的显示模式,和 Mirror,Extend 等模式共用 SysMonitorModeConfig 结构可以保持设计上的统一,不必在乎里面有 Monitors
type Touchscreen ¶
type TransformationMatrix ¶
type TransformationMatrix [9]float32
type UserConfig ¶
type UserConfig struct { Version string Screens map[string]UserScreenConfig }
UserConfig v1
type UserMonitorModeConfig ¶
type UserScreenConfig ¶
type UserScreenConfig map[string]*UserMonitorModeConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.