RSSyl: Allow use of .netrc by libcurl. Bug/enhancement #3309, by Vincent Pelletier
[claws.git] / src / plugins / pdf_viewer / poppler_viewer.h
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2007 the Claws Mail Team
4  * This file Copyright (C) 2007 Salvatore De Paolis 
5  * <iwkse@claws-mail.org> 
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 #ifndef POPPLER_VIEWER_H
22 #define POPPLER_VIEWER_H
23
24 #ifdef HAVE_CONFIG_H
25 #  include "config.h"
26 #endif
27
28 //#include <unistd.h>
29 #include <stdio.h>
30 #include <gtk/gtk.h>
31 #include <gdk/gdkx.h>
32 #include <gdk/gdkkeysyms.h>
33 #include <poppler.h>
34 #include <version.h>
35 #include <plugin.h>
36 #include <messageview.h>
37 #include <mimeview.h>
38 #include <alertpanel.h>
39 #include <mimeview.h>
40
41 /*#ifdef USE_PTHREAD
42  *#include <pthread.h>
43  * #endif*/
44
45 #define ZOOM_FACTOR 0.25
46 #define ROTATION 90 
47 #define ALPHA_CHANNEL 60
48 #define SELECTION_COLOR 0xFF00FF
49
50 static gchar *msg = NULL;
51
52 struct _PageResult
53 {
54         GList *results;
55         gint page_num;
56 };
57
58 typedef struct _PageResult PageResult;
59
60 struct _PdfViewer
61 {
62         MimeViewer                      mimeviewer;
63         GtkWidget                       *widgets_table;
64         GtkWidget                       *vbox;
65         GtkWidget                       *hbox;
66         GtkWidget                       *frame_index;
67         GtkWidget                       *pdf_view;
68         GtkWidget                       *scrollwin;
69         GtkWidget                       *scrollwin_index;
70         GtkWidget                       *pdf_view_ebox;
71         GtkWidget                       *icon_type_ebox;
72         GtkWidget                       *icon_type;
73         GdkPixbuf                       *icon_pixbuf;
74         GtkWidget                       *doc_label;
75         GtkWidget                       *cur_page;
76         GtkWidget                       *doc_index_pane;
77         GtkWidget                       *index_list;
78         /* begin GtkButtons */
79         GtkWidget                       *first_page;
80         GtkWidget                       *last_page;
81         GtkWidget                       *prev_page;
82         GtkWidget                       *next_page;
83         GtkWidget                       *zoom_in;
84         GtkWidget                       *zoom_out;
85         GtkWidget                       *zoom_scroll;
86         GtkWidget                       *zoom_fit;
87         GtkWidget                       *zoom_width;
88         GtkWidget                       *rotate_left;
89         GtkWidget                       *rotate_right;
90         GtkWidget                       *doc_info;
91         GtkWidget                       *doc_index;
92         /* end GtkButtons */
93         GtkTable                        *table_doc_info;
94
95         PopplerDocument         *pdf_doc;
96         PopplerPage                     *pdf_page;
97         PopplerIndexIter        *pdf_index;
98         PopplerRectangle        *last_rect;
99         PopplerAction           *link_action;
100         PageResult                      *last_page_result;
101         GtkAdjustment           *pdf_view_vadj;
102         GtkAdjustment           *pdf_view_hadj;
103         GtkTreeModel            *index_model;
104
105         GList                           *link_map;
106         GList                           *page_results;
107         GList                           *text_found; /* GList of PageResults */
108         gchar                           *last_search;
109         gint                             last_match;
110         gint                             num_matches;
111
112         gchar                           *target_filename;
113         gchar                           *filename;
114         gchar                           *fsname;
115         gchar                           *doc_info_text;
116
117         gint                            res_cnt;
118         gint                            rotate;
119         gint                            num_pages;
120         gdouble                         zoom;
121         gdouble                         width;
122         gdouble                         height;
123         gdouble                         last_x;
124         gdouble                         last_y;
125         gint                            last_dir_x;
126         gint                            last_dir_y;
127         gboolean                        pdf_view_scroll;
128         gboolean                        in_link;
129         MimeInfo                        *mimeinfo;
130         MimeInfo                        *to_load;
131         
132 };
133 static gchar *content_types[] =
134         {"application/pdf", 
135          "application/postscript", 
136          NULL};
137 typedef enum {
138         TYPE_UNKNOWN,
139         TYPE_PDF,
140         TYPE_PS
141 } FileType;
142
143 enum {
144         INDEX_NAME,
145         INDEX_PAGE,
146         INDEX_TOP,
147         N_INDEX_COLUMNS
148 };
149
150 typedef struct _PdfViewer PdfViewer;
151
152 #endif /* POPPLER_VIEWER_H */