本文整理汇总了Python中atom.Atom.get_atom_name方法的典型用法代码示例。如果您正苦于以下问题:Python Atom.get_atom_name方法的具体用法?Python Atom.get_atom_name怎么用?Python Atom.get_atom_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atom.Atom
的用法示例。
在下文中一共展示了Atom.get_atom_name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dispatch
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom_name [as 别名]
def dispatch(e):
NotifyModes = {
0: 'Normal', 1: 'Grab', 2: 'Ungrab', 3: 'WhileGrabbed'
}
NotifyDetails = {
0: 'Ancestor', 1: 'Virtual', 2: 'Inferior', 3: 'Nonlinear',
4: 'NonlinearVirtual', 5: 'Pointer', 6: 'PointerRoot',
7: 'None'
}
if isinstance(e, xcb.xproto.KeyPressEvent):
return {
'event': 'KeyPressEvent',
'keycode': e.detail,
'modifiers': e.state
}
elif isinstance(e, xcb.xproto.ButtonPressEvent):
print 'detail:', e.detail
print 'root_x:', e.root_x
print 'root_y:', e.root_y
print 'event_x:', e.event_x
print 'event_y:', e.event_y
print 'state:', e.state
print 'root:', e.root
print 'event:', e.event
print 'child:', e.child
return {
'event': 'ButtonPressEvent',
}
elif isinstance(e, xcb.xproto.ConfigureNotifyEvent):
return {
'event': 'ConfigureNotifyEvent',
'ewin': Window(e.event) if e.event != XROOT.wid else XROOT,
'window': Window(e.window),
'above': Window(e.above_sibling),
'x': e.x,
'y': e.y,
'width': e.width,
'height': e.height,
}
elif isinstance(e, xcb.xproto.PropertyNotifyEvent):
return {
'event': 'PropertyNotifyEvent',
'window': Window(e.window),
'atom': Atom.get_atom_name(e.atom),
'state': e.state
}
elif isinstance(e, xcb.xproto.FocusInEvent):
return {
'event': 'FocusInEvent',
'window': Window(e.event),
'detail': NotifyDetails[e.detail],
'mode': NotifyModes[e.mode]
}
elif isinstance(e, xcb.xproto.FocusOutEvent):
return {
'event': 'FocusOutEvent',
'window': Window(e.event),
'detail': NotifyDetails[e.detail],
'mode': NotifyModes[e.mode]
}
示例2: get_supported_hints
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom_name [as 别名]
def get_supported_hints(self):
return [Atom.get_atom_name(anum) for anum in self._get_property('_NET_SUPPORTED')]
示例3: get_types
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom_name [as 别名]
def get_types(self):
return set([Atom.get_atom_name(anum) for anum in self._get_property('_NET_WM_WINDOW_TYPE')])
示例4: get_states
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom_name [as 别名]
def get_states(self):
return set([Atom.get_atom_name(anum) for anum in self._get_property('_NET_WM_STATE')])
示例5: get_pytyle_types
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom_name [as 别名]
def get_pytyle_types(self):
return set([Atom.get_atom_name(anum) for anum in self._get_property('_PYTYLE_TYPE')])
示例6: get_allowed_actions
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import get_atom_name [as 别名]
def get_allowed_actions(self):
return set([Atom.get_atom_name(anum) for anum in self._get_property('_NET_WM_ALLOWED_ACTIONS')])