From cf7d885d901b0abdccaad5cc3305a080744eaf5b Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 9 Apr 2010 13:10:42 +0200 Subject: Imported Upstream version 0.9.10 --- src/page.h | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 src/page.h (limited to 'src/page.h') diff --git a/src/page.h b/src/page.h new file mode 100644 index 0000000..b36fe32 --- /dev/null +++ b/src/page.h @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2009 Canonical Ltd. + * Author: Robert Ancell + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. See http://www.gnu.org/copyleft/gpl.html the full text of the + * license. + */ + +#ifndef _PAGE_H_ +#define _PAGE_H_ + +#include +#include +#include +#include "scanner.h" + +G_BEGIN_DECLS + +#define PAGE_TYPE (page_get_type ()) +#define PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAGE_TYPE, Page)) + +typedef enum +{ + TOP_TO_BOTTOM, + LEFT_TO_RIGHT, + BOTTOM_TO_TOP, + RIGHT_TO_LEFT +} Orientation; + + +typedef struct PagePrivate PagePrivate; + +typedef struct +{ + GObject parent_instance; + PagePrivate *priv; +} Page; + +typedef struct +{ + GObjectClass parent_class; + + void (*image_changed) (Page *page); + void (*size_changed) (Page *page); + void (*scan_line_changed) (Page *page); + void (*orientation_changed) (Page *page); + void (*crop_changed) (Page *page); +} PageClass; + + +GType page_get_type (void); + +Page *page_new (void); + +// FIXME: Should be part of page_new +void page_setup (Page *page, gint width, gint height, gint dpi, Orientation orientation); + +void page_set_scan_area (Page *page, gint width, gint rows, gint dpi); + +gint page_get_dpi (Page *page); + +gboolean page_is_landscape (Page *page); + +gint page_get_width (Page *page); + +gint page_get_height (Page *page); + +gint page_get_scan_width (Page *page); + +gint page_get_scan_height (Page *page); + +void page_set_color_profile (Page *page, const gchar *color_profile); + +const gchar *page_get_color_profile (Page *page); + +void page_start (Page *page); + +gboolean page_is_scanning (Page *page); + +gboolean page_has_data (Page *page); + +gint page_get_scan_line (Page *page); + +void page_parse_scan_line (Page *page, ScanLine *line); + +void page_finish (Page *page); + +Orientation page_get_orientation (Page *page); + +void page_set_orientation (Page *page, Orientation orientation); + +void page_rotate_left (Page *page); + +void page_rotate_right (Page *page); + +void page_set_no_crop (Page *page); + +void page_set_custom_crop (Page *page, gint width, gint height); + +void page_set_named_crop (Page *page, const gchar *name); + +void page_move_crop (Page *page, gint x, gint y); + +void page_rotate_crop (Page *page); + +gboolean page_has_crop (Page *page); + +void page_get_crop (Page *page, gint *x, gint *y, gint *width, gint *height); + +gchar *page_get_named_crop (Page *page); + +GdkPixbuf *page_get_image (Page *page); + +GdkPixbuf *page_get_cropped_image (Page *page); + +gboolean page_save (Page *page, const gchar *type, GFile *file, GError **error); + +#endif /* _PAGE_H_ */ -- cgit v1.2.3