Esempio n. 1
0
 def _do_munge_raw_selection_to_wire(self, target, datatype, dataformat, data):
     if dataformat==32 and datatype in (b"ATOM", b"ATOM_PAIR") and gdk_atoms:
         # Convert to strings and send that. Bizarrely, the atoms are
         # not actual X atoms, but an array of GdkAtom's reinterpreted
         # as a byte buffer.
         atoms = gdk_atoms.gdk_atom_objects_from_gdk_atom_array(data)
         log("_do_munge_raw_selection_to_wire(%s, %s, %s, %s:%s) atoms=%s", target, datatype, dataformat, type(data), len(data), tuple(atoms))
         atom_names = [str(atom) for atom in atoms]
         if target==b"TARGETS":
             atom_names = _filter_targets(atom_names)
         return "atoms", atom_names
     return ClipboardProtocolHelperBase._do_munge_raw_selection_to_wire(self, target, datatype, dataformat, data)
Esempio n. 2
0
 def _do_munge_raw_selection_to_wire(self, target, datatype, dataformat, data):
     if dataformat == 32 and datatype in ("ATOM", "ATOM_PAIR"):
         log("_do_munge_raw_selection_to_wire(%s, %s, %s, %s:%s:%s) using gdk atom code", target, datatype, dataformat, type(data), len(data), list(data))
         # Convert to strings and send that. Bizarrely, the atoms are
         # not actual X atoms, but an array of GdkAtom's reinterpreted
         # as a byte buffer.
         atoms = gdk_atom_objects_from_gdk_atom_array(data)
         log("_do_munge_raw_selection_to_wire(%s, %s, %s, %s:%s) atoms=%s", target, datatype, dataformat, type(data), len(data), list(atoms))
         atom_names = [str(atom) for atom in atoms]
         log("_do_munge_raw_selection_to_wire(%s, %s, %s, %s:%s) atom_names=%s", target, datatype, dataformat, type(data), len(data), atom_names)
         if target=="TARGETS":
             atom_names = self._filter_targets(atom_names)
         return "atoms", atom_names
     return ClipboardProtocolHelperBase._do_munge_raw_selection_to_wire(self, target, datatype, dataformat, data)