~ubuntu-branches/ubuntu/oneiric/evince/oneiric-updates

« back to all changes in this revision

Viewing changes to shell/ev-jobs.h

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette, Josselin Mouette, Marc 'HE' Brockschmidt
  • Date: 2008-12-31 16:41:58 UTC
  • mfrom: (1.1.36 upstream)
  • mto: (1.5.1 sid)
  • mto: This revision was merged to the branch mainline in revision 109.
  • Revision ID: james.westby@ubuntu.com-20081231164158-xnobl1sokvvc6ho8
Tags: 2.24.2-1
[ Josselin Mouette ]
* README.Debian: document that you need to install poppler-data.
  Closes: #506836.

[ Marc 'HE' Brockschmidt ]
* debian/control: Make the Gnome team maintainer. I'm not doing the job
   anyway.

[ Josselin Mouette ]
* New upstream release.
* Require nautilus 2.22 to build the extension for the correct 
  version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* this file is part of evince, a gnome document viewer
2
2
 *
 
3
 *  Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
3
4
 *  Copyright (C) 2005 Red Hat, Inc
4
5
 *
5
6
 * Evince is free software; you can redistribute it and/or modify it
20
21
#ifndef __EV_JOBS_H__
21
22
#define __EV_JOBS_H__
22
23
 
 
24
#include <gio/gio.h>
23
25
#include <gtk/gtk.h>
 
26
 
24
27
#include "ev-document.h"
 
28
#include "ev-selection.h"
25
29
#include "ev-window.h"
26
 
#include "ev-selection.h"
27
30
 
28
31
G_BEGIN_DECLS
29
32
 
39
42
typedef struct _EvJobLinks EvJobLinks;
40
43
typedef struct _EvJobLinksClass EvJobLinksClass;
41
44
 
 
45
typedef struct _EvJobAttachments EvJobAttachments;
 
46
typedef struct _EvJobAttachmentsClass EvJobAttachmentsClass;
 
47
 
42
48
typedef struct _EvJobFonts EvJobFonts;
43
49
typedef struct _EvJobFontsClass EvJobFontsClass;
44
50
 
51
57
typedef struct _EvJobPrint EvJobPrint;
52
58
typedef struct _EvJobPrintClass EvJobPrintClass;
53
59
 
 
60
typedef struct _EvJobFind EvJobFind;
 
61
typedef struct _EvJobFindClass EvJobFindClass;
 
62
 
54
63
#define EV_TYPE_JOB                          (ev_job_get_type())
55
64
#define EV_JOB(object)                       (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB, EvJob))
56
65
#define EV_JOB_CLASS(klass)                  (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB, EvJobClass))
57
66
#define EV_IS_JOB(object)                    (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB))
 
67
#define EV_JOB_GET_CLASS(object)             (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_JOB, EvJobClass))
58
68
 
59
69
#define EV_TYPE_JOB_LINKS                    (ev_job_links_get_type())
60
70
#define EV_JOB_LINKS(object)                 (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LINKS, EvJobLinks))
61
71
#define EV_JOB_LINKS_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LINKS, EvJobLinksClass))
62
72
#define EV_IS_JOB_LINKS(object)              (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LINKS))
63
73
 
 
74
#define EV_TYPE_JOB_ATTACHMENTS              (ev_job_attachments_get_type())
 
75
#define EV_JOB_ATTACHMENTS(object)           (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_ATTACHMENTS, EvJobAttachments))
 
76
#define EV_JOB_ATTACHMENTS_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_ATTACHMENTS, EvJobAttachmentsClass))
 
77
#define EV_IS_JOB_ATTACHMENTS(object)        (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_ATTACHMENTS))
 
78
 
64
79
#define EV_TYPE_JOB_RENDER                   (ev_job_render_get_type())
65
80
#define EV_JOB_RENDER(object)                (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_RENDER, EvJobRender))
66
81
#define EV_JOB_RENDER_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_RENDER, EvJobRenderClass))
91
106
#define EV_JOB_PRINT_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_PRINT, EvJobPrintClass))
92
107
#define EV_IS_JOB_PRINT(object)              (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_PRINT))
93
108
 
 
109
#define EV_TYPE_JOB_FIND                    (ev_job_find_get_type())
 
110
#define EV_JOB_FIND(object)                 (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_FIND, EvJobFind))
 
111
#define EV_JOB_FIND_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_FIND, EvJobFindClass))
 
112
#define EV_IS_JOB_FIND(object)              (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_FIND))
 
113
 
94
114
typedef enum {
95
 
        EV_JOB_PRIORITY_LOW,
96
 
        EV_JOB_PRIORITY_HIGH,
97
 
} EvJobPriority;
 
115
        EV_JOB_RUN_THREAD,
 
116
        EV_JOB_RUN_MAIN_LOOP
 
117
} EvJobRunMode;
98
118
 
99
119
struct _EvJob
100
120
{
101
121
        GObject parent;
 
122
        
102
123
        EvDocument *document;
103
 
        gboolean finished;
104
 
        gboolean async;
 
124
 
 
125
        EvJobRunMode run_mode;
 
126
 
 
127
        guint cancelled : 1;
 
128
        guint finished : 1;
 
129
        guint failed : 1;
 
130
        
 
131
        GError *error;
 
132
        GCancellable *cancellable;
 
133
 
 
134
        guint idle_finished_id;
 
135
        guint idle_cancelled_id;
105
136
};
106
137
 
107
138
struct _EvJobClass
108
139
{
109
140
        GObjectClass parent_class;
110
141
 
111
 
        void    (* finished) (EvJob *job);
 
142
        gboolean (*run)         (EvJob *job);
 
143
        
 
144
        /* Signals */
 
145
        void     (* cancelled)  (EvJob *job);
 
146
        void     (* finished)   (EvJob *job);
112
147
};
113
148
 
114
149
struct _EvJobLinks
123
158
        EvJobClass parent_class;
124
159
};
125
160
 
 
161
struct _EvJobAttachments
 
162
{
 
163
        EvJob parent;
 
164
 
 
165
        GList *attachments;
 
166
};
 
167
 
 
168
struct _EvJobAttachmentsClass
 
169
{
 
170
        EvJobClass parent_class;
 
171
};
 
172
 
 
173
typedef enum {
 
174
        EV_RENDER_INCLUDE_NONE      = 0,
 
175
        EV_RENDER_INCLUDE_LINKS     = 1 << 0,
 
176
        EV_RENDER_INCLUDE_TEXT      = 1 << 1,
 
177
        EV_RENDER_INCLUDE_SELECTION = 1 << 2,
 
178
        EV_RENDER_INCLUDE_IMAGES    = 1 << 3,
 
179
        EV_RENDER_INCLUDE_FORMS     = 1 << 4,
 
180
        EV_RENDER_INCLUDE_ALL       = (1 << 5) - 1
 
181
} EvRenderFlags;
 
182
 
126
183
struct _EvJobRender
127
184
{
128
185
        EvJob parent;
129
186
 
130
 
        EvRenderContext *rc;
 
187
        gint page;
 
188
        gint rotation;
 
189
        gdouble scale;
 
190
 
 
191
        EvPage *ev_page;
131
192
        gboolean page_ready;
132
193
        gint target_width;
133
194
        gint target_height;
145
206
        GdkColor base;
146
207
        GdkColor text; 
147
208
 
148
 
        gint include_forms : 1;
149
 
        gint include_links : 1;
150
 
        gint include_text : 1;
151
 
        gint include_selection : 1;
152
 
        gint include_images : 1;
 
209
        EvRenderFlags flags;
153
210
};
154
211
 
155
212
struct _EvJobRenderClass
163
220
{
164
221
        EvJob parent;
165
222
 
166
 
        EvRenderContext *rc;
 
223
        gint page;
 
224
        gint rotation;
 
225
        gdouble scale;
 
226
        
167
227
        GdkPixbuf *thumbnail;
168
228
};
169
229
 
181
241
struct _EvJobFontsClass
182
242
{
183
243
        EvJobClass parent_class;
 
244
 
 
245
        /* Signals */
 
246
        void (* updated)  (EvJobFonts *job,
 
247
                           gdouble     progress);
184
248
};
185
249
 
186
250
struct _EvJobLoad
190
254
        EvLinkDest *dest;
191
255
        EvWindowRunMode mode;
192
256
        gchar *search_string;
193
 
        GError *error;
194
257
        gchar *uri;
 
258
        gchar *password;
195
259
};
196
260
 
197
261
struct _EvJobLoadClass
203
267
{
204
268
        EvJob parent;
205
269
 
206
 
        GError *error;
207
270
        gchar *uri;
208
271
        gchar *document_uri;
209
272
};
217
280
{
218
281
        EvJob parent;
219
282
 
220
 
        GError *error;
221
283
        const gchar *format;
222
284
        gchar  *temp_file;
223
285
        EvPrintRange *ranges;
236
298
        EvJobClass parent_class;
237
299
};
238
300
 
 
301
struct _EvJobFind
 
302
{
 
303
        EvJob parent;
 
304
 
 
305
        gint start_page;
 
306
        gint current_page;
 
307
        gint n_pages;
 
308
        GList **pages;
 
309
        gchar *text;
 
310
        gboolean case_sensitive;
 
311
        gboolean has_results;
 
312
};
 
313
 
 
314
struct _EvJobFindClass
 
315
{
 
316
        EvJobClass parent_class;
 
317
 
 
318
        /* Signals */
 
319
        void (* updated)  (EvJobFind *job,
 
320
                           gint       page);
 
321
};
 
322
 
239
323
/* Base job class */
240
324
GType           ev_job_get_type           (void) G_GNUC_CONST;
241
 
void            ev_job_finished           (EvJob          *job);
 
325
gboolean        ev_job_run                (EvJob          *job);
 
326
void            ev_job_cancel             (EvJob          *job);
 
327
void            ev_job_failed             (EvJob          *job,
 
328
                                           GQuark          domain,
 
329
                                           gint            code,
 
330
                                           const gchar    *format,
 
331
                                           ...);
 
332
void            ev_job_failed_from_error  (EvJob          *job,
 
333
                                           GError         *error);
 
334
void            ev_job_succeeded          (EvJob          *job);
 
335
gboolean        ev_job_is_cancelled       (EvJob          *job);
 
336
gboolean        ev_job_is_finished        (EvJob          *job);
 
337
gboolean        ev_job_is_failed          (EvJob          *job);
 
338
EvJobRunMode    ev_job_get_run_mode       (EvJob          *job);
 
339
void            ev_job_set_run_mode       (EvJob          *job,
 
340
                                           EvJobRunMode    run_mode);
242
341
 
243
342
/* EvJobLinks */
244
343
GType           ev_job_links_get_type     (void) G_GNUC_CONST;
245
344
EvJob          *ev_job_links_new          (EvDocument     *document);
246
 
void            ev_job_links_run          (EvJobLinks     *thumbnail);
 
345
 
 
346
/* EvJobAttachments */
 
347
GType           ev_job_attachments_get_type (void) G_GNUC_CONST;
 
348
EvJob          *ev_job_attachments_new      (EvDocument     *document);
247
349
 
248
350
/* EvJobRender */
249
351
GType           ev_job_render_get_type    (void) G_GNUC_CONST;
250
352
EvJob          *ev_job_render_new         (EvDocument      *document,
251
 
                                           EvRenderContext *rc,
 
353
                                           gint             page,
 
354
                                           gint             rotation,
 
355
                                           gdouble          scale,
252
356
                                           gint             width,
253
357
                                           gint             height,
 
358
                                           EvRenderFlags    flags);
 
359
void     ev_job_render_set_selection_info (EvJobRender     *job,
254
360
                                           EvRectangle     *selection_points,
255
361
                                           EvSelectionStyle selection_style,
256
362
                                           GdkColor        *text,
257
 
                                           GdkColor        *base,
258
 
                                           gboolean         include_forms,
259
 
                                           gboolean         include_links,
260
 
                                           gboolean         include_images,
261
 
                                           gboolean         include_text,
262
 
                                           gboolean         include_selection);
263
 
void            ev_job_render_run         (EvJobRender     *thumbnail);
264
 
 
 
363
                                           GdkColor        *base);
265
364
/* EvJobThumbnail */
266
365
GType           ev_job_thumbnail_get_type (void) G_GNUC_CONST;
267
366
EvJob          *ev_job_thumbnail_new      (EvDocument      *document,
268
 
                                           EvRenderContext *rc);
269
 
void            ev_job_thumbnail_run      (EvJobThumbnail  *thumbnail);
270
 
 
 
367
                                           gint             page,
 
368
                                           gint             rotation,
 
369
                                           gdouble          scale);
271
370
/* EvJobFonts */
272
371
GType           ev_job_fonts_get_type     (void) G_GNUC_CONST;
273
372
EvJob          *ev_job_fonts_new          (EvDocument      *document);
274
 
void            ev_job_fonts_run          (EvJobFonts      *fonts);
275
373
 
276
374
/* EvJobLoad */
277
375
GType           ev_job_load_get_type      (void) G_GNUC_CONST;
281
379
                                           const gchar     *search_string);
282
380
void            ev_job_load_set_uri       (EvJobLoad       *load,
283
381
                                           const gchar     *uri);
284
 
void            ev_job_load_run           (EvJobLoad       *load);
 
382
void            ev_job_load_set_password  (EvJobLoad       *job,
 
383
                                           const gchar     *password);
285
384
 
286
385
/* EvJobSave */
287
386
GType           ev_job_save_get_type      (void) G_GNUC_CONST;
288
387
EvJob          *ev_job_save_new           (EvDocument      *document,
289
388
                                           const gchar     *uri,
290
389
                                           const gchar     *document_uri);
291
 
void            ev_job_save_run           (EvJobSave       *save);
292
390
 
293
391
/* EvJobPrint */
294
392
GType           ev_job_print_get_type     (void) G_GNUC_CONST;
303
401
                                           gint             copies,
304
402
                                           gdouble          collate,
305
403
                                           gdouble          reverse);
306
 
void            ev_job_print_run          (EvJobPrint      *print);
 
404
/* EvJobFind */
 
405
GType           ev_job_find_get_type      (void) G_GNUC_CONST;
 
406
EvJob          *ev_job_find_new           (EvDocument      *document,
 
407
                                           gint             start_page,
 
408
                                           gint             n_pages,
 
409
                                           const gchar     *text,
 
410
                                           gboolean         case_sensitive);
 
411
gint            ev_job_find_get_n_results (EvJobFind       *job,
 
412
                                           gint             pages);
 
413
gdouble         ev_job_find_get_progress  (EvJobFind       *job);
 
414
gboolean        ev_job_find_has_results   (EvJobFind       *job);
 
415
GList         **ev_job_find_get_results   (EvJobFind       *job);
307
416
 
308
417
G_END_DECLS
309
418