]> git.street.me.uk Git - andy/viking.git/blob - src/print-preview.h
[QA] Reusable function for freeing the waypoint image cache.
[andy/viking.git] / src / print-preview.h
1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
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
19 #ifndef __VIK_PRINT_PREVIEW_H__
20 #define __VIK_PRINT_PREVIEW_H__
21
22 G_BEGIN_DECLS
23
24
25 #define VIK_TYPE_PRINT_PREVIEW            (vik_print_preview_get_type ())
26 #define VIK_PRINT_PREVIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIK_TYPE_PRINT_PREVIEW, VikPrintPreview))
27 #define VIK_PRINT_PREVIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), VIK_TYPE_PRINT_PREVIEW, VikPrintPreviewClass))
28 #define VIK_IS_PRINT_PREVIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIK_TYPE_PRINT_PREVIEW))
29 #define VIK_IS_PRINT_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIK_TYPE_PRINT_PREVIEW))
30 #define VIK_PRINT_PREVIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), VIK_TYPE_PRINT_PREVIEW, VikPrintPreviewClass))
31
32 typedef struct _VikPrintPreview       VikPrintPreview;
33 typedef struct _VikPrintPreviewClass  VikPrintPreviewClass;
34
35 struct _VikPrintPreview
36 {
37   GtkAspectFrame  parent_instance;
38
39   GtkWidget      *area;
40   GtkPageSetup   *page;
41   GdkPixbuf      *pixbuf;
42   gboolean        dragging;
43
44   GdkDrawable    *drawable;
45
46   gdouble         image_offset_x;
47   gdouble         image_offset_y;
48   gdouble         image_offset_x_max;
49   gdouble         image_offset_y_max;
50   gdouble         image_xres;
51   gdouble         image_yres;
52
53   gboolean        use_full_page;
54 };
55
56 struct _VikPrintPreviewClass
57 {
58   GtkAspectFrameClass  parent_class;
59
60   void (* offsets_changed)  (VikPrintPreview *print_preview,
61                              gint              offset_x,
62                              gint              offset_y);
63 };
64
65
66 GType       vik_print_preview_get_type          (void) G_GNUC_CONST;
67
68 GtkWidget * vik_print_preview_new               (GtkPageSetup     *page,
69                                                   GdkDrawable     *drawable);
70
71 void        vik_print_preview_set_image_dpi     (VikPrintPreview *preview,
72                                                   gdouble           xres,
73                                                   gdouble           yres);
74
75 void        vik_print_preview_set_page_setup    (VikPrintPreview *preview,
76                                                   GtkPageSetup     *page);
77
78 void        vik_print_preview_set_image_offsets (VikPrintPreview *preview,
79                                                   gdouble           offset_x,
80                                                   gdouble           offset_y);
81
82 void        vik_print_preview_set_image_offsets_max (VikPrintPreview *preview,
83                                                       gdouble           offset_x_max,
84                                                       gdouble           offset_y_max);
85
86 void        vik_print_preview_set_use_full_page (VikPrintPreview *preview,
87                                                   gboolean          full_page);
88
89 G_END_DECLS
90
91 #endif /* __VIK_PRINT_PREVIEW_H__ */