• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang xprop.ChangeProp32函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/BurntSushi/xgbutil/xprop.ChangeProp32函数的典型用法代码示例。如果您正苦于以下问题:Golang ChangeProp32函数的具体用法?Golang ChangeProp32怎么用?Golang ChangeProp32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ChangeProp32函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: SetRoot

// SetRoot sets the given background as the root window background.
func SetRoot(X *xgbutil.XUtil, bg *xgraphics.Image) error {
	root := X.RootWin()
	if err := bg.XSurfaceSet(root); err != nil {
		return err
	}
	bg.XDraw()
	bg.XPaint(root)
	// FIXME: This doesn't set the pixmap persistently. As soon as the program
	// exits, the pixmap is destroyed. Find a way to make it persistent.
	xprop.ChangeProp32(X, root, "_XROOTPMAP_ID", "PIXMAP", uint(bg.Pixmap))
	xprop.ChangeProp32(X, root, "ESETROOT_PMAP_ID", "PIXMAP", uint(bg.Pixmap))
	return nil
}
开发者ID:proxypoke,项目名称:chiwa,代码行数:14,代码来源:background.go


示例2: tryOwner

func (m *TrayManager) tryOwner() bool {
	// Make a check, the tray application MUST be 1.
	reply, err := m.getSelectionOwner()
	if err != nil {
		logger.Error(err)
		return false
	}
	if reply.Owner != 0 {
		logger.Warning("Another System tray application is running")
		return false
	}

	timeStamp, _ := ewmh.WmUserTimeGet(TrayXU, m.owner)
	err = xproto.SetSelectionOwnerChecked(
		TrayXU.Conn(),
		m.owner,
		_NET_SYSTEM_TRAY_S0,
		xproto.Timestamp(timeStamp),
	).Check()
	if err != nil {
		logger.Warning("Set Selection Owner failed: ", err)
		return false
	}

	//owner the _NET_SYSTEM_TRAY_Sn
	logger.Info("Required _NET_SYSTEM_TRAY_S0 successful")

	m.RequireManageTrayIcons()

	xprop.ChangeProp32(
		TrayXU,
		m.owner,
		"_NET_SYSTEM_TRAY_VISUAL",
		"VISUALID",
		uint(TRAYMANAGER.visual),
	)
	xprop.ChangeProp32(
		TrayXU,
		m.owner,
		"_NET_SYSTEM_TRAY_ORIENTAION",
		"CARDINAL",
		0,
	)
	reply, err = m.getSelectionOwner()
	if err != nil {
		logger.Warning(err)
		return false
	}
	return reply.Owner != 0
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:50,代码来源:traymanager.go


示例3: DesktopLayoutSet

// _NET_DESKTOP_LAYOUT set
func DesktopLayoutSet(xu *xgbutil.XUtil, orientation, columns, rows,
	startingCorner uint) error {

	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_DESKTOP_LAYOUT",
		"CARDINAL", orientation, columns, rows,
		startingCorner)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:8,代码来源:ewmh.go


示例4: WmStateSet

// WM_STATE set
func WmStateSet(xu *xgbutil.XUtil, win xproto.Window, state *WmState) error {
	raw := []int{
		state.State,
		int(state.Icon),
	}

	return xprop.ChangeProp32(xu, win, "WM_STATE", "WM_STATE", raw...)
}
开发者ID:droundy,项目名称:xgbutil,代码行数:9,代码来源:icccm.go


示例5: WmProtocolsSet

// WM_PROTOCOLS set
func WmProtocolsSet(xu *xgbutil.XUtil, win xproto.Window,
	atomNames []string) error {

	atoms, err := xprop.StrToAtoms(xu, atomNames)
	if err != nil {
		return err
	}
	return xprop.ChangeProp32(xu, win, "WM_PROTOCOLS", "ATOM", atoms...)
}
开发者ID:droundy,项目名称:xgbutil,代码行数:10,代码来源:icccm.go


示例6: SupportedSet

// _NET_SUPPORTED set
// This will create any atoms in the argument if they don't already exist.
func SupportedSet(xu *xgbutil.XUtil, atomNames []string) error {
	atoms, err := xprop.StrToAtoms(xu, atomNames)
	if err != nil {
		return err
	}

	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_SUPPORTED", "ATOM",
		atoms...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例7: WmIconSet

// _NET_WM_ICON set
func WmIconSet(xu *xgbutil.XUtil, win xproto.Window, icons []WmIcon) error {
	raw := make([]uint, 0, 10000) // start big
	for _, icon := range icons {
		raw = append(raw, icon.Width, icon.Height)
		raw = append(raw, icon.Data...)
	}

	return xprop.ChangeProp32(xu, win, "_NET_WM_ICON", "CARDINAL", raw...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:10,代码来源:ewmh.go


示例8: WmWindowTypeSet

// _NET_WM_WINDOW_TYPE set
// This will create any atoms used in 'atomNames' if they don't already exist.
func WmWindowTypeSet(xu *xgbutil.XUtil, win xproto.Window,
	atomNames []string) error {

	atoms, err := xprop.StrToAtoms(xu, atomNames)
	if err != nil {
		return err
	}
	return xprop.ChangeProp32(xu, win, "_NET_WM_WINDOW_TYPE", "ATOM", atoms...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例9: ShowingDesktopSet

// _NET_SHOWING_DESKTOP set
func ShowingDesktopSet(xu *xgbutil.XUtil, show bool) error {
	var showInt uint
	if show {
		showInt = 1
	} else {
		showInt = 0
	}
	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_SHOWING_DESKTOP",
		"CARDINAL", showInt)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例10: WmHandledIconsSet

// _NET_WM_HANDLED_ICONS set
func WmHandledIconsSet(xu *xgbutil.XUtil, handle bool) error {
	var handled uint
	if handle {
		handled = 1
	} else {
		handled = 0
	}
	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_WM_HANDLED_ICONS",
		"CARDINAL", handled)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例11: FrameExtentsSet

// _NET_FRAME_EXTENTS set
func FrameExtentsSet(xu *xgbutil.XUtil, win xproto.Window,
	extents *FrameExtents) error {
	raw := make([]uint, 4)
	raw[0] = uint(extents.Left)
	raw[1] = uint(extents.Right)
	raw[2] = uint(extents.Top)
	raw[3] = uint(extents.Bottom)

	return xprop.ChangeProp32(xu, win, "_NET_FRAME_EXTENTS", "CARDINAL", raw...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例12: DesktopViewportSet

// _NET_DESKTOP_VIEWPORT set
func DesktopViewportSet(xu *xgbutil.XUtil, viewports []DesktopViewport) error {
	coords := make([]uint, len(viewports)*2)
	for i, viewport := range viewports {
		coords[i*2] = uint(viewport.X)
		coords[i*2+1] = uint(viewport.Y)
	}

	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_DESKTOP_VIEWPORT",
		"CARDINAL", coords...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例13: WmHintsSet

// WM_HINTS set
// Make sure to set the flags in the Hints struct correctly!
func WmHintsSet(xu *xgbutil.XUtil, win xproto.Window, hints *Hints) error {
	raw := []int{
		hints.Flags, hints.Input, hints.InitialState,
		int(hints.IconPixmap), int(hints.IconWindow),
		hints.IconX, hints.IconY,
		int(hints.IconMask),
		int(hints.WindowGroup),
	}
	return xprop.ChangeProp32(xu, win, "WM_HINTS", "WM_HINTS", raw...)
}
开发者ID:droundy,项目名称:xgbutil,代码行数:12,代码来源:icccm.go


示例14: WmStrutSet

// _NET_WM_STRUT set
func WmStrutSet(xu *xgbutil.XUtil, win xproto.Window, struts *WmStrut) error {
	rawStruts := make([]uint, 4)
	rawStruts[0] = struts.Left
	rawStruts[1] = struts.Right
	rawStruts[2] = struts.Top
	rawStruts[3] = struts.Bottom

	return xprop.ChangeProp32(xu, win, "_NET_WM_STRUT", "CARDINAL",
		rawStruts...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:11,代码来源:ewmh.go


示例15: WmIconSizeSet

// WM_ICON_SIZE set
func WmIconSizeSet(xu *xgbutil.XUtil, win xproto.Window,
	icondim *IconSize) error {

	raw := []int{
		icondim.MinWidth, icondim.MinHeight,
		icondim.MaxWidth, icondim.MaxHeight,
		icondim.WidthInc, icondim.HeightInc,
	}

	return xprop.ChangeProp32(xu, win, "WM_ICON_SIZE", "WM_ICON_SIZE", raw...)
}
开发者ID:droundy,项目名称:xgbutil,代码行数:12,代码来源:icccm.go


示例16: WmAllowedActionsSet

// _NET_WM_ALLOWED_ACTIONS set
func WmAllowedActionsSet(xu *xgbutil.XUtil, win xproto.Window,
	atomNames []string) error {

	atoms, err := xprop.StrToAtoms(xu, atomNames)
	if err != nil {
		return err
	}

	return xprop.ChangeProp32(xu, win, "_NET_WM_ALLOWED_ACTIONS", "ATOM",
		atoms...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:12,代码来源:ewmh.go


示例17: WmIconGeometrySet

// _NET_WM_ICON_GEOMETRY set
func WmIconGeometrySet(xu *xgbutil.XUtil, win xproto.Window,
	geom *WmIconGeometry) error {

	rawGeom := make([]uint, 4)
	rawGeom[0] = uint(geom.X)
	rawGeom[1] = uint(geom.Y)
	rawGeom[2] = geom.Width
	rawGeom[3] = geom.Height

	return xprop.ChangeProp32(xu, win, "_NET_WM_ICON_GEOMETRY", "CARDINAL",
		rawGeom...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:13,代码来源:ewmh.go


示例18: WorkareaSet

// _NET_WORKAREA set
func WorkareaSet(xu *xgbutil.XUtil, workareas []Workarea) error {
	rects := make([]uint, len(workareas)*4)
	for i, workarea := range workareas {
		rects[i*4+0] = uint(workarea.X)
		rects[i*4+1] = uint(workarea.Y)
		rects[i*4+2] = workarea.Width
		rects[i*4+3] = workarea.Height
	}

	return xprop.ChangeProp32(xu, xu.RootWin(), "_NET_WORKAREA", "CARDINAL",
		rects...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:13,代码来源:ewmh.go


示例19: WmFullscreenMonitorsSet

// _NET_WM_FULLSCREEN_MONITORS set
func WmFullscreenMonitorsSet(xu *xgbutil.XUtil, win xproto.Window,
	edges *WmFullscreenMonitors) error {

	raw := make([]uint, 4)
	raw[0] = edges.Top
	raw[1] = edges.Bottom
	raw[2] = edges.Left
	raw[3] = edges.Right

	return xprop.ChangeProp32(xu, win, "_NET_WM_FULLSCREEN_MONITORS",
		"CARDINAL", raw...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:13,代码来源:ewmh.go


示例20: WmOpaqueRegionSet

// _NET_WM_OPAQUE_REGION set
func WmOpaqueRegionSet(xu *xgbutil.XUtil, win xproto.Window,
	regions []WmOpaqueRegion) error {

	raw := make([]uint, len(regions)*4)

	for i, region := range regions {
		raw[i*4+0] = uint(region.X)
		raw[i*4+1] = uint(region.Y)
		raw[i*4+2] = region.Width
		raw[i*4+3] = region.Height
	}

	return xprop.ChangeProp32(xu, win, "_NET_WM_OPAQUE_REGION", "CARDINAL",
		raw...)
}
开发者ID:auroralaboratories,项目名称:corona-api,代码行数:16,代码来源:ewmh.go



注:本文中的github.com/BurntSushi/xgbutil/xprop.ChangeProp32函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang xprop.GetProperty函数代码示例发布时间:2022-05-24
下一篇:
Golang xprop.AtomName函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap