summaryrefslogtreecommitdiff
path: root/src/page.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-07-21 19:58:31 +0200
committerJörg Frings-Fürst <debian@jff.email>2024-07-21 19:58:31 +0200
commit5a514d891db203b803a37c2110184f537fcd5608 (patch)
tree0c85f179d5cfeb471f3227bd4a94998e3aaf4ee1 /src/page.vala
parent408791709f23be34de957320384d02b228ea488f (diff)
parent35c7b263d4fc6910be51005193095cfbdeaa969a (diff)
Merge branch 'release/debian/46.0-1'HEADdebian/46.0-1master
Diffstat (limited to 'src/page.vala')
-rw-r--r--src/page.vala30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/page.vala b/src/page.vala
index cfe70e1..67c8010 100644
--- a/src/page.vala
+++ b/src/page.vala
@@ -219,6 +219,31 @@ public class Page : Object
this.crop_width = (crop_x + crop_width > scan_width) ? scan_width : crop_width;
this.crop_height = (crop_y + crop_height > scan_height) ? scan_height : crop_height;
}
+
+ public Page copy()
+ {
+ var copy = new Page.from_data (
+ scan_width,
+ scan_height,
+ rowstride,
+ n_channels,
+ depth,
+ dpi,
+ scan_direction,
+ color_profile,
+ pixels,
+ has_crop,
+ crop_name,
+ crop_x,
+ crop_y,
+ crop_width,
+ crop_height
+ );
+
+ copy.scan_line = scan_line;
+
+ return copy;
+ }
public void set_page_info (ScanPageInfo info)
{
@@ -649,10 +674,9 @@ public class Page : Object
public void copy_to_clipboard (Gtk.Window window)
{
- var display = window.get_display ();
- var clipboard = Gtk.Clipboard.get_for_display (display, Gdk.SELECTION_CLIPBOARD);
+ var clipboard = window.get_clipboard();
var image = get_image (true);
- clipboard.set_image (image);
+ clipboard.set_value (image);
}
public void save_png (File file) throws Error