root/trunk/src/DocumentPage.h

Revision 277, 2.6 kB (checked in by jordi, 1 year ago)

Added a patch by Igor Vagulin which adds text selection and copy to clipboard features. This fixes bug #14.

Line 
1 // ePDFView - A lightweight PDF Viewer.
2 // Copyright (C) 2006 Emma's Software.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18 #if !defined (__DOCUMENT_PAGE_H__)
19 #define __DOCUMENT_PAGE_H__
20
21 typedef struct _GdkRegion GdkRegion;
22
23 namespace ePDFView
24 {
25     ///
26     /// @class DocumentPage
27     /// @brief A single document's page.
28     ///
29     /// Contains the rendered image of a single document's page.
30     ///
31     class DocumentPage
32     {
33         public:
34             DocumentPage (void);
35             ~DocumentPage (void);
36
37             void addLink (IDocumentLink *link);
38             void clearSelection (void);
39             guchar *getData (void);
40             gint getHeight (void);
41             IDocumentLink *getLinkAtPosition (gint x, gint y);
42             gint getRowStride (void);
43             gint getWidth (void);
44             gboolean newPage (gint width, gint height);
45             void setSelection (DocumentRectangle &selection, gdouble scale);
46             void setSelection (GdkRegion *region);
47
48         protected:
49             /// The page's image.
50             guchar *m_Data;
51             /// Tells if the page has a text selection.
52             gboolean m_HasSelection;
53             /// The page's height.
54             gint m_Height;
55             /// The selection top-left X coordinate.
56             gint m_SelectionX1;
57             /// The selection bottom-right X coordinate.
58             gint m_SelectionX2;
59             /// The selection top-left Y coordinate.
60             gint m_SelectionY1;
61             /// The selection bottom-right Y coordinate.
62             gint m_SelectionY2;
63             /// The page's width.
64             gint m_Width;
65             /// The list of links from the page.
66             GList *m_LinkList;
67             /// Selection region
68             GdkRegion *m_Selection;
69            
70             void invertRegion (GdkRegion*);
71             void invertArea (gint x1, gint y1, gint x2, gint y2);
72     };
73 }
74
75 #endif // !__DOCUMENT_PAGE_H__
Note: See TracBrowser for help on using the browser.