本文整理汇总了Python中atom.Atom.get_atom方法的典型用法代码示例。如果您正苦于以下问题:Python Atom.get_atom方法的具体用法?Python Atom.get_atom怎么用?Python Atom.get_atom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atom.Atom
的用法示例。
在下文中一共展示了Atom.get_atom方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_below
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def set_below(self, below):
self._send_client_event(
Atom.get_atom('_NET_WM_STATE'),
[
1 if below else 0,
Atom.get_atom('_NET_WM_STATE_BELOW'),
]
)
connection.push()
示例2: restore
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def restore(self):
self._send_client_event(
Atom.get_atom('_NET_WM_STATE'),
[
0, # _NET_WM_STATE_REMOVE = 0, _NET_WM_STATE_ADD = 1, _NET_WM_STATE_TOGGLE = 2
Atom.get_atom('_NET_WM_STATE_MAXIMIZED_VERT'),
Atom.get_atom('_NET_WM_STATE_MAXIMIZED_HORZ')
]
)
connection.push()
示例3: remove_decorations
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def remove_decorations(self):
if XROOT.wm() == 'openbox':
self._send_client_event(
Atom.get_atom('_NET_WM_STATE'),
[
1,
Atom.get_atom('_OB_WM_STATE_UNDECORATED')
]
)
else:
self._set_property('_MOTIF_WM_HINTS', [2, 0, 0, 0, 0])
connection.push()
示例4: _get_property
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def _get_property(self, atom_name):
try:
if not Atom.get_type_name(atom_name):
return ''
rsp = connection.get_core().GetProperty(
False,
self.wid,
Atom.get_atom(atom_name),
Atom.get_atom_type(atom_name),
0,
(2 ** 32) - 1
).reply()
if Atom.get_type_name(atom_name) in ('UTF8_STRING', 'STRING'):
if atom_name == 'WM_CLASS':
return Atom.null_terminated_to_strarray(rsp.value)
else:
return Atom.ords_to_str(rsp.value)
elif Atom.get_type_name(atom_name) in ('UTF8_STRING[]', 'STRING[]'):
return Atom.null_terminated_to_strarray(rsp.value)
else:
return list(struct.unpack('I' * (len(rsp.value) / 4), rsp.value.buf()))
except:
pass
示例5: set_desktop
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def set_desktop(self, desk):
self._send_client_event(
Atom.get_atom('_NET_WM_DESKTOP'),
[
desk,
2
]
)
示例6: restack
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def restack(self, below=False):
self._send_client_event(
Atom.get_atom('_NET_RESTACK_WINDOW'),
[
2 if not below else 1,
self.wid,
0
]
)
示例7: activate
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def activate(self):
self._send_client_event(
Atom.get_atom('_NET_ACTIVE_WINDOW'),
[
2,
xcb.xcb.CurrentTime,
self.wid
]
)
self.stack(True)
示例8: close
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def close(self):
self._send_client_event(
Atom.get_atom('_NET_CLOSE_WINDOW'),
[
xcb.xproto.Time.CurrentTime,
2,
0,
0,
0
]
)
示例9: __init__
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def __init__(self, wsid, x, y, width, height, color=0x000000):
self._root_depth = connection.setup.roots[0].root_depth
self._root_visual = connection.setup.roots[0].root_visual
self._pixel = color
self.wid = connection.conn.generate_id()
connection.get_core().CreateWindow(
self._root_depth,
self.wid,
XROOT.wid,
x,
y,
width,
height,
0,
xcb.xproto.WindowClass.InputOutput,
self._root_visual,
xcb.xproto.CW.BackPixel,
[self._pixel]
)
self._set_property('_NET_WM_NAME', 'Place holder')
self.set_desktop(wsid)
self._set_property('WM_NAME', 'pytyle-internal-window')
self._set_property('WM_PROTOCOLS', [Atom.get_atom('WM_DELETE_WINDOW')])
self._set_property(
'_PYTYLE_TYPE',
[
Atom.get_atom('_PYTYLE_TYPE_PLACE_HOLDER')
]
)
#self.set_override_redirect(True)
connection.get_core().MapWindow(self.wid)
connection.push()
self._moveresize(x, y, width, height)
connection.push()
#self.set_override_redirect(False)
connection.push()
示例10: _moveresize
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def _moveresize(self, x, y, width, height):
#print self.get_wmname(), x, y, width, height
self._send_client_event(
Atom.get_atom('_NET_MOVERESIZE_WINDOW'),
[
xcb.xproto.Gravity.NorthWest
| 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 | 1 << 13,
x,
y,
width,
height
],
32,
xcb.xproto.EventMask.StructureNotify
)
connection.push()
示例11: _set_property
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom [as 别名]
def _set_property(self, atom_name, value):
try:
if isinstance(value, list):
data = struct.pack(len(value) * 'I', *value)
data_len = len(value)
else:
value = str(value)
data_len = len(value)
data = value
connection.get_core().ChangeProperty(
xcb.xproto.PropMode.Replace,
self.wid,
Atom.get_atom(atom_name),
Atom.get_atom_type(atom_name),
Atom.get_atom_length(atom_name),
data_len,
data
)
except:
print traceback.format_exc()