~ubuntu-branches/ubuntu/trusty/simple-scan/trusty

« back to all changes in this revision

Viewing changes to src/page.h

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-08-30 12:58:27 UTC
  • mfrom: (1.3.9 upstream) (14.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20110830125827-mwqlif9tedhve29x
Tags: 3.1.5-1
* New upstream release:
  - Fix compile warnings
  - Port to Vala
  - Port to GTK3
  - Port to GDBus
  - Port to GSettings
  - Port to colord
* debian/control:
  - Port build-deps to Vala.
* Refresh patches.
* debian/watch: Look for *.bz2 tarballs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2009 Canonical Ltd.
3
 
 * Author: Robert Ancell <robert.ancell@canonical.com>
4
 
 * 
5
 
 * This program is free software: you can redistribute it and/or modify it under
6
 
 * the terms of the GNU General Public License as published by the Free Software
7
 
 * Foundation, either version 3 of the License, or (at your option) any later
8
 
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
9
 
 * license.
10
 
 */
11
 
 
12
 
#ifndef _PAGE_H_
13
 
#define _PAGE_H_
14
 
 
15
 
#include <glib-object.h>
16
 
#include <gio/gio.h>
17
 
#include <gdk-pixbuf/gdk-pixbuf.h>
18
 
#include "scanner.h"
19
 
 
20
 
G_BEGIN_DECLS
21
 
 
22
 
#define PAGE_TYPE  (page_get_type ())
23
 
#define PAGE(obj)  (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAGE_TYPE, Page))
24
 
    
25
 
typedef enum
26
 
{
27
 
    TOP_TO_BOTTOM,
28
 
    LEFT_TO_RIGHT,
29
 
    BOTTOM_TO_TOP,
30
 
    RIGHT_TO_LEFT
31
 
} ScanDirection;
32
 
 
33
 
 
34
 
typedef struct PagePrivate PagePrivate;
35
 
 
36
 
typedef struct
37
 
{
38
 
    GObject      parent_instance;
39
 
    PagePrivate *priv;
40
 
} Page;
41
 
 
42
 
typedef struct
43
 
{
44
 
    GObjectClass parent_class;
45
 
 
46
 
    void (*pixels_changed) (Page *page);
47
 
    void (*size_changed) (Page *page);
48
 
    void (*scan_line_changed) (Page *page);
49
 
    void (*scan_direction_changed) (Page *page);
50
 
    void (*crop_changed) (Page *page);
51
 
} PageClass;
52
 
 
53
 
 
54
 
GType page_get_type (void);
55
 
 
56
 
Page *page_new (gint width, gint height, gint dpi, ScanDirection scan_direction);
57
 
 
58
 
void page_set_page_info (Page *page, ScanPageInfo *info);
59
 
 
60
 
gint page_get_dpi (Page *page);
61
 
 
62
 
gint page_get_width (Page *page);
63
 
 
64
 
gint page_get_height (Page *page);
65
 
 
66
 
gint page_get_depth (Page *page);
67
 
 
68
 
gint page_get_n_channels (Page *page);
69
 
 
70
 
gint page_get_rowstride (Page *page);
71
 
 
72
 
const guchar *page_get_pixels (Page *page);
73
 
 
74
 
guchar *page_get_pixel (Page *page, gint x, gint y);
75
 
 
76
 
gboolean page_is_landscape (Page *page);
77
 
 
78
 
gint page_get_scan_width (Page *page);
79
 
 
80
 
gint page_get_scan_height (Page *page);
81
 
 
82
 
void page_set_color_profile (Page *page, const gchar *color_profile);
83
 
 
84
 
const gchar *page_get_color_profile (Page *page);
85
 
 
86
 
void page_start (Page *page);
87
 
 
88
 
gboolean page_is_scanning (Page *page);
89
 
 
90
 
gboolean page_has_data (Page *page);
91
 
 
92
 
gboolean page_is_color (Page *page);
93
 
 
94
 
gint page_get_scan_line (Page *page);
95
 
 
96
 
void page_parse_scan_line (Page *page, ScanLine *line);
97
 
 
98
 
void page_finish (Page *page);
99
 
 
100
 
ScanDirection page_get_scan_direction (Page *page);
101
 
 
102
 
void page_rotate_left (Page *page);
103
 
 
104
 
void page_rotate_right (Page *page);
105
 
 
106
 
void page_set_no_crop (Page *page);
107
 
 
108
 
void page_set_custom_crop (Page *page, gint width, gint height);
109
 
 
110
 
void page_set_named_crop (Page *page, const gchar *name);
111
 
 
112
 
void page_move_crop (Page *page, gint x, gint y);
113
 
 
114
 
void page_rotate_crop (Page *page);
115
 
 
116
 
gboolean page_has_crop (Page *page);
117
 
 
118
 
void page_get_crop (Page *page, gint *x, gint *y, gint *width, gint *height);
119
 
 
120
 
gchar *page_get_named_crop (Page *page);
121
 
 
122
 
GdkPixbuf *page_get_image (Page *page, gboolean apply_crop);
123
 
 
124
 
gboolean page_save (Page *page, const gchar *type, GFile *file, GError **error);
125
 
 
126
 
#endif /* _PAGE_H_ */