示例#1
0
文件: appdbus.go 项目: sqp/godock
// IconProperties returns all applet icon properties at once.
//
func (cda *CDDbus) IconProperties() (cdtype.IconProperties, error) {
	var list map[string]interface{}
	e := cda.dbusIcon.Get("GetAll", []interface{}{&list})
	if e != nil {
		return nil, e
	}

	props := &iconProps{}
	for k, v := range list {
		switch k {
		case "Xid":
			props.xid = v.(uint64)
		case "x":
			props.x = int(v.(int32))
		case "y":
			props.y = int(v.(int32))
		case "orientation":
			props.containerPosition = cdtype.ContainerPosition(v.(uint32))
		case "container":
			props.containerType = cdtype.ContainerType(v.(uint32) + 1) // +1 as we have an unknown as 0 in this version.
		case "width":
			props.width = int(v.(int32))
		case "height":
			props.height = int(v.(int32))
		case "has_focus":
			props.hasFocus = v.(bool)
		}
	}
	return props, nil
}
示例#2
0
文件: appdbus.go 项目: sqp/godock
func (o *iconProp) ContainerPosition() (cdtype.ContainerPosition, error) {
	var val uint32
	e := o.dbusIcon.Get("Get", []interface{}{&val}, "orientation")
	return cdtype.ContainerPosition(val), e
}