crossclip package¶
Submodules¶
crossclip.absbackend module¶
-
class
crossclip.absbackend.
AbstractBackend
[source]¶ Bases:
abc.ABC
Interface for all clipboard backends
This class is an interface for all clipboard backends to be registered into.
-
get_image
(form)[source]¶ Synchronously gets image from clipboard :returns: Image from clipboard :rtype:
-
-
class
crossclip.absbackend.
AbstractImageConverter
[source]¶ Bases:
abc.ABC
Converts an image between a Pillow Image and a native clipboard image
This interface is needed to convert native images to pillow images and vice versa.
-
image_str
¶ String representing image
-
image_type
¶ The type of native image
-
crossclip.clipboard module¶
crossclip.gtkbackend module¶
-
class
crossclip.gtkbackend.
GtkBackend
(display=None)[source]¶ Bases:
crossclip.absbackend.AbstractBackend
Gtk Clipboard backend
This clipboard backends the Gtk.Clipboard class. It inherits from it and the base backend class. This way, it has all of the Gtk’s properties, but it can operate through the BaseBackend interface.
-
get_image
(format='pil', converter=None)[source]¶ Synchronously gets image from clipboard. The image is either a pillow image, or a GdkPixbuf.Pixbuf.
Parameters: format – Format of image. ‘pil’ for pillow, ‘gdk-pixbuf’ for gdk pixbuf (default: ‘pil’) Returns PIL.Image or GdkPixbuf.Pixbuf: Image in chosen format Raises: RuntimeWarning – If format is invalid format
-
image_converter
= <crossclip.gtkbackend.GtkImageConverter object>¶
-
raw_clipboard
= None¶
-
set_image
(image, converter=None)[source]¶ Synchronously sets image to clipboard.
Parameters: - image – Some image object
- format – format of image
Raises: RuntimeWarning – If format is invalid
-
-
class
crossclip.gtkbackend.
GtkImageConverter
[source]¶ Bases:
crossclip.absbackend.AbstractImageConverter
-
from_pillow
(image)[source]¶ Converts a PIL.Image to a GdkPixbuf.Pixbuf.
Parameters: image – PIL.Image to be convered Returns GdkPixbuf.Pixbuf: Converted pixbuf
-
image_str
¶ Returns a string representation of what the object is.
Returns str: ‘gdk-pixbuf’
-
image_type
¶ Returns the type of image that this converter uses.
Returns: GdkPixbuf.Pixbuf type (not object!)
-