本文整理匯總了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')])