zooui.objects.scene.sceneutils.clipboard module

SceneClipboardManager - Clipboard functionality for Scene class.

This class manages copy/paste operations for SVG objects within a scene. It was extracted from the Scene class to improve modularity and maintainability.

class zooui.objects.scene.sceneutils.clipboard.SceneClipboardManager(scene)[source]

Bases: object

Manager for scene clipboard functionality.

This class handles copy and paste operations for SVG objects within a scene. It maintains an internal clipboard and provides methods for copying selected objects and pasting them with optional offset.

_scene

Reference to the parent Scene object

_logger

Logger instance for clipboard operations

_clipboard

List of serialized object data for clipboard storage

Initialize SceneClipboardManager.

Parameters:

scene – Parent Scene object

copy_selection()[source]

Copy selected SVG objects to internal clipboard.

Only SVGMediaObjects are supported for copy/paste. Deselects copied objects after copying.

paste(offset_position=None)[source]

Paste SVG objects from clipboard with fixed offset.

Only SVGMediaObjects are supported for copy/paste. Selects pasted objects after pasting. Logs warning for unsupported object types.

Parameters:

offset_position – Optional offset position for pasted objects

Returns:

List of pasted SVGMediaObject instances

clear()[source]

Clear the clipboard.

has_content()[source]

Check if clipboard has content.

Returns:

True if clipboard has content, False otherwise

get_content_count()[source]

Get number of items in clipboard.

Returns:

Number of items in clipboard

See Also

  • zooui/objects/scene/scene - Scene management