From 292668290231e966bbc3629bd75f5c3853648ec4 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Wed, 04 Jul 2012 22:09:44 +0000 Subject: Initial phase of clipboard operations ported to cairo Copy, paste and move operations are implemented. NOTES: * Change size of selection is not implemented in this patch. * A refactoring was done to do the code easier to understand. Previously, the Area.selmove was used to check if a selection is in progress. Now only to check if a area is being moved. A selection is detected using Area.is_selected(). The propery selmove now is private _selmove. The selected area now should be obtained using Area.get_selection_bounds(), and not using Area.orig_x, Area.orig_y and the selection size. This properties should be removed after finish refactoring. The property Area.sel_get_out was removed. Signed-off-by: Gonzalo Odiard --- (limited to 'toolbox.py') diff --git a/toolbox.py b/toolbox.py index b5d1e1c..1ed9f53 100644 --- a/toolbox.py +++ b/toolbox.py @@ -191,7 +191,7 @@ class DrawEditToolbar(EditToolbar): self._activity.area.copy() def _paste_cb(self, widget, data=None): - self._activity.area.past(self._activity.area) + self._activity.area.paste(self._activity.area) def _on_signal_undo_cb(self, widget, data=None): self._verify_sensitive_buttons() @@ -786,7 +786,7 @@ class ImageToolbar(gtk.Toolbar): def resize(self, spinButton, tool, activity): if activity.area.tool['name'] == 'marquee-rectangular' and \ - activity.area.selmove: + activity.area.is_selected(): if tool == "object-height": self.height_percent = spinButton.get_value_as_int() / 100. activity.area.d.resizeSelection(activity.area, @@ -839,7 +839,7 @@ class ImageToolbar(gtk.Toolbar): chooser.get_selected_object()) jobject = chooser.get_selected_object() if jobject and jobject.file_path: - self._activity.area.loadImage(jobject.file_path) + self._activity.area.load_image(jobject.file_path) finally: chooser.destroy() del chooser -- cgit v0.9.1