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