示例#1
0
 def _pythonize_window():
     value = _xcb.xcb_get_property_value(_reply)
     p_uint8_t = ctypes.POINTER(ctypes.c_uint * _xcb.xcb_get_property_value_length(_reply))
     return [window.Window(self, xid) for xid in ctypes.cast(value, p_uint8_t).contents]
示例#2
0
 def _pythonize_cardinal():
     value = _xcb.xcb_get_property_value(_reply)
     p_uint8_t = ctypes.POINTER(ctypes.c_uint * _xcb.xcb_get_property_value_length(_reply))
     return list(ctypes.cast(value, p_uint8_t).contents)
示例#3
0
 def _pythonize_atom():
     value = _xcb.xcb_get_property_value(_reply)
     p_uint8_t = ctypes.POINTER(ctypes.c_uint * _xcb.xcb_get_property_value_length(_reply))
     atom_values = ctypes.cast(value, p_uint8_t).contents
     return [atom.Atom(self, atom_value) for atom_value in atom_values]
示例#4
0
 def _pythonize_string():
     length = _xcb.xcb_get_property_value_length(_reply)
     value = _xcb.xcb_get_property_value(_reply)
     pointer = ctypes.cast(value, ctypes.POINTER(ctypes.c_ubyte * length))
     elems =  ''.join([chr(x) for x in pointer.contents]).rstrip('\x00').split('\x00') # strip trailing \x00
     return elems