Mercurial > geeqie
annotate src/pixbuf-renderer.c @ 1768:a22c42d36e2e
German translation update
author | mow |
---|---|
date | Tue, 13 Oct 2009 21:49:42 +0000 |
parents | 9a351e8f3b97 |
children | 956aab097ea7 |
rev | line source |
---|---|
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1 /* |
196 | 2 * Geeqie |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3 * (C) 2006 John Ellis |
1284 | 4 * Copyright (C) 2008 - 2009 The Geeqie Team |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
5 * |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
6 * Author: John Ellis |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
7 * |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
8 * This software is released under the GNU General Public License (GNU GPL). |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
9 * Please read the included file COPYING for more information. |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
10 * This software comes with no warranty of any kind, use at your own risk! |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
11 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
12 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
13 #include <stdio.h> |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
14 #include <stdlib.h> |
507 | 15 #include <string.h> |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
16 #include <math.h> |
507 | 17 |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
18 #include "main.h" |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
19 #include "pixbuf-renderer.h" |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
20 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
21 #include "intl.h" |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
22 #include "layout.h" |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
23 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
24 #include <gtk/gtk.h> |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
25 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
26 |
196 | 27 /* comment this out if not using this from within Geeqie |
283 | 28 * defining GQ_BUILD does these things: |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
29 * - Sets the shift-click scroller pixbuf to a nice icon instead of a black box |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
30 */ |
283 | 31 #define GQ_BUILD 1 |
32 | |
33 #ifdef GQ_BUILD | |
507 | 34 #include "main.h" |
35 #include "pixbuf_util.h" | |
856
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
36 #include "exif.h" |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
37 #else |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
38 typedef enum { |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
39 EXIF_ORIENTATION_UNKNOWN = 0, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
40 EXIF_ORIENTATION_TOP_LEFT = 1, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
41 EXIF_ORIENTATION_TOP_RIGHT = 2, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
42 EXIF_ORIENTATION_BOTTOM_RIGHT = 3, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
43 EXIF_ORIENTATION_BOTTOM_LEFT = 4, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
44 EXIF_ORIENTATION_LEFT_TOP = 5, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
45 EXIF_ORIENTATION_RIGHT_TOP = 6, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
46 EXIF_ORIENTATION_RIGHT_BOTTOM = 7, |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
47 EXIF_ORIENTATION_LEFT_BOTTOM = 8 |
ff15a32ad17f
Only define ExifOrientationType if GQ_BUILD is not defined since
zas_
parents:
736
diff
changeset
|
48 } ExifOrientationType; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
49 #endif |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
50 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
51 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
52 /* size to use when breaking up image pane for rendering */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
53 #define PR_TILE_SIZE 128 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
54 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
55 /* default size of tile cache (mb) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
56 #define PR_CACHE_SIZE_DEFAULT 8 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
57 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
58 /* default min and max zoom */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
59 #define PR_ZOOM_MIN -32.0 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
60 #define PR_ZOOM_MAX 32.0 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
61 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
62 /* distance to drag mouse to disable image flip */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
63 #define PR_DRAG_SCROLL_THRESHHOLD 4 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
64 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
65 /* increase pan rate when holding down shift */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
66 #define PR_PAN_SHIFT_MULTIPLIER 6 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
67 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
68 /* scroller config */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
69 #define PR_SCROLLER_UPDATES_PER_SEC 30 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
70 #define PR_SCROLLER_DEAD_ZONE 6 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
71 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
72 /* alpha channel checkerboard background (same as gimp) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
73 #define PR_ALPHA_CHECK1 0x00999999 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
74 #define PR_ALPHA_CHECK2 0x00666666 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
75 #define PR_ALPHA_CHECK_SIZE 16 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
76 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
77 /* when scaling image to below this size, use nearest pixel for scaling |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
78 * (below about 4, the other scale types become slow generating their conversion tables) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
79 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
80 #define PR_MIN_SCALE_SIZE 8 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
81 |
1649 | 82 /* round A up/down to integer count of B */ |
83 #define ROUND_UP(A,B) ((gint)(((A)+(B)-1)/(B))*(B)) | |
84 #define ROUND_DOWN(A,B) ((gint)(((A))/(B))*(B)) | |
85 | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
86 typedef enum { |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
87 TILE_RENDER_NONE = 0, /* do nothing */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
88 TILE_RENDER_AREA, /* render an area of the tile */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
89 TILE_RENDER_ALL /* render the whole tile */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
90 } ImageTileRenderType; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
91 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
92 typedef struct _ImageTile ImageTile; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
93 typedef struct _QueueData QueueData; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
94 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
95 struct _ImageTile |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
96 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
97 GdkPixmap *pixmap; /* off screen buffer */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
98 GdkPixbuf *pixbuf; /* pixbuf area for zooming */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
99 gint x; /* x offset into image */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
100 gint y; /* y offset into image */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
101 gint w; /* width that is visible (may be less if at edge of image) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
102 gint h; /* height '' */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
103 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
104 gboolean blank; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
105 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
106 /* render_todo: (explanation) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
107 NONE do nothing |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
108 AREA render area of tile, usually only used when loading an image |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
109 note: will jump to an ALL if render_done is not ALL. |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
110 ALL render entire tile, if never done before w/ ALL, for expose events *only* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
111 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
112 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
113 ImageTileRenderType render_todo; /* what to do (see above) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
114 ImageTileRenderType render_done; /* highest that has been done before on tile */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
115 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
116 QueueData *qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
117 QueueData *qd2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
118 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
119 guint size; /* est. memory used by pixmap and pixbuf */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
120 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
121 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
122 struct _QueueData |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
123 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
124 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
125 gint x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
126 gint y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
127 gint w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
128 gint h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
129 gboolean new_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
130 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
131 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
132 typedef struct _SourceTile SourceTile; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
133 struct _SourceTile |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
134 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
135 gint x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
136 gint y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
137 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
138 gboolean blank; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
139 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
140 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
141 typedef struct _OverlayData OverlayData; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
142 struct _OverlayData |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
143 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
144 gint id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
145 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
146 GdkPixbuf *pixbuf; |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
147 GdkWindow *window; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
148 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
149 gint x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
150 gint y; |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
151 |
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
152 OverlayRendererFlags flags; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
153 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
154 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
155 enum { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
156 SIGNAL_ZOOM = 0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
157 SIGNAL_CLICKED, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
158 SIGNAL_SCROLL_NOTIFY, |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
159 SIGNAL_RENDER_COMPLETE, |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
160 SIGNAL_DRAG, |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
161 SIGNAL_UPDATE_PIXEL, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
162 SIGNAL_COUNT |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
163 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
164 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
165 enum { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
166 PROP_0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
167 PROP_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
168 PROP_ZOOM_MAX, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
169 PROP_ZOOM_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
170 PROP_ZOOM_2PASS, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
171 PROP_ZOOM_EXPAND, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
172 PROP_DITHER_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
173 PROP_SCROLL_RESET, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
174 PROP_DELAY_FLIP, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
175 PROP_LOADING, |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
176 PROP_COMPLETE, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
177 PROP_CACHE_SIZE_DISPLAY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
178 PROP_CACHE_SIZE_TILES, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
179 PROP_WINDOW_FIT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
180 PROP_WINDOW_LIMIT, |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
181 PROP_WINDOW_LIMIT_VALUE, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
182 PROP_AUTOFIT_LIMIT, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
183 PROP_AUTOFIT_LIMIT_VALUE |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
184 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
185 |
859 | 186 typedef enum { |
187 PR_ZOOM_NONE = 0, | |
188 PR_ZOOM_FORCE = 1 << 0, | |
189 PR_ZOOM_NEW = 1 << 1, | |
190 PR_ZOOM_CENTER = 1 << 2, | |
191 PR_ZOOM_INVALIDATE = 1 << 3, | |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
192 PR_ZOOM_LAZY = 1 << 4 /* wait with redraw for pixbuf_renderer_area_changed */ |
859 | 193 } PrZoomFlags; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
194 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
195 static guint signals[SIGNAL_COUNT] = { 0 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
196 static GtkEventBoxClass *parent_class = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
197 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
198 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
199 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
200 static void pixbuf_renderer_class_init(PixbufRendererClass *class); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
201 static void pixbuf_renderer_init(PixbufRenderer *pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
202 static void pixbuf_renderer_finalize(GObject *object); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
203 static void pixbuf_renderer_set_property(GObject *object, guint prop_id, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
204 const GValue *value, GParamSpec *pspec); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
205 static void pixbuf_renderer_get_property(GObject *object, guint prop_id, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
206 GValue *value, GParamSpec *pspec); |
1435 | 207 static gboolean pixbuf_renderer_expose(GtkWidget *widget, GdkEventExpose *event); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
208 |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
209 static void pr_render_complete_signal(PixbufRenderer *pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
210 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
211 static void pr_overlay_list_clear(PixbufRenderer *pr); |
1435 | 212 static void pr_scroller_timer_set(PixbufRenderer *pr, gboolean start); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
213 static void pr_border_draw(PixbufRenderer *pr, gint x, gint y, gint w, gint h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
214 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
215 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
216 static void pr_source_tile_free_all(PixbufRenderer *pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
217 static void pr_tile_free_all(PixbufRenderer *pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
218 static void pr_tile_invalidate_region(PixbufRenderer *pr, gint x, gint y, gint w, gint h); |
1435 | 219 static gboolean pr_tile_is_visible(PixbufRenderer *pr, ImageTile *it); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
220 static void pr_queue_clear(PixbufRenderer *pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
221 static void pr_queue_merge(QueueData *parent, QueueData *qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
222 static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
1435 | 223 gint clamp, ImageTileRenderType render, gboolean new_data, gboolean only_existing); |
224 | |
225 static void pr_redraw(PixbufRenderer *pr, gboolean new_data); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
226 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
227 static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom, |
859 | 228 PrZoomFlags flags, gint px, gint py); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
229 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
230 static void pr_signals_connect(PixbufRenderer *pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
231 static void pr_size_cb(GtkWidget *widget, GtkAllocation *allocation, gpointer data); |
1500 | 232 static void pr_hierarchy_changed_cb(GtkWidget *widget, GtkWidget *previous_toplevel, gpointer data); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
233 static void pixbuf_renderer_paint(PixbufRenderer *pr, GdkRectangle *area); |
1030 | 234 static gint pr_queue_draw_idle_cb(gpointer data); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
235 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
236 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
237 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
238 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
239 * Pixbuf Renderer object |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
240 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
241 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
242 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
243 GType pixbuf_renderer_get_type(void) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
244 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
245 static GType pixbuf_renderer_type = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
246 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
247 if (!pixbuf_renderer_type) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
248 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
249 static const GTypeInfo pixbuf_renderer_info = |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
250 { |
691 | 251 sizeof(PixbufRendererClass), /* class_size */ |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
252 NULL, /* base_init */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
253 NULL, /* base_finalize */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
254 (GClassInitFunc)pixbuf_renderer_class_init, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
255 NULL, /* class_finalize */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
256 NULL, /* class_data */ |
691 | 257 sizeof(PixbufRenderer), /* instance_size */ |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
258 0, /* n_preallocs */ |
691 | 259 (GInstanceInitFunc)pixbuf_renderer_init, /* instance_init */ |
260 NULL, /* value_table */ | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
261 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
262 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
263 pixbuf_renderer_type = g_type_register_static(GTK_TYPE_EVENT_BOX, "PixbufRenderer", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
264 &pixbuf_renderer_info, 0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
265 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
266 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
267 return pixbuf_renderer_type; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
268 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
269 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
270 static void pixbuf_renderer_class_init(PixbufRendererClass *class) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
271 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
272 GObjectClass *gobject_class = G_OBJECT_CLASS(class); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
273 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
274 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
275 parent_class = g_type_class_peek_parent(class); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
276 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
277 gobject_class->set_property = pixbuf_renderer_set_property; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
278 gobject_class->get_property = pixbuf_renderer_get_property; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
279 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
280 gobject_class->finalize = pixbuf_renderer_finalize; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
281 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
282 widget_class->expose_event = pixbuf_renderer_expose; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
283 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
284 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
285 PROP_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
286 g_param_spec_double("zoom_min", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
287 "Zoom minimum", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
288 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
289 -1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
290 1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
291 PR_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
292 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
293 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
294 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
295 PROP_ZOOM_MAX, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
296 g_param_spec_double("zoom_max", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
297 "Zoom maximum", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
298 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
299 -1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
300 1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
301 PR_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
302 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
303 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
304 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
305 PROP_ZOOM_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
306 g_param_spec_uint("zoom_quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
307 "Zoom quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
308 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
309 GDK_INTERP_NEAREST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
310 GDK_INTERP_HYPER, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
311 GDK_INTERP_BILINEAR, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
312 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
313 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
314 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
315 PROP_ZOOM_2PASS, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
316 g_param_spec_boolean("zoom_2pass", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
317 "2 pass zoom", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
318 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
319 TRUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
320 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
321 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
322 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
323 PROP_ZOOM_EXPAND, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
324 g_param_spec_boolean("zoom_expand", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
325 "Expand image in autozoom.", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
326 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
327 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
328 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
329 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
330 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
331 PROP_DITHER_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
332 g_param_spec_uint("dither_quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
333 "Dither quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
334 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
335 GDK_RGB_DITHER_NONE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
336 GDK_RGB_DITHER_MAX, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
337 GDK_RGB_DITHER_NORMAL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
338 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
339 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
340 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
341 PROP_SCROLL_RESET, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
342 g_param_spec_uint("scroll_reset", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
343 "New image scroll reset", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
344 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
345 PR_SCROLL_RESET_TOPLEFT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
346 PR_SCROLL_RESET_NOCHANGE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
347 PR_SCROLL_RESET_TOPLEFT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
348 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
349 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
350 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
351 PROP_DELAY_FLIP, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
352 g_param_spec_boolean("delay_flip", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
353 "Delay image update", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
354 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
355 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
356 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
357 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
358 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
359 PROP_LOADING, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
360 g_param_spec_boolean("loading", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
361 "Image actively loading", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
362 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
363 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
364 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
365 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
366 g_object_class_install_property(gobject_class, |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
367 PROP_COMPLETE, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
368 g_param_spec_boolean("complete", |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
369 "Image rendering complete", |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
370 NULL, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
371 FALSE, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
372 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
373 |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
374 g_object_class_install_property(gobject_class, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
375 PROP_CACHE_SIZE_DISPLAY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
376 g_param_spec_uint("cache_display", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
377 "Display cache size MB", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
378 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
379 0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
380 128, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
381 PR_CACHE_SIZE_DEFAULT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
382 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
383 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
384 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
385 PROP_CACHE_SIZE_TILES, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
386 g_param_spec_uint("cache_tiles", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
387 "Tile cache count", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
388 "Number of tiles to retain in memory at any one time.", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
389 0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
390 256, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
391 PR_CACHE_SIZE_DEFAULT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
392 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
393 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
394 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
395 PROP_WINDOW_FIT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
396 g_param_spec_boolean("window_fit", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
397 "Fit window to image size", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
398 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
399 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
400 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
401 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
402 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
403 PROP_WINDOW_LIMIT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
404 g_param_spec_boolean("window_limit", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
405 "Limit size of parent window", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
406 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
407 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
408 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
409 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
410 g_object_class_install_property(gobject_class, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
411 PROP_WINDOW_LIMIT_VALUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
412 g_param_spec_uint("window_limit_value", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
413 "Size limit of parent window", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
414 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
415 10, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
416 150, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
417 100, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
418 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
442 | 419 |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
420 g_object_class_install_property(gobject_class, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
421 PROP_AUTOFIT_LIMIT, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
422 g_param_spec_boolean("autofit_limit", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
423 "Limit size of image when autofitting", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
424 NULL, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
425 FALSE, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
426 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
427 |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
428 g_object_class_install_property(gobject_class, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
429 PROP_AUTOFIT_LIMIT_VALUE, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
430 g_param_spec_uint("autofit_limit_value", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
431 "Size limit of image when autofitting", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
432 NULL, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
433 10, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
434 150, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
435 100, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
436 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
437 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
438 |
442 | 439 signals[SIGNAL_ZOOM] = |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
440 g_signal_new("zoom", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
441 G_OBJECT_CLASS_TYPE(gobject_class), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
442 G_SIGNAL_RUN_LAST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
443 G_STRUCT_OFFSET(PixbufRendererClass, zoom), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
444 NULL, NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
445 g_cclosure_marshal_VOID__DOUBLE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
446 G_TYPE_NONE, 1, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
447 G_TYPE_DOUBLE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
448 |
442 | 449 signals[SIGNAL_CLICKED] = |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
450 g_signal_new("clicked", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
451 G_OBJECT_CLASS_TYPE(gobject_class), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
452 G_SIGNAL_RUN_LAST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
453 G_STRUCT_OFFSET(PixbufRendererClass, clicked), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
454 NULL, NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
455 g_cclosure_marshal_VOID__BOXED, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
456 G_TYPE_NONE, 1, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
457 GDK_TYPE_EVENT); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
458 |
442 | 459 signals[SIGNAL_SCROLL_NOTIFY] = |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
460 g_signal_new("scroll-notify", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
461 G_OBJECT_CLASS_TYPE(gobject_class), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
462 G_SIGNAL_RUN_LAST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
463 G_STRUCT_OFFSET(PixbufRendererClass, scroll_notify), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
464 NULL, NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
465 g_cclosure_marshal_VOID__VOID, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
466 G_TYPE_NONE, 0); |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
467 |
442 | 468 signals[SIGNAL_RENDER_COMPLETE] = |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
469 g_signal_new("render-complete", |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
470 G_OBJECT_CLASS_TYPE(gobject_class), |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
471 G_SIGNAL_RUN_LAST, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
472 G_STRUCT_OFFSET(PixbufRendererClass, render_complete), |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
473 NULL, NULL, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
474 g_cclosure_marshal_VOID__VOID, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
475 G_TYPE_NONE, 0); |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
476 |
442 | 477 signals[SIGNAL_DRAG] = |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
478 g_signal_new("drag", |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
479 G_OBJECT_CLASS_TYPE(gobject_class), |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
480 G_SIGNAL_RUN_LAST, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
481 G_STRUCT_OFFSET(PixbufRendererClass, drag), |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
482 NULL, NULL, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
483 g_cclosure_marshal_VOID__BOXED, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
484 G_TYPE_NONE, 1, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
485 GDK_TYPE_EVENT); |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
486 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
487 signals[SIGNAL_UPDATE_PIXEL] = |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
488 g_signal_new("update-pixel", |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
489 G_OBJECT_CLASS_TYPE(gobject_class), |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
490 G_SIGNAL_RUN_LAST, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
491 G_STRUCT_OFFSET(PixbufRendererClass, update_pixel), |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
492 NULL, NULL, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
493 g_cclosure_marshal_VOID__VOID, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
494 G_TYPE_NONE, 0); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
495 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
496 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
497 static void pixbuf_renderer_init(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
498 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
499 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
500 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
501 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
502 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
503 pr->zoom_min = PR_ZOOM_MIN; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
504 pr->zoom_max = PR_ZOOM_MAX; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
505 pr->zoom_quality = GDK_INTERP_BILINEAR; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
506 pr->zoom_2pass = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
507 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
508 pr->zoom = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
509 pr->scale = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
510 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
511 pr->dither_quality = GDK_RGB_DITHER_NORMAL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
512 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
513 pr->scroll_reset = PR_SCROLL_RESET_TOPLEFT; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
514 |
1523 | 515 pr->draw_idle_id = 0; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
516 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
517 pr->tile_width = PR_TILE_SIZE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
518 pr->tile_height = PR_TILE_SIZE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
519 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
520 pr->tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
521 pr->tile_cache_size = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
522 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
523 pr->tile_cache_max = PR_CACHE_SIZE_DEFAULT; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
524 |
1523 | 525 pr->scroller_id = 0; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
526 pr->scroller_overlay = -1; |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
527 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
528 pr->x_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
529 pr->y_mouse = -1; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
530 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
531 pr->source_tiles_enabled = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
532 pr->source_tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
533 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
534 pr->orientation = 1; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
535 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
536 pr->norm_center_x = 0.5; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
537 pr->norm_center_y = 0.5; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
538 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
539 gtk_widget_set_double_buffered(box, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
540 g_signal_connect_after(G_OBJECT(box), "size_allocate", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
541 G_CALLBACK(pr_size_cb), pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
542 |
1500 | 543 g_signal_connect(G_OBJECT(pr), "hierarchy-changed", |
544 G_CALLBACK(pr_hierarchy_changed_cb), pr); | |
1373 | 545 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
546 pr_signals_connect(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
547 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
548 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
549 static void pixbuf_renderer_finalize(GObject *object) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
550 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
551 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
552 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
553 pr = PIXBUF_RENDERER(object); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
554 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
555 pr_queue_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
556 pr_tile_free_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
557 |
1043 | 558 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
559 if (pr->pixbuf) g_object_unref(pr->pixbuf); |
1043 | 560 if (pr->spare_tile) g_object_unref(pr->spare_tile); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
561 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
562 pr_scroller_timer_set(pr, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
563 pr_overlay_list_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
564 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
565 pr_source_tile_free_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
566 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
567 |
1001 | 568 PixbufRenderer *pixbuf_renderer_new(void) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
569 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
570 return g_object_new(TYPE_PIXBUF_RENDERER, NULL); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
571 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
572 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
573 static void pixbuf_renderer_set_property(GObject *object, guint prop_id, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
574 const GValue *value, GParamSpec *pspec) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
575 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
576 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
577 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
578 pr = PIXBUF_RENDERER(object); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
579 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
580 switch (prop_id) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
581 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
582 case PROP_ZOOM_MIN: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
583 pr->zoom_min = g_value_get_double(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
584 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
585 case PROP_ZOOM_MAX: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
586 pr->zoom_max = g_value_get_double(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
587 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
588 case PROP_ZOOM_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
589 pr->zoom_quality = g_value_get_uint(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
590 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
591 case PROP_ZOOM_2PASS: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
592 pr->zoom_2pass = g_value_get_boolean(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
593 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
594 case PROP_ZOOM_EXPAND: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
595 pr->zoom_expand = g_value_get_boolean(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
596 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
597 case PROP_DITHER_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
598 pr->dither_quality = g_value_get_uint(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
599 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
600 case PROP_SCROLL_RESET: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
601 pr->scroll_reset = g_value_get_uint(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
602 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
603 case PROP_DELAY_FLIP: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
604 pr->delay_flip = g_value_get_boolean(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
605 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
606 case PROP_LOADING: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
607 pr->loading = g_value_get_boolean(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
608 break; |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
609 case PROP_COMPLETE: |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
610 pr->complete = g_value_get_boolean(value); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
611 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
612 case PROP_CACHE_SIZE_DISPLAY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
613 pr->tile_cache_max = g_value_get_uint(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
614 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
615 case PROP_CACHE_SIZE_TILES: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
616 pr->source_tiles_cache_size = g_value_get_uint(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
617 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
618 case PROP_WINDOW_FIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
619 pr->window_fit = g_value_get_boolean(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
620 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
621 case PROP_WINDOW_LIMIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
622 pr->window_limit = g_value_get_boolean(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
623 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
624 case PROP_WINDOW_LIMIT_VALUE: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
625 pr->window_limit_size = g_value_get_uint(value); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
626 break; |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
627 case PROP_AUTOFIT_LIMIT: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
628 pr->autofit_limit = g_value_get_boolean(value); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
629 break; |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
630 case PROP_AUTOFIT_LIMIT_VALUE: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
631 pr->autofit_limit_size = g_value_get_uint(value); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
632 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
633 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
634 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
635 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
636 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
637 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
638 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
639 static void pixbuf_renderer_get_property(GObject *object, guint prop_id, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
640 GValue *value, GParamSpec *pspec) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
641 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
642 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
643 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
644 pr = PIXBUF_RENDERER(object); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
645 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
646 switch (prop_id) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
647 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
648 case PROP_ZOOM_MIN: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
649 g_value_set_double(value, pr->zoom_min); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
650 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
651 case PROP_ZOOM_MAX: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
652 g_value_set_double(value, pr->zoom_max); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
653 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
654 case PROP_ZOOM_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
655 g_value_set_uint(value, pr->zoom_quality); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
656 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
657 case PROP_ZOOM_2PASS: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
658 g_value_set_boolean(value, pr->zoom_2pass); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
659 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
660 case PROP_ZOOM_EXPAND: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
661 g_value_set_boolean(value, pr->zoom_expand); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
662 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
663 case PROP_DITHER_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
664 g_value_set_uint(value, pr->dither_quality); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
665 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
666 case PROP_SCROLL_RESET: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
667 g_value_set_uint(value, pr->scroll_reset); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
668 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
669 case PROP_DELAY_FLIP: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
670 g_value_set_boolean(value, pr->delay_flip); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
671 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
672 case PROP_LOADING: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
673 g_value_set_boolean(value, pr->loading); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
674 break; |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
675 case PROP_COMPLETE: |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
676 g_value_set_boolean(value, pr->complete); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
677 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
678 case PROP_CACHE_SIZE_DISPLAY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
679 g_value_set_uint(value, pr->tile_cache_max); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
680 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
681 case PROP_CACHE_SIZE_TILES: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
682 g_value_set_uint(value, pr->source_tiles_cache_size); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
683 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
684 case PROP_WINDOW_FIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
685 g_value_set_boolean(value, pr->window_fit); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
686 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
687 case PROP_WINDOW_LIMIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
688 g_value_set_boolean(value, pr->window_limit); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
689 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
690 case PROP_WINDOW_LIMIT_VALUE: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
691 g_value_set_uint(value, pr->window_limit_size); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
692 break; |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
693 case PROP_AUTOFIT_LIMIT: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
694 g_value_set_boolean(value, pr->autofit_limit); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
695 break; |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
696 case PROP_AUTOFIT_LIMIT_VALUE: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
697 g_value_set_uint(value, pr->autofit_limit_size); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
698 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
699 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
700 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
701 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
702 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
703 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
704 |
1435 | 705 static gboolean pixbuf_renderer_expose(GtkWidget *widget, GdkEventExpose *event) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
706 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
707 if (GTK_WIDGET_DRAWABLE(widget)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
708 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
709 if (!GTK_WIDGET_NO_WINDOW(widget)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
710 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
711 if (event->window != widget->window) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
712 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
713 GdkRectangle area; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
714 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
715 gdk_window_get_position(event->window, &area.x, &area.y); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
716 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
717 area.x += event->area.x; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
718 area.y += event->area.y; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
719 area.width = event->area.width; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
720 area.height = event->area.height; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
721 pixbuf_renderer_paint(PIXBUF_RENDERER(widget), &area); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
722 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
723 else |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
724 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
725 pixbuf_renderer_paint(PIXBUF_RENDERER(widget), &event->area); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
726 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
727 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
728 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
729 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
730 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
731 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
732 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
733 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
734 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
735 * misc utilities |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
736 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
737 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
738 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
739 static void widget_set_cursor(GtkWidget *widget, gint icon) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
740 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
741 GdkCursor *cursor; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
742 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
743 if (!widget->window) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
744 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
745 if (icon == -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
746 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
747 cursor = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
748 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
749 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
750 { |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
751 cursor = gdk_cursor_new(icon); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
752 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
753 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
754 gdk_window_set_cursor(widget->window, cursor); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
755 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
756 if (cursor) gdk_cursor_unref(cursor); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
757 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
758 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
759 static gint pixmap_calc_size(GdkPixmap *pixmap) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
760 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
761 gint w, h, d; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
762 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
763 d = gdk_drawable_get_depth(pixmap); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
764 gdk_drawable_get_size(pixmap, &w, &h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
765 return w * h * (d / 8); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
766 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
767 |
1435 | 768 static gboolean pr_clip_region(gint x, gint y, gint w, gint h, |
769 gint clip_x, gint clip_y, gint clip_w, gint clip_h, | |
770 gint *rx, gint *ry, gint *rw, gint *rh) | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
771 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
772 if (clip_x + clip_w <= x || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
773 clip_x >= x + w || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
774 clip_y + clip_h <= y || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
775 clip_y >= y + h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
776 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
777 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
778 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
779 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
780 *rx = MAX(x, clip_x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
781 *rw = MIN((x + w), (clip_x + clip_w)) - *rx; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
782 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
783 *ry = MAX(y, clip_y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
784 *rh = MIN((y + h), (clip_y + clip_h)) - *ry; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
785 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
786 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
787 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
788 |
1435 | 789 static gboolean pr_parent_window_sizable(PixbufRenderer *pr) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
790 { |
27
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
791 GdkWindowState state; |
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
792 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
793 if (!pr->parent_window) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
794 if (!pr->window_fit) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
795 if (!GTK_WIDGET(pr)->window) return FALSE; |
27
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
796 |
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
797 if (!pr->parent_window->window) return FALSE; |
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
798 state = gdk_window_get_state(pr->parent_window->window); |
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
799 if (state & GDK_WINDOW_STATE_MAXIMIZED) return FALSE; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
800 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
801 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
802 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
803 |
1435 | 804 static gboolean pr_parent_window_resize(PixbufRenderer *pr, gint w, gint h) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
805 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
806 GtkWidget *widget; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
807 GtkWidget *parent; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
808 gint ww, wh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
809 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
810 if (!pr_parent_window_sizable(pr)) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
811 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
812 if (pr->window_limit) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
813 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
814 gint sw = gdk_screen_width() * pr->window_limit_size / 100; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
815 gint sh = gdk_screen_height() * pr->window_limit_size / 100; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
816 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
817 if (w > sw) w = sw; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
818 if (h > sh) h = sh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
819 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
820 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
821 widget = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
822 parent = GTK_WIDGET(pr->parent_window); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
823 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
824 w += (parent->allocation.width - widget->allocation.width); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
825 h += (parent->allocation.height - widget->allocation.height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
826 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
827 gdk_drawable_get_size(parent->window, &ww, &wh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
828 if (w == ww && h == wh) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
829 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
830 gdk_window_resize(parent->window, w, h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
831 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
832 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
833 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
834 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
835 void pixbuf_renderer_set_parent(PixbufRenderer *pr, GtkWindow *window) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
836 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
837 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
838 g_return_if_fail(window == NULL || GTK_IS_WINDOW(window)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
839 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
840 pr->parent_window = GTK_WIDGET(window); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
841 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
842 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
843 GtkWindow *pixbuf_renderer_get_parent(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
844 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
845 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), NULL); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
846 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
847 return GTK_WINDOW(pr->parent_window); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
848 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
849 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
850 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
851 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
852 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
853 * overlays |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
854 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
855 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
856 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
857 static void pr_overlay_get_position(PixbufRenderer *pr, OverlayData *od, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
858 gint *x, gint *y, gint *w, gint *h) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
859 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
860 gint px, py, pw, ph; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
861 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
862 pw = gdk_pixbuf_get_width(od->pixbuf); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
863 ph = gdk_pixbuf_get_height(od->pixbuf); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
864 px = od->x; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
865 py = od->y; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
866 |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
867 if (od->flags & OVL_RELATIVE) |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
868 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
869 if (px < 0) px = pr->window_width - pw + px; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
870 if (py < 0) py = pr->window_height - ph + py; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
871 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
872 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
873 if (x) *x = px; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
874 if (y) *y = py; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
875 if (w) *w = pw; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
876 if (h) *h = ph; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
877 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
878 |
1373 | 879 static void pr_overlay_init_window(PixbufRenderer *pr, OverlayData *od) |
880 { | |
881 gint px, py, pw, ph; | |
882 GdkWindowAttr attributes; | |
883 gint attributes_mask; | |
884 | |
885 pr_overlay_get_position(pr, od, &px, &py, &pw, &ph); | |
886 | |
887 attributes.window_type = GDK_WINDOW_CHILD; | |
888 attributes.wclass = GDK_INPUT_OUTPUT; | |
889 attributes.width = pw; | |
890 attributes.height = ph; | |
891 attributes.event_mask = GDK_EXPOSURE_MASK; | |
892 attributes_mask = 0; | |
893 | |
894 od->window = gdk_window_new(GTK_WIDGET(pr)->window, &attributes, attributes_mask); | |
895 gdk_window_set_user_data(od->window, pr); | |
896 gdk_window_move(od->window, px, py); | |
897 gdk_window_show(od->window); | |
898 } | |
899 | |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
900 static void pr_overlay_draw(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
901 ImageTile *it) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
902 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
903 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
904 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
905 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
906 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
907 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
908 work = pr->overlay_list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
909 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
910 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
911 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
912 gint px, py, pw, ph; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
913 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
914 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
915 od = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
916 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
917 |
1373 | 918 if (!od->window) pr_overlay_init_window(pr, od); |
919 | |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
920 pr_overlay_get_position(pr, od, &px, &py, &pw, &ph); |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
921 if (pr_clip_region(x, y, w, h, px, py, pw, ph, &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
922 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
923 if (!pr->overlay_buffer) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
924 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
925 pr->overlay_buffer = gdk_pixmap_new(((GtkWidget *)pr)->window, pr->tile_width, pr->tile_height, -1); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
926 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
927 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
928 if (it) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
929 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
930 gdk_draw_drawable(pr->overlay_buffer, box->style->fg_gc[GTK_WIDGET_STATE(box)], |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
931 it->pixmap, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
932 rx - (pr->x_offset + (it->x - pr->x_scroll)), |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
933 ry - (pr->y_offset + (it->y - pr->y_scroll)), |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
934 0, 0, rw, rh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
935 gdk_draw_pixbuf(pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
936 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
937 od->pixbuf, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
938 rx - px, ry - py, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
939 0, 0, rw, rh, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
940 pr->dither_quality, rx, ry); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
941 gdk_draw_drawable(od->window, box->style->fg_gc[GTK_WIDGET_STATE(box)], |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
942 pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
943 0, 0, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
944 rx - px, ry - py, rw, rh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
945 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
946 else |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
947 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
948 /* no ImageTile means region may be larger than our scratch buffer */ |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
949 gint sx, sy; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
950 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
951 for (sx = rx; sx < rx + rw; sx += pr->tile_width) |
517 | 952 for (sy = ry; sy < ry + rh; sy += pr->tile_height) |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
953 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
954 gint sw, sh; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
955 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
956 sw = MIN(rx + rw - sx, pr->tile_width); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
957 sh = MIN(ry + rh - sy, pr->tile_height); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
958 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
959 gdk_draw_rectangle(pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
960 box->style->bg_gc[GTK_WIDGET_STATE(box)], TRUE, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
961 0, 0, sw, sh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
962 gdk_draw_pixbuf(pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
963 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
964 od->pixbuf, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
965 sx - px, sy - py, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
966 0, 0, sw, sh, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
967 pr->dither_quality, sx, sy); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
968 gdk_draw_drawable(od->window, box->style->fg_gc[GTK_WIDGET_STATE(box)], |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
969 pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
970 0, 0, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
971 sx - px, sy - py, sw, sh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
972 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
973 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
974 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
975 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
976 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
977 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
978 static void pr_overlay_queue_draw(PixbufRenderer *pr, OverlayData *od) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
979 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
980 gint x, y, w, h; |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
981 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
982 pr_overlay_get_position(pr, od, &x, &y, &w, &h); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
983 pr_queue(pr, pr->x_scroll - pr->x_offset + x, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
984 pr->y_scroll - pr->y_offset + y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
985 w, h, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
986 FALSE, TILE_RENDER_ALL, FALSE, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
987 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
988 pr_border_draw(pr, x, y, w, h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
989 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
990 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
991 static void pr_overlay_queue_all(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
992 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
993 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
994 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
995 work = pr->overlay_list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
996 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
997 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
998 OverlayData *od = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
999 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1000 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1001 pr_overlay_queue_draw(pr, od); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1002 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1003 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1004 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1005 static void pr_overlay_update_sizes(PixbufRenderer *pr) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1006 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1007 GList *work; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1008 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1009 work = pr->overlay_list; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1010 while (work) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1011 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1012 OverlayData *od = work->data; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1013 work = work->next; |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1014 |
1373 | 1015 if (!od->window) pr_overlay_init_window(pr, od); |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1016 |
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1017 if (od->flags & OVL_RELATIVE) |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1018 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1019 gint x, y, w, h; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1020 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1021 pr_overlay_get_position(pr, od, &x, &y, &w, &h); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1022 gdk_window_move_resize(od->window, x, y, w, h); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1023 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1024 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1025 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1026 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1027 static OverlayData *pr_overlay_find(PixbufRenderer *pr, gint id) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1028 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1029 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1030 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1031 work = pr->overlay_list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1032 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1033 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1034 OverlayData *od = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1035 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1036 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1037 if (od->id == id) return od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1038 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1039 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1040 return NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1041 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1042 |
1373 | 1043 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1044 gint pixbuf_renderer_overlay_add(PixbufRenderer *pr, GdkPixbuf *pixbuf, gint x, gint y, |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1045 OverlayRendererFlags flags) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1046 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1047 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1048 gint id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1049 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1050 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), -1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1051 g_return_val_if_fail(pixbuf != NULL, -1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1052 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1053 id = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1054 while (pr_overlay_find(pr, id)) id++; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1055 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1056 od = g_new0(OverlayData, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1057 od->id = id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1058 od->pixbuf = pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1059 g_object_ref(G_OBJECT(od->pixbuf)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1060 od->x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1061 od->y = y; |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1062 od->flags = flags; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1063 |
1373 | 1064 pr_overlay_init_window(pr, od); |
1065 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1066 pr->overlay_list = g_list_append(pr->overlay_list, od); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1067 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1068 pr_overlay_queue_draw(pr, od); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1069 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1070 return od->id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1071 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1072 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1073 static void pr_overlay_free(PixbufRenderer *pr, OverlayData *od) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1074 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1075 pr->overlay_list = g_list_remove(pr->overlay_list, od); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1076 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1077 if (od->pixbuf) g_object_unref(G_OBJECT(od->pixbuf)); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1078 if (od->window) gdk_window_destroy(od->window); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1079 g_free(od); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1080 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1081 if (!pr->overlay_list && pr->overlay_buffer) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1082 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1083 g_object_unref(pr->overlay_buffer); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1084 pr->overlay_buffer = NULL; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1085 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1086 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1087 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1088 static void pr_overlay_list_clear(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1089 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1090 while (pr->overlay_list) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1091 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1092 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1093 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1094 od = pr->overlay_list->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1095 pr_overlay_free(pr, od); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1096 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1097 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1098 |
1373 | 1099 static void pr_overlay_list_reset_window(PixbufRenderer *pr) |
1100 { | |
1101 GList *work; | |
1102 | |
1103 if (pr->overlay_buffer) g_object_unref(pr->overlay_buffer); | |
1104 pr->overlay_buffer = NULL; | |
1105 | |
1106 work = pr->overlay_list; | |
1107 while (work) | |
1108 { | |
1109 OverlayData *od = work->data; | |
1110 work = work->next; | |
1111 if (od->window) gdk_window_destroy(od->window); | |
1112 od->window = NULL; | |
1113 } | |
1114 } | |
1115 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1116 void pixbuf_renderer_overlay_set(PixbufRenderer *pr, gint id, GdkPixbuf *pixbuf, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1117 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1118 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1119 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1120 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1121 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1122 od = pr_overlay_find(pr, id); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1123 if (!od) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1124 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1125 if (pixbuf) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1126 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1127 gint px, py, pw, ph; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1128 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1129 g_object_ref(G_OBJECT(pixbuf)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1130 g_object_unref(G_OBJECT(od->pixbuf)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1131 od->pixbuf = pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1132 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1133 od->x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1134 od->y = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1135 |
1517 | 1136 if (!od->window) pr_overlay_init_window(pr, od); |
1137 | |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1138 pr_overlay_queue_draw(pr, od); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1139 pr_overlay_get_position(pr, od, &px, &py, &pw, &ph); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1140 gdk_window_move_resize(od->window, px, py, pw, ph); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1141 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1142 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1143 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1144 pr_overlay_queue_draw(pr, od); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1145 pr_overlay_free(pr, od); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1146 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1147 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1148 |
1435 | 1149 gboolean pixbuf_renderer_overlay_get(PixbufRenderer *pr, gint id, GdkPixbuf **pixbuf, gint *x, gint *y) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1150 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1151 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1152 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1153 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1154 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1155 od = pr_overlay_find(pr, id); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1156 if (!od) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1157 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1158 if (pixbuf) *pixbuf = od->pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1159 if (x) *x = od->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1160 if (y) *y = od->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1161 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1162 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1163 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1164 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1165 void pixbuf_renderer_overlay_remove(PixbufRenderer *pr, gint id) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1166 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1167 pixbuf_renderer_overlay_set(pr, id, NULL, 0, 0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1168 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1169 |
1500 | 1170 static void pr_hierarchy_changed_cb(GtkWidget *widget, GtkWidget *previous_toplevel, gpointer data) |
1373 | 1171 { |
1172 PixbufRenderer *pr = data; | |
1173 pr_overlay_list_reset_window(pr); | |
1174 } | |
1175 | |
1176 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1177 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1178 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1179 * scroller overlay |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1180 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1181 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1182 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1183 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1184 static gboolean pr_scroller_update_cb(gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1185 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1186 PixbufRenderer *pr = data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1187 gint x, y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1188 gint xinc, yinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1189 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1190 /* this was a simple scroll by difference between scroller and mouse position, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1191 * but all this math results in a smoother result and accounts for a dead zone. |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1192 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1193 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1194 if (abs(pr->scroller_xpos - pr->scroller_x) < PR_SCROLLER_DEAD_ZONE) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1195 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1196 x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1197 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1198 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1199 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1200 gint shift = PR_SCROLLER_DEAD_ZONE / 2 * PR_SCROLLER_UPDATES_PER_SEC; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1201 x = (pr->scroller_xpos - pr->scroller_x) / 2 * PR_SCROLLER_UPDATES_PER_SEC; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1202 x += (x > 0) ? -shift : shift; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1203 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1204 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1205 if (abs(pr->scroller_ypos - pr->scroller_y) < PR_SCROLLER_DEAD_ZONE) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1206 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1207 y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1208 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1209 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1210 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1211 gint shift = PR_SCROLLER_DEAD_ZONE / 2 * PR_SCROLLER_UPDATES_PER_SEC; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1212 y = (pr->scroller_ypos - pr->scroller_y) / 2 * PR_SCROLLER_UPDATES_PER_SEC; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1213 y += (y > 0) ? -shift : shift; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1214 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1215 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1216 if (abs(x) < PR_SCROLLER_DEAD_ZONE * PR_SCROLLER_UPDATES_PER_SEC) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1217 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1218 xinc = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1219 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1220 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1221 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1222 xinc = pr->scroller_xinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1223 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1224 if (x >= 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1225 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1226 if (xinc < 0) xinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1227 if (x < xinc) xinc = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1228 if (x > xinc) xinc = MIN(xinc + x / PR_SCROLLER_UPDATES_PER_SEC, x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1229 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1230 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1231 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1232 if (xinc > 0) xinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1233 if (x > xinc) xinc = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1234 if (x < xinc) xinc = MAX(xinc + x / PR_SCROLLER_UPDATES_PER_SEC, x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1235 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1236 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1237 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1238 if (abs(y) < PR_SCROLLER_DEAD_ZONE * PR_SCROLLER_UPDATES_PER_SEC) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1239 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1240 yinc = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1241 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1242 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1243 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1244 yinc = pr->scroller_yinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1245 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1246 if (y >= 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1247 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1248 if (yinc < 0) yinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1249 if (y < yinc) yinc = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1250 if (y > yinc) yinc = MIN(yinc + y / PR_SCROLLER_UPDATES_PER_SEC, y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1251 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1252 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1253 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1254 if (yinc > 0) yinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1255 if (y > yinc) yinc = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1256 if (y < yinc) yinc = MAX(yinc + y / PR_SCROLLER_UPDATES_PER_SEC, y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1257 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1258 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1259 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1260 pr->scroller_xinc = xinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1261 pr->scroller_yinc = yinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1262 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1263 xinc = xinc / PR_SCROLLER_UPDATES_PER_SEC; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1264 yinc = yinc / PR_SCROLLER_UPDATES_PER_SEC; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1265 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1266 pixbuf_renderer_scroll(pr, xinc, yinc); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1267 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1268 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1269 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1270 |
1435 | 1271 static void pr_scroller_timer_set(PixbufRenderer *pr, gboolean start) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1272 { |
1523 | 1273 if (pr->scroller_id) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1274 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1275 g_source_remove(pr->scroller_id); |
1523 | 1276 pr->scroller_id = 0; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1277 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1278 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1279 if (start) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1280 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1281 pr->scroller_id = g_timeout_add(1000 / PR_SCROLLER_UPDATES_PER_SEC, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1282 pr_scroller_update_cb, pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1283 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1284 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1285 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1286 static void pr_scroller_start(PixbufRenderer *pr, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1287 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1288 if (pr->scroller_overlay == -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1289 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1290 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1291 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1292 |
283 | 1293 #ifdef GQ_BUILD |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1294 pixbuf = pixbuf_inline(PIXBUF_INLINE_SCROLLER); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1295 #else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1296 pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, 32, 32); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1297 gdk_pixbuf_fill(pixbuf, 0x000000ff); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1298 #endif |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1299 w = gdk_pixbuf_get_width(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1300 h = gdk_pixbuf_get_height(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1301 |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1302 pr->scroller_overlay = pixbuf_renderer_overlay_add(pr, pixbuf, x - w / 2, y - h / 2, OVL_NORMAL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1303 g_object_unref(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1304 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1305 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1306 pr->scroller_x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1307 pr->scroller_y = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1308 pr->scroller_xpos = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1309 pr->scroller_ypos = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1310 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1311 pr_scroller_timer_set(pr, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1312 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1313 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1314 static void pr_scroller_stop(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1315 { |
1523 | 1316 if (!pr->scroller_id) return; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1317 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1318 pixbuf_renderer_overlay_remove(pr, pr->scroller_overlay); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1319 pr->scroller_overlay = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1320 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1321 pr_scroller_timer_set(pr, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1322 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1323 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1324 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1325 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1326 * borders |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1327 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1328 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1329 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1330 static void pr_border_draw(PixbufRenderer *pr, gint x, gint y, gint w, gint h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1331 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1332 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1333 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1334 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1335 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1336 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1337 if (!box->window) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1338 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1339 if (!pr->pixbuf && !pr->source_tiles_enabled) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1340 { |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1341 if (pr_clip_region(x, y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1342 0, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1343 pr->window_width, pr->window_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1344 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1345 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1346 gdk_window_clear_area(box->window, rx, ry, rw, rh); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1347 pr_overlay_draw(pr, rx, ry, rw, rh, NULL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1348 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1349 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1350 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1351 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1352 if (pr->vis_width < pr->window_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1353 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1354 if (pr->x_offset > 0 && |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1355 pr_clip_region(x, y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1356 0, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1357 pr->x_offset, pr->window_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1358 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1359 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1360 gdk_window_clear_area(box->window, rx, ry, rw, rh); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1361 pr_overlay_draw(pr, rx, ry, rw, rh, NULL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1362 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1363 if (pr->window_width - pr->vis_width - pr->x_offset > 0 && |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1364 pr_clip_region(x, y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1365 pr->x_offset + pr->vis_width, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1366 pr->window_width - pr->vis_width - pr->x_offset, pr->window_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1367 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1368 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1369 gdk_window_clear_area(box->window, rx, ry, rw, rh); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1370 pr_overlay_draw(pr, rx, ry, rw, rh, NULL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1371 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1372 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1373 if (pr->vis_height < pr->window_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1374 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1375 if (pr->y_offset > 0 && |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1376 pr_clip_region(x, y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1377 pr->x_offset, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1378 pr->vis_width, pr->y_offset, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1379 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1380 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1381 gdk_window_clear_area(box->window, rx, ry, rw, rh); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1382 pr_overlay_draw(pr, rx, ry, rw, rh, NULL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1383 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1384 if (pr->window_height - pr->vis_height - pr->y_offset > 0 && |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1385 pr_clip_region(x, y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1386 pr->x_offset, pr->y_offset + pr->vis_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1387 pr->vis_width, pr->window_height - pr->vis_height - pr->y_offset, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1388 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1389 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1390 gdk_window_clear_area(box->window, rx, ry, rw, rh); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1391 pr_overlay_draw(pr, rx, ry, rw, rh, NULL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1392 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1393 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1394 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1395 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1396 static void pr_border_clear(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1397 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1398 pr_border_draw(pr, 0, 0, pr->window_width, pr->window_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1399 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1400 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1401 void pixbuf_renderer_set_color(PixbufRenderer *pr, GdkColor *color) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1402 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1403 GtkStyle *style; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1404 GtkWidget *widget; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1405 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1406 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1407 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1408 widget = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1409 |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1410 if (color) { |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1411 GdkColor *slot; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1412 |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1413 style = gtk_style_copy(gtk_widget_get_style(widget)); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1414 slot = &style->bg[GTK_STATE_NORMAL]; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1415 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1416 slot->red = color->red; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1417 slot->green = color->green; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1418 slot->blue = color->blue; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1419 } |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1420 else { |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1421 style = gtk_style_copy(gtk_widget_get_default_style()); |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1422 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1423 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1424 gtk_widget_set_style(widget, style); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1425 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1426 if (GTK_WIDGET_VISIBLE(widget)) pr_border_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1427 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1428 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1429 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1430 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1431 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1432 * source tiles |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1433 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1434 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1435 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1436 static void pr_source_tile_free(SourceTile *st) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1437 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1438 if (!st) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1439 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1440 if (st->pixbuf) g_object_unref(st->pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1441 g_free(st); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1442 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1443 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1444 static void pr_source_tile_free_all(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1445 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1446 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1447 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1448 work = pr->source_tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1449 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1450 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1451 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1452 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1453 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1454 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1455 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1456 pr_source_tile_free(st); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1457 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1458 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1459 g_list_free(pr->source_tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1460 pr->source_tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1461 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1462 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1463 static void pr_source_tile_unset(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1464 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1465 pr_source_tile_free_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1466 pr->source_tiles_enabled = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1467 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1468 |
1435 | 1469 static gboolean pr_source_tile_visible(PixbufRenderer *pr, SourceTile *st) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1470 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1471 gint x1, y1, x2, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1472 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1473 if (!st) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1474 |
1649 | 1475 x1 = ROUND_DOWN(pr->x_scroll, pr->tile_width); |
1476 y1 = ROUND_DOWN(pr->y_scroll, pr->tile_height); | |
1477 x2 = ROUND_UP(pr->x_scroll + pr->vis_width, pr->tile_width); | |
1478 y2 = ROUND_UP(pr->y_scroll + pr->vis_height, pr->tile_height); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1479 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1480 return !((gdouble)st->x * pr->scale > (gdouble)x2 || |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1481 (gdouble)(st->x + pr->source_tile_width) * pr->scale < (gdouble)x1 || |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1482 (gdouble)st->y * pr->scale > (gdouble)y2 || |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1483 (gdouble)(st->y + pr->source_tile_height) * pr->scale < (gdouble)y1); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1484 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1485 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1486 static SourceTile *pr_source_tile_new(PixbufRenderer *pr, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1487 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1488 SourceTile *st = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1489 gint count; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1490 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1491 g_return_val_if_fail(pr->source_tile_width >= 1 && pr->source_tile_height >= 1, NULL); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1492 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1493 if (pr->source_tiles_cache_size < 4) pr->source_tiles_cache_size = 4; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1494 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1495 count = g_list_length(pr->source_tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1496 if (count >= pr->source_tiles_cache_size) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1497 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1498 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1499 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1500 work = g_list_last(pr->source_tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1501 while (work && count >= pr->source_tiles_cache_size) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1502 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1503 SourceTile *needle; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1504 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1505 needle = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1506 work = work->prev; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1507 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1508 if (!pr_source_tile_visible(pr, needle)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1509 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1510 pr->source_tiles = g_list_remove(pr->source_tiles, needle); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1511 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1512 if (pr->func_tile_dispose) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1513 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1514 pr->func_tile_dispose(pr, needle->x, needle->y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1515 pr->source_tile_width, pr->source_tile_height, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1516 needle->pixbuf, pr->func_tile_data); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1517 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1518 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1519 if (!st) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1520 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1521 st = needle; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1522 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1523 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1524 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1525 pr_source_tile_free(needle); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1526 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1527 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1528 count--; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1529 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1530 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1531 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1532 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1533 if (!st) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1534 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1535 st = g_new0(SourceTile, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1536 st->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1537 pr->source_tile_width, pr->source_tile_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1538 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1539 |
1649 | 1540 st->x = ROUND_DOWN(x, pr->source_tile_width); |
1541 st->y = ROUND_DOWN(y, pr->source_tile_height); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1542 st->blank = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1543 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1544 pr->source_tiles = g_list_prepend(pr->source_tiles, st); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1545 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1546 return st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1547 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1548 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1549 static SourceTile *pr_source_tile_request(PixbufRenderer *pr, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1550 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1551 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1552 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1553 st = pr_source_tile_new(pr, x, y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1554 if (!st) return NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1555 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1556 if (pr->func_tile_request && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1557 pr->func_tile_request(pr, st->x, st->y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1558 pr->source_tile_width, pr->source_tile_height, st->pixbuf, pr->func_tile_data)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1559 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1560 st->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1561 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1562 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1563 pr_tile_invalidate_region(pr, st->x * pr->scale, st->y * pr->scale, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1564 pr->source_tile_width * pr->scale, pr->source_tile_height * pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1565 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1566 return st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1567 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1568 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1569 static SourceTile *pr_source_tile_find(PixbufRenderer *pr, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1570 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1571 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1572 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1573 work = pr->source_tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1574 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1575 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1576 SourceTile *st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1577 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1578 if (x >= st->x && x < st->x + pr->source_tile_width && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1579 y >= st->y && y < st->y + pr->source_tile_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1580 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1581 if (work != pr->source_tiles) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1582 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1583 pr->source_tiles = g_list_remove_link(pr->source_tiles, work); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1584 pr->source_tiles = g_list_concat(work, pr->source_tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1585 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1586 return st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1587 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1588 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1589 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1590 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1591 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1592 return NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1593 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1594 |
1435 | 1595 static GList *pr_source_tile_compute_region(PixbufRenderer *pr, gint x, gint y, gint w, gint h, gboolean request) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1596 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1597 gint x1, y1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1598 GList *list = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1599 gint sx, sy; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1600 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1601 if (x < 0) x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1602 if (y < 0) y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1603 if (w > pr->image_width) w = pr->image_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1604 if (h > pr->image_height) h = pr->image_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1605 |
1649 | 1606 sx = ROUND_DOWN(x, pr->source_tile_width); |
1607 sy = ROUND_DOWN(y, pr->source_tile_height); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1608 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1609 for (x1 = sx; x1 < x + w; x1+= pr->source_tile_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1610 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1611 for (y1 = sy; y1 < y + h; y1 += pr->source_tile_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1612 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1613 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1614 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1615 st = pr_source_tile_find(pr, x1, y1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1616 if (!st && request) st = pr_source_tile_request(pr, x1, y1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1617 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1618 if (st) list = g_list_prepend(list, st); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1619 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1620 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1621 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1622 return g_list_reverse(list); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1623 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1624 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1625 static void pr_source_tile_changed(PixbufRenderer *pr, gint x, gint y, gint width, gint height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1626 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1627 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1628 |
95
eb9bb29cbd65
Fri Nov 3 11:40:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
87
diff
changeset
|
1629 if (width < 1 || height < 1) return; |
eb9bb29cbd65
Fri Nov 3 11:40:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
87
diff
changeset
|
1630 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1631 work = pr->source_tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1632 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1633 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1634 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1635 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1636 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1637 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1638 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1639 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1640 if (pr_clip_region(st->x, st->y, pr->source_tile_width, pr->source_tile_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1641 x, y, width, height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1642 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1643 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1644 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1645 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1646 pixbuf = gdk_pixbuf_new_subpixbuf(st->pixbuf, rx - st->x, ry - st->y, rw, rh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1647 if (pr->func_tile_request && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1648 pr->func_tile_request(pr, rx, ry, rw, rh, pixbuf, pr->func_tile_data)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1649 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1650 pr_tile_invalidate_region(pr, rx * pr->scale, ry * pr->scale, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1651 rw * pr->scale, rh * pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1652 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1653 g_object_unref(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1654 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1655 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1656 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1657 |
1435 | 1658 static gboolean pr_source_tile_render(PixbufRenderer *pr, ImageTile *it, |
1659 gint x, gint y, gint w, gint h, | |
1660 gboolean new_data, gboolean fast) | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1661 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1662 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1663 GList *list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1664 GList *work; |
1435 | 1665 gboolean draw = FALSE; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1666 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1667 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1668 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1669 if (pr->zoom == 1.0 || pr->scale == 1.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1670 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1671 list = pr_source_tile_compute_region(pr, it->x + x, it->y + y, w, h, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1672 work = list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1673 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1674 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1675 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1676 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1677 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1678 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1679 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1680 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1681 if (pr_clip_region(st->x, st->y, pr->source_tile_width, pr->source_tile_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1682 it->x + x, it->y + y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1683 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1684 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1685 if (st->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1686 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1687 gdk_draw_rectangle(it->pixmap, box->style->black_gc, TRUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1688 rx - st->x, ry - st->y, rw, rh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1689 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1690 else /* (pr->zoom == 1.0 || pr->scale == 1.0) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1691 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1692 gdk_draw_pixbuf(it->pixmap, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1693 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1694 st->pixbuf, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1695 rx - st->x, ry - st->y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1696 rx - it->x, ry - it->y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1697 rw, rh, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1698 pr->dither_quality, rx, ry); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1699 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1700 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1701 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1702 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1703 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1704 { |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1705 gdouble scale_x, scale_y; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1706 gint sx, sy, sw, sh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1707 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1708 if (pr->image_width == 0 || pr->image_height == 0) return FALSE; |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1709 scale_x = (gdouble)pr->width / pr->image_width; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1710 scale_y = (gdouble)pr->height / pr->image_height; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1711 |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1712 sx = (gdouble)(it->x + x) / scale_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1713 sy = (gdouble)(it->y + y) / scale_y; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1714 sw = (gdouble)w / scale_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1715 sh = (gdouble)h / scale_y; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1716 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1717 if (pr->width < PR_MIN_SCALE_SIZE || pr->height < PR_MIN_SCALE_SIZE) fast = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1718 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1719 #if 0 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1720 /* draws red over draw region, to check for leaks (regions not filled) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1721 pixbuf_set_rect_fill(it->pixbuf, x, y, w, h, 255, 0, 0, 255); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1722 #endif |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1723 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1724 list = pr_source_tile_compute_region(pr, sx, sy, sw, sh, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1725 work = list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1726 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1727 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1728 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1729 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1730 gint stx, sty, stw, sth; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1731 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1732 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1733 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1734 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1735 stx = floor((gdouble)st->x * scale_x); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1736 sty = floor((gdouble)st->y * scale_y); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1737 stw = ceil((gdouble)(st->x + pr->source_tile_width) * scale_x) - stx; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1738 sth = ceil((gdouble)(st->y + pr->source_tile_height) * scale_y) - sty; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1739 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1740 if (pr_clip_region(stx, sty, stw, sth, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1741 it->x + x, it->y + y, w, h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1742 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1743 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1744 if (st->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1745 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1746 gdk_draw_rectangle(it->pixmap, box->style->black_gc, TRUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1747 rx - st->x, ry - st->y, rw, rh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1748 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1749 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1750 { |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1751 gdouble offset_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1752 gdouble offset_y; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1753 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1754 /* may need to use unfloored stx,sty values here */ |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1755 offset_x = (gdouble)(stx - it->x); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1756 offset_y = (gdouble)(sty - it->y); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1757 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1758 gdk_pixbuf_scale(st->pixbuf, it->pixbuf, rx - it->x, ry - it->y, rw, rh, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1759 (gdouble) 0.0 + offset_x, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1760 (gdouble) 0.0 + offset_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1761 scale_x, scale_y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1762 (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1763 draw = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1764 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1765 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1766 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1767 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1768 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1769 g_list_free(list); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1770 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1771 return draw; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1772 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1773 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1774 void pixbuf_renderer_set_tiles(PixbufRenderer *pr, gint width, gint height, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1775 gint tile_width, gint tile_height, gint cache_size, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1776 PixbufRendererTileRequestFunc func_request, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1777 PixbufRendererTileDisposeFunc func_dispose, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1778 gpointer user_data, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1779 gdouble zoom) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1780 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1781 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1782 g_return_if_fail(tile_width >= 32 && tile_width >= 32); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1783 g_return_if_fail(width >= 32 && height > 32); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1784 g_return_if_fail(func_request != NULL); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1785 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1786 if (pr->pixbuf) g_object_unref(pr->pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1787 pr->pixbuf = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1788 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1789 pr_source_tile_unset(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1790 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1791 if (cache_size < 4) cache_size = 4; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1792 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1793 pr->source_tiles_enabled = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1794 pr->source_tiles_cache_size = cache_size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1795 pr->source_tile_width = tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1796 pr->source_tile_height = tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1797 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1798 pr->image_width = width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1799 pr->image_height = height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1800 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1801 pr->func_tile_request = func_request; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1802 pr->func_tile_dispose = func_dispose; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1803 pr->func_tile_data = user_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1804 |
859 | 1805 pr_zoom_sync(pr, zoom, PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1806 pr_redraw(pr, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1807 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1808 |
77
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1809 void pixbuf_renderer_set_tiles_size(PixbufRenderer *pr, gint width, gint height) |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1810 { |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1811 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1812 g_return_if_fail(width >= 32 && height > 32); |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1813 |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1814 if (!pr->source_tiles_enabled) return; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1815 if (pr->image_width == width && pr->image_height == height) return; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1816 |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1817 pr->image_width = width; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1818 pr->image_height = height; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1819 |
859 | 1820 pr_zoom_sync(pr, pr->zoom, PR_ZOOM_FORCE, 0, 0); |
77
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1821 } |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1822 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1823 gint pixbuf_renderer_get_tiles(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1824 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1825 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1826 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1827 return pr->source_tiles_enabled; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1828 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1829 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1830 static void pr_zoom_adjust_real(PixbufRenderer *pr, gdouble increment, |
859 | 1831 PrZoomFlags flags, gint x, gint y) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1832 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1833 gdouble zoom = pr->zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1834 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1835 if (increment == 0.0) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1836 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1837 if (zoom == 0.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1838 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1839 if (pr->scale < 1.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1840 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1841 zoom = 0.0 - 1.0 / pr->scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1842 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1843 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1844 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1845 zoom = pr->scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1846 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1847 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1848 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1849 if (increment < 0.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1850 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1851 if (zoom >= 1.0 && zoom + increment < 1.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1852 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1853 zoom = zoom + increment - 2.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1854 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1855 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1856 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1857 zoom = zoom + increment; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1858 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1859 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1860 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1861 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1862 if (zoom <= -1.0 && zoom + increment > -1.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1863 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1864 zoom = zoom + increment + 2.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1865 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1866 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1867 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1868 zoom = zoom + increment; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1869 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1870 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1871 |
859 | 1872 pr_zoom_sync(pr, zoom, flags, x, y); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1873 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1874 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1875 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1876 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1877 * display tiles |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1878 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1879 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1880 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1881 static ImageTile *pr_tile_new(gint x, gint y, gint width, gint height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1882 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1883 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1884 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1885 it = g_new0(ImageTile, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1886 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1887 it->x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1888 it->y = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1889 it->w = width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1890 it->h = height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1891 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1892 it->render_done = TILE_RENDER_NONE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1893 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1894 return it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1895 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1896 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1897 static void pr_tile_free(ImageTile *it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1898 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1899 if (!it) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1900 |
1043 | 1901 if (it->pixbuf) g_object_unref(it->pixbuf); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1902 if (it->pixmap) g_object_unref(it->pixmap); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1903 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1904 g_free(it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1905 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1906 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1907 static void pr_tile_free_all(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1908 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1909 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1910 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1911 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1912 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1913 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1914 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1915 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1916 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1917 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1918 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1919 pr_tile_free(it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1920 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1921 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1922 g_list_free(pr->tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1923 pr->tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1924 pr->tile_cache_size = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1925 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1926 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1927 static ImageTile *pr_tile_add(PixbufRenderer *pr, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1928 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1929 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1930 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1931 it = pr_tile_new(x, y, pr->tile_width, pr->tile_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1932 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1933 if (it->x + it->w > pr->width) it->w = pr->width - it->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1934 if (it->y + it->h > pr->height) it->h = pr->height - it->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1935 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1936 pr->tiles = g_list_prepend(pr->tiles, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1937 pr->tile_cache_size += it->size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1938 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1939 return it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1940 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1941 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1942 static void pr_tile_remove(PixbufRenderer *pr, ImageTile *it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1943 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1944 if (it->qd) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1945 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1946 QueueData *qd = it->qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1947 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1948 it->qd = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1949 pr->draw_queue = g_list_remove(pr->draw_queue, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1950 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1951 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1952 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1953 if (it->qd2) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1954 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1955 QueueData *qd = it->qd2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1956 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1957 it->qd2 = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1958 pr->draw_queue_2pass = g_list_remove(pr->draw_queue_2pass, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1959 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1960 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1961 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1962 pr->tiles = g_list_remove(pr->tiles, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1963 pr->tile_cache_size -= it->size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1964 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1965 pr_tile_free(it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1966 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1967 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1968 static void pr_tile_free_space(PixbufRenderer *pr, guint space, ImageTile *it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1969 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1970 GList *work; |
736 | 1971 guint tile_max; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1972 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1973 work = g_list_last(pr->tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1974 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1975 if (pr->source_tiles_enabled && pr->scale < 1.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1976 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1977 gint tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1978 |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1979 tiles = (pr->vis_width / pr->tile_width + 1) * (pr->vis_height / pr->tile_height + 1); |
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1980 tile_max = MAX(tiles * pr->tile_width * pr->tile_height * 3, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1981 (gint)((gdouble)pr->tile_cache_max * 1048576.0 * pr->scale)); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1982 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1983 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1984 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1985 tile_max = pr->tile_cache_max * 1048576; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1986 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1987 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1988 while (work && pr->tile_cache_size + space > tile_max) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1989 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1990 ImageTile *needle; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1991 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1992 needle = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1993 work = work->prev; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1994 if (needle != it && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1995 ((!needle->qd && !needle->qd2) || !pr_tile_is_visible(pr, needle))) pr_tile_remove(pr, needle); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1996 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1997 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1998 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1999 static void pr_tile_invalidate_all(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2000 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2001 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2002 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2003 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2004 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2005 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2006 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2007 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2008 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2009 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2010 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2011 it->render_done = TILE_RENDER_NONE; |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
2012 it->render_todo = TILE_RENDER_ALL; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2013 it->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2014 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2015 it->w = MIN(pr->tile_width, pr->width - it->x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2016 it->h = MIN(pr->tile_height, pr->height - it->y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2017 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2018 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2019 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2020 static void pr_tile_invalidate_region(PixbufRenderer *pr, gint x, gint y, gint w, gint h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2021 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2022 gint x1, x2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2023 gint y1, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2024 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2025 |
1649 | 2026 x1 = ROUND_DOWN(x, pr->tile_width); |
2027 x2 = ROUND_UP(x + w, pr->tile_width); | |
2028 | |
2029 y1 = ROUND_DOWN(y, pr->tile_height); | |
2030 y2 = ROUND_UP(y + h, pr->tile_height); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2031 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2032 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2033 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2034 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2035 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2036 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2037 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2038 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2039 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2040 if (it->x < x2 && it->x + it->w > x1 && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2041 it->y < y2 && it->y + it->h > y1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2042 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2043 it->render_done = TILE_RENDER_NONE; |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
2044 it->render_todo = TILE_RENDER_ALL; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2045 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2046 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2047 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2048 |
1435 | 2049 static ImageTile *pr_tile_get(PixbufRenderer *pr, gint x, gint y, gboolean only_existing) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2050 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2051 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2052 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2053 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2054 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2055 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2056 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2057 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2058 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2059 if (it->x == x && it->y == y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2060 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2061 pr->tiles = g_list_delete_link(pr->tiles, work); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2062 pr->tiles = g_list_prepend(pr->tiles, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2063 return it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2064 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2065 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2066 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2067 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2068 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
2069 if (only_existing) return NULL; |
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
2070 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2071 return pr_tile_add(pr, x, y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2072 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2073 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2074 static void pr_tile_prepare(PixbufRenderer *pr, ImageTile *it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2075 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2076 if (!it->pixmap) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2077 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2078 GdkPixmap *pixmap; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2079 guint size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2080 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2081 pixmap = gdk_pixmap_new(((GtkWidget *)pr)->window, pr->tile_width, pr->tile_height, -1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2082 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2083 size = pixmap_calc_size(pixmap); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2084 pr_tile_free_space(pr, size, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2085 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2086 it->pixmap = pixmap; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2087 it->size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2088 pr->tile_cache_size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2089 } |
442 | 2090 |
2091 if ((pr->zoom != 1.0 || pr->source_tiles_enabled || (pr->pixbuf && gdk_pixbuf_get_has_alpha(pr->pixbuf)) || | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2092 pr->orientation != EXIF_ORIENTATION_TOP_LEFT || pr->func_post_process) && !it->pixbuf) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2093 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2094 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2095 guint size; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2096 #if 0 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2097 /* I don't think that we need a pixbuf with alpha channel here */ |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2098 if (pr->pixbuf) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2099 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2100 pixbuf = gdk_pixbuf_new(gdk_pixbuf_get_colorspace(pr->pixbuf), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2101 gdk_pixbuf_get_has_alpha(pr->pixbuf), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2102 gdk_pixbuf_get_bits_per_sample(pr->pixbuf), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2103 pr->tile_width, pr->tile_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2104 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2105 else |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2106 #endif |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2107 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2108 pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, pr->tile_width, pr->tile_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2109 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2110 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2111 size = gdk_pixbuf_get_rowstride(pixbuf) * pr->tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2112 pr_tile_free_space(pr, size, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2113 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2114 it->pixbuf = pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2115 it->size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2116 pr->tile_cache_size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2117 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2118 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2119 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2120 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2121 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2122 * drawing |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2123 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2124 */ |
442 | 2125 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2126 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2127 static void pr_tile_coords_map_orientation(PixbufRenderer *pr, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2128 gdouble tile_x, gdouble tile_y, /* coordinates of the tile */ |
1633
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2129 gdouble image_w, gdouble image_h, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2130 gdouble tile_w, gdouble tile_h, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2131 gdouble *res_x, gdouble *res_y) |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2132 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2133 *res_x = tile_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2134 *res_y = tile_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2135 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2136 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2137 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2138 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2139 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2140 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2141 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2142 *res_x = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2143 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2144 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2145 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2146 *res_x = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2147 *res_y = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2148 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2149 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2150 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2151 *res_y = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2152 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2153 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2154 *res_x = tile_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2155 *res_y = tile_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2156 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2157 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2158 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2159 *res_x = tile_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2160 *res_y = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2161 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2162 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2163 *res_x = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2164 *res_y = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2165 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2166 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2167 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2168 *res_x = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2169 *res_y = tile_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2170 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2171 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2172 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2173 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2174 } |
673
fbebf5cf4a55
Do not use printf() directly but use new wrapper function log_printf() instead.
zas_
parents:
671
diff
changeset
|
2175 // log_printf("tile coord y:%f, ih:%d, th:%f ry:%f\n", tile_y, image_h, tile_h, *res_x); |
442 | 2176 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2177 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2178 static void pr_tile_region_map_orientation(PixbufRenderer *pr, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2179 gint area_x, gint area_y, /* coordinates of the area inside tile */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2180 gint tile_w, gint tile_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2181 gint area_w, gint area_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2182 gint *res_x, gint *res_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2183 gint *res_w, gint *res_h) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2184 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2185 *res_x = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2186 *res_y = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2187 *res_w = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2188 *res_h = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2189 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2190 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2191 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2192 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2193 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2194 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2195 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2196 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2197 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2198 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2199 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2200 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2201 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2202 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2203 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2204 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2205 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2206 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2207 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2208 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2209 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2210 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2211 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2212 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2213 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2214 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2215 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2216 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2217 *res_y = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2218 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2219 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2220 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2221 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2222 *res_x = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2223 *res_y = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2224 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2225 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2226 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2227 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2228 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2229 *res_x = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2230 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2231 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2232 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2233 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2234 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2235 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2236 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2237 } |
673
fbebf5cf4a55
Do not use printf() directly but use new wrapper function log_printf() instead.
zas_
parents:
671
diff
changeset
|
2238 // log_printf("inside y:%d, th:%d, ah:%d ry:%d\n", area_y, tile_h, area_h, *res_x); |
442 | 2239 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2240 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2241 static void pr_coords_map_orientation_reverse(PixbufRenderer *pr, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2242 gint area_x, gint area_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2243 gint tile_w, gint tile_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2244 gint area_w, gint area_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2245 gint *res_x, gint *res_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2246 gint *res_w, gint *res_h) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2247 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2248 *res_x = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2249 *res_y = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2250 *res_w = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2251 *res_h = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2252 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2253 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2254 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2255 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2256 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2257 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2258 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2259 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2260 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2261 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2262 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2263 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2264 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2265 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2266 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2267 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2268 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2269 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2270 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2271 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2272 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2273 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2274 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2275 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2276 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2277 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2278 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2279 *res_x = tile_w - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2280 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2281 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2282 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2283 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2284 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2285 *res_x = tile_w - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2286 *res_y = tile_h - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2287 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2288 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2289 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2290 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2291 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2292 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2293 *res_y = tile_h - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2294 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2295 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2296 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2297 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2298 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2299 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2300 } |
442 | 2301 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2302 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2303 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2304 static GdkPixbuf *pr_get_spare_tile(PixbufRenderer *pr) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2305 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2306 if (!pr->spare_tile) pr->spare_tile = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, pr->tile_width, pr->tile_height); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2307 return pr->spare_tile; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2308 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2309 |
404 | 2310 #define COLOR_BYTES 3 /* rgb */ |
2311 | |
2312 static void pr_tile_rotate_90_clockwise(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2313 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2314 GdkPixbuf *src = *tile; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2315 GdkPixbuf *dest; |
404 | 2316 gint srs, drs; |
2317 guchar *s_pix, *d_pix; | |
2318 guchar *sp, *dp; | |
2319 guchar *ip, *spi, *dpi; | |
409 | 2320 gint i, j; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2321 gint tw = pr->tile_width; |
442 | 2322 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2323 srs = gdk_pixbuf_get_rowstride(src); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2324 s_pix = gdk_pixbuf_get_pixels(src); |
404 | 2325 spi = s_pix + (x * COLOR_BYTES); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2326 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2327 dest = pr_get_spare_tile(pr); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2328 drs = gdk_pixbuf_get_rowstride(dest); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2329 d_pix = gdk_pixbuf_get_pixels(dest); |
404 | 2330 dpi = d_pix + (tw - 1) * COLOR_BYTES; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2331 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2332 for (i = y; i < y + h; i++) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2333 { |
404 | 2334 sp = spi + (i * srs); |
2335 ip = dpi - (i * COLOR_BYTES); | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2336 for (j = x; j < x + w; j++) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2337 { |
404 | 2338 dp = ip + (j * drs); |
409 | 2339 memcpy(dp, sp, COLOR_BYTES); |
2340 sp += COLOR_BYTES; | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2341 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2342 } |
442 | 2343 |
404 | 2344 pr->spare_tile = src; |
2345 *tile = dest; | |
2346 } | |
2347 | |
2348 static void pr_tile_rotate_90_counter_clockwise(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) | |
2349 { | |
2350 GdkPixbuf *src = *tile; | |
2351 GdkPixbuf *dest; | |
2352 gint srs, drs; | |
2353 guchar *s_pix, *d_pix; | |
2354 guchar *sp, *dp; | |
2355 guchar *ip, *spi, *dpi; | |
409 | 2356 gint i, j; |
404 | 2357 gint th = pr->tile_height; |
442 | 2358 |
404 | 2359 srs = gdk_pixbuf_get_rowstride(src); |
2360 s_pix = gdk_pixbuf_get_pixels(src); | |
2361 spi = s_pix + (x * COLOR_BYTES); | |
2362 | |
2363 dest = pr_get_spare_tile(pr); | |
2364 drs = gdk_pixbuf_get_rowstride(dest); | |
2365 d_pix = gdk_pixbuf_get_pixels(dest); | |
2366 dpi = d_pix + (th - 1) * drs; | |
2367 | |
2368 for (i = y; i < y + h; i++) | |
2369 { | |
2370 sp = spi + (i * srs); | |
2371 ip = dpi + (i * COLOR_BYTES); | |
2372 for (j = x; j < x + w; j++) | |
2373 { | |
2374 dp = ip - (j * drs); | |
409 | 2375 memcpy(dp, sp, COLOR_BYTES); |
2376 sp += COLOR_BYTES; | |
404 | 2377 } |
2378 } | |
442 | 2379 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2380 pr->spare_tile = src; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2381 *tile = dest; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2382 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2383 |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2384 static void pr_tile_mirror_only(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2385 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2386 GdkPixbuf *src = *tile; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2387 GdkPixbuf *dest; |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2388 gint srs, drs; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2389 guchar *s_pix, *d_pix; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2390 guchar *sp, *dp; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2391 guchar *spi, *dpi; |
409 | 2392 gint i, j; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2393 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2394 gint tw = pr->tile_width; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2395 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2396 srs = gdk_pixbuf_get_rowstride(src); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2397 s_pix = gdk_pixbuf_get_pixels(src); |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2398 spi = s_pix + (x * COLOR_BYTES); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2399 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2400 dest = pr_get_spare_tile(pr); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2401 drs = gdk_pixbuf_get_rowstride(dest); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2402 d_pix = gdk_pixbuf_get_pixels(dest); |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2403 dpi = d_pix + (tw - x - 1) * COLOR_BYTES; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2404 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2405 for (i = y; i < y + h; i++) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2406 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2407 sp = spi + (i * srs); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2408 dp = dpi + (i * drs); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2409 for (j = 0; j < w; j++) |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2410 { |
409 | 2411 memcpy(dp, sp, COLOR_BYTES); |
2412 sp += COLOR_BYTES; | |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2413 dp -= COLOR_BYTES; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2414 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2415 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2416 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2417 pr->spare_tile = src; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2418 *tile = dest; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2419 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2420 |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2421 static void pr_tile_mirror_and_flip(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2422 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2423 GdkPixbuf *src = *tile; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2424 GdkPixbuf *dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2425 gint srs, drs; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2426 guchar *s_pix, *d_pix; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2427 guchar *sp, *dp; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2428 guchar *spi, *dpi; |
409 | 2429 gint i, j; |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2430 gint tw = pr->tile_width; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2431 gint th = pr->tile_height; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2432 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2433 srs = gdk_pixbuf_get_rowstride(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2434 s_pix = gdk_pixbuf_get_pixels(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2435 spi = s_pix + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2436 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2437 dest = pr_get_spare_tile(pr); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2438 drs = gdk_pixbuf_get_rowstride(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2439 d_pix = gdk_pixbuf_get_pixels(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2440 dpi = d_pix + (th - 1) * drs + (tw - 1) * COLOR_BYTES; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2441 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2442 for (i = y; i < y + h; i++) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2443 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2444 sp = s_pix + (i * srs) + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2445 dp = dpi - (i * drs) - (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2446 for (j = 0; j < w; j++) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2447 { |
409 | 2448 memcpy(dp, sp, COLOR_BYTES); |
2449 sp += COLOR_BYTES; | |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2450 dp -= COLOR_BYTES; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2451 } |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2452 } |
442 | 2453 |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2454 pr->spare_tile = src; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2455 *tile = dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2456 } |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2457 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2458 static void pr_tile_flip_only(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2459 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2460 GdkPixbuf *src = *tile; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2461 GdkPixbuf *dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2462 gint srs, drs; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2463 guchar *s_pix, *d_pix; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2464 guchar *sp, *dp; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2465 guchar *spi, *dpi; |
409 | 2466 gint i; |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2467 gint th = pr->tile_height; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2468 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2469 srs = gdk_pixbuf_get_rowstride(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2470 s_pix = gdk_pixbuf_get_pixels(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2471 spi = s_pix + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2472 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2473 dest = pr_get_spare_tile(pr); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2474 drs = gdk_pixbuf_get_rowstride(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2475 d_pix = gdk_pixbuf_get_pixels(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2476 dpi = d_pix + (th - 1) * drs + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2477 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2478 for (i = y; i < y + h; i++) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2479 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2480 sp = spi + (i * srs); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2481 dp = dpi - (i * drs); |
409 | 2482 memcpy(dp, sp, w * COLOR_BYTES); |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2483 } |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2484 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2485 pr->spare_tile = src; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2486 *tile = dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2487 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2488 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2489 static void pr_tile_apply_orientation(PixbufRenderer *pr, GdkPixbuf **pixbuf, gint x, gint y, gint w, gint h) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2490 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2491 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2492 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2493 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2494 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2495 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2496 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2497 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2498 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2499 pr_tile_mirror_only(pr, pixbuf, x, y, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2500 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2501 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2502 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2503 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2504 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2505 pr_tile_mirror_and_flip(pr, pixbuf, x, y, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2506 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2507 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2508 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2509 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2510 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2511 pr_tile_flip_only(pr, pixbuf, x, y, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2512 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2513 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2514 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2515 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2516 pr_tile_flip_only(pr, pixbuf, x, y, w, h); |
404 | 2517 pr_tile_rotate_90_clockwise(pr, pixbuf, x, pr->tile_height - y - h, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2518 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2519 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2520 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2521 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2522 { |
404 | 2523 pr_tile_rotate_90_clockwise(pr, pixbuf, x, y, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2524 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2525 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2526 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2527 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2528 pr_tile_flip_only(pr, pixbuf, x, y, w, h); |
404 | 2529 pr_tile_rotate_90_counter_clockwise(pr, pixbuf, x, pr->tile_height - y - h, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2530 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2531 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2532 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2533 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2534 { |
404 | 2535 pr_tile_rotate_90_counter_clockwise(pr, pixbuf, x, y, w, h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2536 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2537 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2538 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2539 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2540 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2541 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2542 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2543 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2544 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2545 static void pr_tile_render(PixbufRenderer *pr, ImageTile *it, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2546 gint x, gint y, gint w, gint h, |
1435 | 2547 gboolean new_data, gboolean fast) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2548 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2549 GtkWidget *box; |
1435 | 2550 gboolean has_alpha; |
2551 gboolean draw = FALSE; | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2552 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2553 if (it->render_todo == TILE_RENDER_NONE && it->pixmap && !new_data) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2554 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2555 if (it->render_done != TILE_RENDER_ALL) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2556 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2557 x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2558 y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2559 w = it->w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2560 h = it->h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2561 if (!fast) it->render_done = TILE_RENDER_ALL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2562 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2563 else if (it->render_todo != TILE_RENDER_AREA) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2564 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2565 if (!fast) it->render_todo = TILE_RENDER_NONE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2566 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2567 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2568 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2569 if (!fast) it->render_todo = TILE_RENDER_NONE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2570 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2571 if (new_data) it->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2572 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2573 pr_tile_prepare(pr, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2574 has_alpha = (pr->pixbuf && gdk_pixbuf_get_has_alpha(pr->pixbuf)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2575 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2576 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2577 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2578 /* FIXME checker colors for alpha should be configurable, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2579 * also should be drawn for blank = TRUE |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2580 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2581 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2582 if (it->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2583 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2584 /* no data, do fast rect fill */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2585 gdk_draw_rectangle(it->pixmap, box->style->black_gc, TRUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2586 0, 0, it->w, it->h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2587 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2588 else if (pr->source_tiles_enabled) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2589 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2590 draw = pr_source_tile_render(pr, it, x, y, w, h, new_data, fast); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2591 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2592 else if (pr->zoom == 1.0 || pr->scale == 1.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2593 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2594 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2595 gdouble src_x, src_y; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2596 gint pb_x, pb_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2597 gint pb_w, pb_h; |
442 | 2598 pr_tile_coords_map_orientation(pr, it->x, it->y, |
2599 pr->image_width, pr->image_height, | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2600 pr->tile_width, pr->tile_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2601 &src_x, &src_y); |
442 | 2602 pr_tile_region_map_orientation(pr, x, y, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2603 pr->tile_width, pr->tile_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2604 w, h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2605 &pb_x, &pb_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2606 &pb_w, &pb_h); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2607 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2608 if (has_alpha) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2609 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2610 gdk_pixbuf_composite_color(pr->pixbuf, it->pixbuf, pb_x, pb_y, pb_w, pb_h, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2611 (gdouble) 0.0 - src_x, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2612 (gdouble) 0.0 - src_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2613 1.0, 1.0, GDK_INTERP_NEAREST, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2614 255, it->x + pb_x, it->y + pb_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2615 PR_ALPHA_CHECK_SIZE, PR_ALPHA_CHECK1, PR_ALPHA_CHECK2); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2616 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2617 draw = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2618 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2619 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2620 { |
442 | 2621 |
2622 | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2623 if (pr->orientation == EXIF_ORIENTATION_TOP_LEFT && !(pr->func_post_process && !(pr->post_process_slow && fast))) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2624 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2625 /* faster, simple, base orientation, no postprocessing */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2626 gdk_draw_pixbuf(it->pixmap, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2627 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2628 pr->pixbuf, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2629 it->x + x, it->y + y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2630 x, y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2631 w, h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2632 pr->dither_quality, it->x + x, it->y + y); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2633 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2634 else |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2635 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2636 gdk_pixbuf_copy_area(pr->pixbuf, |
442 | 2637 src_x + pb_x, src_y + pb_y, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2638 pb_w, pb_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2639 it->pixbuf, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2640 pb_x, pb_y); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2641 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2642 draw = TRUE; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2643 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2644 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2645 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2646 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2647 { |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2648 gdouble scale_x, scale_y; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2649 gdouble src_x, src_y; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2650 gint pb_x, pb_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2651 gint pb_w, pb_h; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2652 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2653 if (pr->image_width == 0 || pr->image_height == 0) return; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2654 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2655 scale_x = (gdouble)pr->width / pr->image_width; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2656 scale_y = (gdouble)pr->height / pr->image_height; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2657 |
1633
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2658 pr_tile_coords_map_orientation(pr, it->x, it->y, |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2659 pr->image_width * scale_x, pr->image_height * scale_y, |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2660 pr->tile_width, pr->tile_height, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2661 &src_x, &src_y); |
442 | 2662 pr_tile_region_map_orientation(pr, x, y, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2663 pr->tile_width, pr->tile_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2664 w, h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2665 &pb_x, &pb_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2666 &pb_w, &pb_h); |
1633
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2667 switch (pr->orientation) |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2668 { |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2669 gdouble tmp; |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2670 case EXIF_ORIENTATION_LEFT_TOP: |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2671 case EXIF_ORIENTATION_RIGHT_TOP: |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2672 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2673 case EXIF_ORIENTATION_LEFT_BOTTOM: |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2674 tmp = scale_x; |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2675 scale_x = scale_y; |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2676 scale_y = tmp; |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2677 break; |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2678 default: |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2679 /* nothing to do */ |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2680 break; |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2681 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2682 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2683 /* HACK: The pixbuf scalers get kinda buggy(crash) with extremely |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2684 * small sizes for anything but GDK_INTERP_NEAREST |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2685 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2686 if (pr->width < PR_MIN_SCALE_SIZE || pr->height < PR_MIN_SCALE_SIZE) fast = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2687 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2688 if (!has_alpha) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2689 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2690 gdk_pixbuf_scale(pr->pixbuf, it->pixbuf, pb_x, pb_y, pb_w, pb_h, |
1633
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2691 (gdouble) 0.0 - src_x, |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2692 (gdouble) 0.0 - src_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2693 scale_x, scale_y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2694 (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2695 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2696 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2697 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2698 gdk_pixbuf_composite_color(pr->pixbuf, it->pixbuf, pb_x, pb_y, pb_w, pb_h, |
1633
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2699 (gdouble) 0.0 - src_x, |
96114e721195
swap x and y scale when scaling rotated images - it fixes tiles that were
nadvornik
parents:
1617
diff
changeset
|
2700 (gdouble) 0.0 - src_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2701 scale_x, scale_y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2702 (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2703 255, it->x + pb_x, it->y + pb_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2704 PR_ALPHA_CHECK_SIZE, PR_ALPHA_CHECK1, PR_ALPHA_CHECK2); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2705 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2706 pr_tile_apply_orientation(pr, &it->pixbuf, pb_x, pb_y, pb_w, pb_h); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2707 draw = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2708 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2709 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2710 if (draw && it->pixbuf && !it->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2711 { |
442 | 2712 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2713 if (pr->func_post_process && !(pr->post_process_slow && fast)) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2714 pr->func_post_process(pr, &it->pixbuf, x, y, w, h, pr->post_process_user_data); |
442 | 2715 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2716 gdk_draw_pixbuf(it->pixmap, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2717 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2718 it->pixbuf, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2719 x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2720 x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2721 w, h, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2722 pr->dither_quality, it->x + x, it->y + y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2723 } |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2724 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2725 #if 0 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2726 /* enable this line for debugging the edges of tiles */ |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2727 gdk_draw_rectangle(it->pixmap, box->style->white_gc, |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2728 FALSE, 0, 0, it->w, it->h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2729 gdk_draw_rectangle(it->pixmap, box->style->white_gc, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2730 FALSE, x, y, w, h); |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2731 #endif |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2732 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2733 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2734 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2735 static void pr_tile_expose(PixbufRenderer *pr, ImageTile *it, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2736 gint x, gint y, gint w, gint h, |
1435 | 2737 gboolean new_data, gboolean fast) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2738 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2739 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2740 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2741 pr_tile_render(pr, it, x, y, w, h, new_data, fast); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2742 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2743 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2744 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2745 gdk_draw_drawable(box->window, box->style->fg_gc[GTK_WIDGET_STATE(box)], |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2746 it->pixmap, x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2747 pr->x_offset + (it->x - pr->x_scroll) + x, pr->y_offset + (it->y - pr->y_scroll) + y, w, h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2748 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2749 if (pr->overlay_list) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2750 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2751 pr_overlay_draw(pr, pr->x_offset + (it->x - pr->x_scroll) + x, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2752 pr->y_offset + (it->y - pr->y_scroll) + y, |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
2753 w, h, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
2754 it); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2755 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2756 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2757 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2758 |
1435 | 2759 static gboolean pr_tile_is_visible(PixbufRenderer *pr, ImageTile *it) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2760 { |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
2761 return (it->x + it->w >= pr->x_scroll && it->x < pr->x_scroll + pr->vis_width && |
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
2762 it->y + it->h >= pr->y_scroll && it->y < pr->y_scroll + pr->vis_height); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2763 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2764 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2765 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2766 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2767 * draw queue |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2768 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2769 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2770 |
1030 | 2771 static gint pr_get_queued_area(GList *work) |
2772 { | |
2773 gint area = 0; | |
2774 | |
2775 while (work) | |
2776 { | |
2777 QueueData *qd = work->data; | |
2778 area += qd->w * qd->h; | |
2779 work = work->next; | |
2780 } | |
2781 return area; | |
2782 } | |
2783 | |
2784 | |
1435 | 2785 static gboolean pr_queue_schedule_next_draw(PixbufRenderer *pr, gboolean force_set) |
1030 | 2786 { |
2787 gfloat percent; | |
2788 gint visible_area = pr->vis_width * pr->vis_height; | |
2789 | |
2790 if (!pr->loading) | |
2791 { | |
2792 /* 2pass prio */ | |
1035 | 2793 DEBUG_2("redraw priority: 2pass"); |
1033
8db1017c4ca0
adjusted redraw priority relative to icon drawing
nadvornik
parents:
1030
diff
changeset
|
2794 pr->draw_idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, pr_queue_draw_idle_cb, pr, NULL); |
1030 | 2795 return FALSE; |
2796 } | |
2797 | |
2798 if (visible_area == 0) | |
2799 { | |
2800 /* not known yet */ | |
2801 percent = 100.0; | |
2802 } | |
2803 else | |
2804 { | |
2805 percent = 100.0 * pr_get_queued_area(pr->draw_queue) / visible_area; | |
2806 } | |
2807 | |
2808 if (percent > 10.0) | |
2809 { | |
2810 /* we have enough data for starting intensive redrawing */ | |
1035 | 2811 DEBUG_2("redraw priority: high %.2f %%", percent); |
1030 | 2812 pr->draw_idle_id = g_idle_add_full(GDK_PRIORITY_REDRAW, pr_queue_draw_idle_cb, pr, NULL); |
2813 return FALSE; | |
2814 } | |
2815 | |
2816 if (percent < 1.0 || force_set) | |
2817 { | |
2818 /* queue is (almost) empty, wait 50 ms*/ | |
1035 | 2819 DEBUG_2("redraw priority: wait %.2f %%", percent); |
1030 | 2820 pr->draw_idle_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 50, pr_queue_draw_idle_cb, pr, NULL); |
2821 return FALSE; | |
2822 } | |
2823 | |
2824 /* keep the same priority as before */ | |
1035 | 2825 DEBUG_2("redraw priority: no change %.2f %%", percent); |
1030 | 2826 return TRUE; |
2827 } | |
2828 | |
2829 | |
1435 | 2830 static gboolean pr_queue_draw_idle_cb(gpointer data) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2831 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2832 PixbufRenderer *pr = data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2833 QueueData *qd; |
1435 | 2834 gboolean fast; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2835 |
1030 | 2836 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2837 if ((!pr->pixbuf && !pr->source_tiles_enabled) || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2838 (!pr->draw_queue && !pr->draw_queue_2pass) || |
1523 | 2839 !pr->draw_idle_id) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2840 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
2841 pr_render_complete_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2842 |
1523 | 2843 pr->draw_idle_id = 0; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2844 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2845 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2846 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2847 if (pr->draw_queue) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2848 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2849 qd = pr->draw_queue->data; |
1515
3e6cd9243162
disabled 2-pass rendering also affect color correction
nadvornik
parents:
1500
diff
changeset
|
2850 fast = (pr->zoom_2pass && ((pr->zoom_quality != GDK_INTERP_NEAREST && pr->scale != 1.0) || pr->post_process_slow)); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2851 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2852 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2853 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2854 if (pr->loading) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2855 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2856 /* still loading, wait till done (also drops the higher priority) */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2857 |
1030 | 2858 return pr_queue_schedule_next_draw(pr, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2859 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2860 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2861 qd = pr->draw_queue_2pass->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2862 fast = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2863 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2864 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2865 if (GTK_WIDGET_REALIZED(pr)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2866 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2867 if (pr_tile_is_visible(pr, qd->it)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2868 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2869 pr_tile_expose(pr, qd->it, qd->x, qd->y, qd->w, qd->h, qd->new_data, fast); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2870 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2871 else if (qd->new_data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2872 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2873 /* if new pixel data, and we already have a pixmap, update the tile */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2874 qd->it->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2875 if (qd->it->pixmap && qd->it->render_done == TILE_RENDER_ALL) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2876 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2877 pr_tile_render(pr, qd->it, qd->x, qd->y, qd->w, qd->h, qd->new_data, fast); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2878 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2879 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2880 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2881 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2882 if (pr->draw_queue) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2883 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2884 qd->it->qd = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2885 pr->draw_queue = g_list_remove(pr->draw_queue, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2886 if (fast) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2887 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2888 if (qd->it->qd2) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2889 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2890 pr_queue_merge(qd->it->qd2, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2891 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2892 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2893 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2894 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2895 qd->it->qd2 = qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2896 pr->draw_queue_2pass = g_list_append(pr->draw_queue_2pass, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2897 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2898 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2899 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2900 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2901 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2902 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2903 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2904 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2905 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2906 qd->it->qd2 = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2907 pr->draw_queue_2pass = g_list_remove(pr->draw_queue_2pass, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2908 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2909 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2910 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2911 if (!pr->draw_queue && !pr->draw_queue_2pass) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2912 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
2913 pr_render_complete_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2914 |
1523 | 2915 pr->draw_idle_id = 0; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2916 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2917 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2918 |
1030 | 2919 return pr_queue_schedule_next_draw(pr, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2920 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2921 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2922 static void pr_queue_list_free(GList *list) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2923 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2924 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2925 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2926 work = list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2927 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2928 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2929 QueueData *qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2930 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2931 qd = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2932 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2933 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2934 qd->it->qd = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2935 qd->it->qd2 = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2936 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2937 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2938 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2939 g_list_free(list); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2940 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2941 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2942 static void pr_queue_clear(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2943 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2944 pr_queue_list_free(pr->draw_queue); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2945 pr->draw_queue = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2946 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2947 pr_queue_list_free(pr->draw_queue_2pass); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2948 pr->draw_queue_2pass = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2949 |
1523 | 2950 if (pr->draw_idle_id) |
2951 { | |
2952 g_source_remove(pr->draw_idle_id); | |
2953 pr->draw_idle_id = 0; | |
2954 } | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2955 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2956 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2957 static void pr_queue_merge(QueueData *parent, QueueData *qd) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2958 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2959 if (parent->x + parent->w < qd->x + qd->w) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2960 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2961 parent->w += (qd->x + qd->w) - (parent->x + parent->w); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2962 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2963 if (parent->x > qd->x) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2964 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2965 parent->w += parent->x - qd->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2966 parent->x = qd->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2967 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2968 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2969 if (parent->y + parent->h < qd->y + qd->h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2970 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2971 parent->h += (qd->y + qd->h) - (parent->y + parent->h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2972 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2973 if (parent->y > qd->y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2974 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2975 parent->h += parent->y - qd->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2976 parent->y = qd->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2977 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2978 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2979 parent->new_data |= qd->new_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2980 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2981 |
1435 | 2982 static gboolean pr_clamp_to_visible(PixbufRenderer *pr, gint *x, gint *y, gint *w, gint *h) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2983 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2984 gint nx, ny; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2985 gint nw, nh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2986 gint vx, vy; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2987 gint vw, vh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2988 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2989 vw = pr->vis_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2990 vh = pr->vis_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2991 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2992 vx = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2993 vy = pr->y_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2994 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2995 if (*x + *w < vx || *x > vx + vw || *y + *h < vy || *y > vy + vh) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2996 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2997 /* now clamp it */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2998 nx = CLAMP(*x, vx, vx + vw); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2999 nw = CLAMP(*w - (nx - *x), 1, vw); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3000 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3001 ny = CLAMP(*y, vy, vy + vh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3002 nh = CLAMP(*h - (ny - *y), 1, vh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3003 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3004 *x = nx; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3005 *y = ny; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3006 *w = nw; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3007 *h = nh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3008 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3009 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3010 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3011 |
1435 | 3012 static gboolean pr_queue_to_tiles(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
3013 gboolean clamp, ImageTileRenderType render, | |
3014 gboolean new_data, gboolean only_existing) | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3015 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3016 gint i, j; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3017 gint x1, x2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3018 gint y1, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3019 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3020 if (clamp && !pr_clamp_to_visible(pr, &x, &y, &w, &h)) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3021 |
1649 | 3022 x1 = ROUND_DOWN(x, pr->tile_width); |
3023 x2 = ROUND_UP(x + w, pr->tile_width); | |
3024 | |
3025 y1 = ROUND_DOWN(y, pr->tile_height); | |
3026 y2 = ROUND_UP(y + h, pr->tile_height); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3027 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3028 for (j = y1; j <= y2; j += pr->tile_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3029 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3030 for (i = x1; i <= x2; i += pr->tile_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3031 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3032 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3033 |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
3034 it = pr_tile_get(pr, i, j, |
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
3035 (only_existing && |
34
772fe5a509b1
Thu Apr 7 08:42:54 2005 John Ellis <johne@verizon.net>
gqview
parents:
33
diff
changeset
|
3036 (i + pr->tile_width < pr->x_scroll || |
772fe5a509b1
Thu Apr 7 08:42:54 2005 John Ellis <johne@verizon.net>
gqview
parents:
33
diff
changeset
|
3037 i > pr->x_scroll + pr->vis_width || |
772fe5a509b1
Thu Apr 7 08:42:54 2005 John Ellis <johne@verizon.net>
gqview
parents:
33
diff
changeset
|
3038 j + pr->tile_height < pr->y_scroll || |
772fe5a509b1
Thu Apr 7 08:42:54 2005 John Ellis <johne@verizon.net>
gqview
parents:
33
diff
changeset
|
3039 j > pr->y_scroll + pr->vis_height))); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3040 if (it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3041 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3042 QueueData *qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3043 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3044 if ((render == TILE_RENDER_ALL && it->render_done != TILE_RENDER_ALL) || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3045 (render == TILE_RENDER_AREA && it->render_todo != TILE_RENDER_ALL)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3046 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3047 it->render_todo = render; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3048 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3049 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3050 qd = g_new(QueueData, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3051 qd->it = it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3052 qd->new_data = new_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3053 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3054 if (i < x) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3055 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3056 qd->x = x - i; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3057 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3058 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3059 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3060 qd->x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3061 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3062 qd->w = x + w - i - qd->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3063 if (qd->x + qd->w > pr->tile_width) qd->w = pr->tile_width - qd->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3064 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3065 if (j < y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3066 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3067 qd->y = y - j; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3068 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3069 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3070 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3071 qd->y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3072 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3073 qd->h = y + h - j - qd->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3074 if (qd->y + qd->h > pr->tile_height) qd->h = pr->tile_height - qd->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3075 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3076 if (qd->w < 1 || qd->h < 1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3077 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3078 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3079 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3080 else if (it->qd) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3081 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3082 pr_queue_merge(it->qd, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3083 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3084 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3085 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3086 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3087 it->qd = qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3088 pr->draw_queue = g_list_append(pr->draw_queue, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3089 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3090 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3091 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3092 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3093 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3094 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3095 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3096 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3097 static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
1435 | 3098 gboolean clamp, ImageTileRenderType render, |
3099 gboolean new_data, gboolean only_existing) | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3100 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3101 gint nx, ny; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3102 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3103 nx = CLAMP(x, 0, pr->width - 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3104 ny = CLAMP(y, 0, pr->height - 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3105 w -= (nx - x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3106 h -= (ny - y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3107 w = CLAMP(w, 0, pr->width - nx); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3108 h = CLAMP(h, 0, pr->height - ny); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3109 if (w < 1 || h < 1) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3110 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3111 if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data, only_existing) && |
1523 | 3112 ((!pr->draw_queue && !pr->draw_queue_2pass) || !pr->draw_idle_id)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3113 { |
1523 | 3114 if (pr->draw_idle_id) |
3115 { | |
3116 g_source_remove(pr->draw_idle_id); | |
3117 pr->draw_idle_id = 0; | |
3118 } | |
1030 | 3119 pr_queue_schedule_next_draw(pr, TRUE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3120 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3121 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3122 |
1435 | 3123 static void pr_redraw(PixbufRenderer *pr, gboolean new_data) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3124 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3125 pr_queue_clear(pr); |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3126 pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, new_data, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3127 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3128 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3129 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3130 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3131 * signal emission |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3132 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3133 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3134 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3135 static void pr_update_signal(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3136 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3137 #if 0 |
673
fbebf5cf4a55
Do not use printf() directly but use new wrapper function log_printf() instead.
zas_
parents:
671
diff
changeset
|
3138 log_printf("FIXME: send updated signal\n"); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3139 #endif |
506
fc9c8a3e1a8b
Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents:
495
diff
changeset
|
3140 DEBUG_1("%s pixbuf renderer updated - started drawing %p", get_exec_time(), pr); |
386
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3141 pr->debug_updated = TRUE; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3142 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3143 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3144 static void pr_zoom_signal(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3145 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3146 g_signal_emit(pr, signals[SIGNAL_ZOOM], 0, pr->zoom); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3147 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3148 |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3149 static void pr_clicked_signal(PixbufRenderer *pr, GdkEventButton *bevent) |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3150 { |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3151 g_signal_emit(pr, signals[SIGNAL_CLICKED], 0, bevent); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3152 } |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3153 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3154 static void pr_scroll_notify_signal(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3155 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3156 g_signal_emit(pr, signals[SIGNAL_SCROLL_NOTIFY], 0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3157 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3158 |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3159 static void pr_render_complete_signal(PixbufRenderer *pr) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3160 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3161 if (!pr->complete) |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3162 { |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3163 g_signal_emit(pr, signals[SIGNAL_RENDER_COMPLETE], 0); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3164 g_object_set(G_OBJECT(pr), "complete", TRUE, NULL); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3165 } |
386
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3166 if (pr->debug_updated) |
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3167 { |
506
fc9c8a3e1a8b
Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents:
495
diff
changeset
|
3168 DEBUG_1("%s pixbuf renderer done %p", get_exec_time(), pr); |
386
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3169 pr->debug_updated = FALSE; |
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3170 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3171 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3172 |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3173 static void pr_drag_signal(PixbufRenderer *pr, GdkEventButton *bevent) |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3174 { |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3175 g_signal_emit(pr, signals[SIGNAL_DRAG], 0, bevent); |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3176 } |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3177 |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3178 static void pr_update_pixel_signal(PixbufRenderer *pr) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3179 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3180 g_signal_emit(pr, signals[SIGNAL_UPDATE_PIXEL], 0); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3181 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3182 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3183 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3184 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3185 * sync and clamp |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3186 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3187 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3188 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3189 static void pixbuf_renderer_sync_scroll_center(PixbufRenderer *pr) |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3190 { |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3191 gint src_x, src_y; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3192 if (!pr->width || !pr->height) return; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3193 |
1617
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3194 /* |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3195 * Update norm_center only if the image is bigger than the window. |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3196 * With this condition the stored center survives also a temporary display |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3197 * of the "broken image" icon. |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3198 */ |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3199 |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3200 if (pr->width > pr->window_width) |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3201 { |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3202 src_x = pr->x_scroll + pr->vis_width / 2; |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3203 pr->norm_center_x = (gdouble)src_x / pr->width; |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3204 } |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3205 |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3206 if (pr->height > pr->window_height) |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3207 { |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3208 src_y = pr->y_scroll + pr->vis_height / 2; |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3209 pr->norm_center_y = (gdouble)src_y / pr->height; |
d4d12f872398
preserve image center over short periods when the "broken image" icon is
nadvornik
parents:
1584
diff
changeset
|
3210 } |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3211 } |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3212 |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3213 |
1435 | 3214 static gboolean pr_scroll_clamp(PixbufRenderer *pr) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3215 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3216 gint old_xs; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3217 gint old_ys; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3218 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3219 if (pr->zoom == 0.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3220 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3221 pr->x_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3222 pr->y_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3223 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3224 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3225 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3226 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3227 old_xs = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3228 old_ys = pr->y_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3229 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3230 if (pr->x_offset > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3231 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3232 pr->x_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3233 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3234 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3235 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3236 pr->x_scroll = CLAMP(pr->x_scroll, 0, pr->width - pr->vis_width); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3237 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3238 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3239 if (pr->y_offset > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3240 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3241 pr->y_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3242 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3243 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3244 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3245 pr->y_scroll = CLAMP(pr->y_scroll, 0, pr->height - pr->vis_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3246 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3247 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3248 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3249 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3250 return (old_xs != pr->x_scroll || old_ys != pr->y_scroll); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3251 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3252 |
1435 | 3253 static gboolean pr_size_clamp(PixbufRenderer *pr) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3254 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3255 gint old_vw, old_vh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3256 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3257 old_vw = pr->vis_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3258 old_vh = pr->vis_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3259 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3260 if (pr->width < pr->window_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3261 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3262 pr->vis_width = pr->width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3263 pr->x_offset = (pr->window_width - pr->width) / 2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3264 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3265 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3266 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3267 pr->vis_width = pr->window_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3268 pr->x_offset = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3269 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3270 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3271 if (pr->height < pr->window_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3272 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3273 pr->vis_height = pr->height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3274 pr->y_offset = (pr->window_height - pr->height) / 2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3275 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3276 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3277 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3278 pr->vis_height = pr->window_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3279 pr->y_offset = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3280 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3281 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3282 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3283 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3284 return (old_vw != pr->vis_width || old_vh != pr->vis_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3285 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3286 |
1435 | 3287 static gboolean pr_zoom_clamp(PixbufRenderer *pr, gdouble zoom, |
3288 PrZoomFlags flags, gboolean *redrawn) | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3289 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3290 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3291 gdouble scale; |
859 | 3292 gboolean invalid; |
3293 gboolean force = !!(flags & PR_ZOOM_FORCE); | |
3294 gboolean new = !!(flags & PR_ZOOM_NEW); | |
3295 gboolean invalidate = !!(flags & PR_ZOOM_INVALIDATE); | |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3296 gboolean lazy = !!(flags & PR_ZOOM_LAZY); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3297 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3298 zoom = CLAMP(zoom, pr->zoom_min, pr->zoom_max); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3299 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3300 if (pr->zoom == zoom && !force) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3301 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3302 w = pr->image_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3303 h = pr->image_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3304 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3305 if (zoom == 0.0 && !pr->pixbuf) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3306 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3307 scale = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3308 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3309 else if (zoom == 0.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3310 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3311 gint max_w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3312 gint max_h; |
859 | 3313 gboolean sizeable; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3314 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3315 sizeable = (new && pr_parent_window_sizable(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3316 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3317 if (sizeable) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3318 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3319 max_w = gdk_screen_width(); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3320 max_h = gdk_screen_height(); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3321 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3322 if (pr->window_limit) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3323 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3324 max_w = max_w * pr->window_limit_size / 100; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3325 max_h = max_h * pr->window_limit_size / 100; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3326 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3327 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3328 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3329 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3330 max_w = pr->window_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3331 max_h = pr->window_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3332 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3333 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3334 if ((pr->zoom_expand && !sizeable) || w > max_w || h > max_h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3335 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3336 if ((gdouble)max_w / w > (gdouble)max_h / h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3337 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3338 scale = (gdouble)max_h / h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3339 h = max_h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3340 w = w * scale + 0.5; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3341 if (w > max_w) w = max_w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3342 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3343 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3344 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3345 scale = (gdouble)max_w / w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3346 w = max_w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3347 h = h * scale + 0.5; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3348 if (h > max_h) h = max_h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3349 } |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3350 |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3351 if (pr->autofit_limit) |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3352 { |
336
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3353 gdouble factor = (gdouble)pr->autofit_limit_size / 100; |
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3354 w = w * factor + 0.5; |
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3355 h = h * factor + 0.5; |
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3356 scale = scale * factor; |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3357 } |
442 | 3358 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3359 if (w < 1) w = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3360 if (h < 1) h = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3361 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3362 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3363 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3364 scale = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3365 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3366 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3367 else if (zoom > 0.0) /* zoom orig, in */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3368 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3369 scale = zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3370 w = w * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3371 h = h * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3372 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3373 else /* zoom out */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3374 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3375 scale = 1.0 / (0.0 - zoom); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3376 w = w * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3377 h = h * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3378 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3379 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3380 invalid = (pr->width != w || pr->height != h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3381 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3382 pr->zoom = zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3383 pr->width = w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3384 pr->height = h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3385 pr->scale = scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3386 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3387 if (invalidate || invalid) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3388 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3389 pr_tile_invalidate_all(pr); |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3390 if (!lazy) pr_redraw(pr, TRUE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3391 } |
27
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
3392 if (redrawn) *redrawn = (invalidate || invalid); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3393 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3394 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3395 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3396 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3397 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3398 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3399 static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom, |
859 | 3400 PrZoomFlags flags, gint px, gint py) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3401 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3402 gdouble old_scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3403 gint old_cx, old_cy; |
1435 | 3404 gboolean clamped; |
3405 gboolean sized; | |
859 | 3406 gboolean redrawn = FALSE; |
3407 gboolean center_point = !!(flags & PR_ZOOM_CENTER); | |
3408 gboolean force = !!(flags & PR_ZOOM_FORCE); | |
3409 gboolean new = !!(flags & PR_ZOOM_NEW); | |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3410 gboolean lazy = !!(flags & PR_ZOOM_LAZY); |
859 | 3411 PrZoomFlags clamp_flags = flags; |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3412 gdouble old_center_x = pr->norm_center_x; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3413 gdouble old_center_y = pr->norm_center_y; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3414 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3415 old_scale = pr->scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3416 if (center_point) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3417 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3418 px = CLAMP(px, 0, pr->width); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3419 py = CLAMP(py, 0, pr->height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3420 old_cx = pr->x_scroll + (px - pr->x_offset); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3421 old_cy = pr->y_scroll + (py - pr->y_offset); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3422 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3423 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3424 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3425 px = py = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3426 old_cx = pr->x_scroll + pr->vis_width / 2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3427 old_cy = pr->y_scroll + pr->vis_height / 2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3428 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3429 |
859 | 3430 if (force) clamp_flags |= PR_ZOOM_INVALIDATE; |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3431 if (lazy) clamp_flags |= PR_ZOOM_LAZY; |
859 | 3432 if (!pr_zoom_clamp(pr, zoom, clamp_flags, &redrawn)) return; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3433 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3434 clamped = pr_size_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3435 sized = pr_parent_window_resize(pr, pr->width, pr->height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3436 |
99
d19b0de6d0bb
Sat Nov 4 17:14:47 2006 John Ellis <johne@verizon.net>
gqview
parents:
95
diff
changeset
|
3437 if (force && new) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3438 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3439 switch (pr->scroll_reset) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3440 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3441 case PR_SCROLL_RESET_NOCHANGE: |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3442 /* maintain old scroll position */ |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3443 pr->x_scroll = ((gdouble)pr->image_width * old_center_x * pr->scale) - pr->vis_width / 2; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3444 pr->y_scroll = ((gdouble)pr->image_height * old_center_y * pr->scale) - pr->vis_height / 2; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3445 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3446 case PR_SCROLL_RESET_CENTER: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3447 /* center new image */ |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3448 pr->x_scroll = ((gdouble)pr->image_width / 2.0 * pr->scale) - pr->vis_width / 2; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3449 pr->y_scroll = ((gdouble)pr->image_height / 2.0 * pr->scale) - pr->vis_height / 2; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3450 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3451 case PR_SCROLL_RESET_TOPLEFT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3452 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3453 /* reset to upper left */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3454 pr->x_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3455 pr->y_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3456 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3457 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3458 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3459 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3460 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3461 /* user zoom does not force, so keep visible center point */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3462 if (center_point) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3463 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3464 pr->x_scroll = old_cx / old_scale * pr->scale - (px - pr->x_offset); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3465 pr->y_scroll = old_cy / old_scale * pr->scale - (py - pr->y_offset); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3466 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3467 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3468 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3469 pr->x_scroll = old_cx / old_scale * pr->scale - (pr->vis_width / 2); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3470 pr->y_scroll = old_cy / old_scale * pr->scale - (pr->vis_height / 2); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3471 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3472 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3473 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3474 pr_scroll_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3475 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3476 /* If the window was not sized, redraw the image - we know there will be no size/expose signal. |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3477 * But even if a size is claimed, there is no guarantee that the window manager will allow it, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3478 * so redraw the window anyway :/ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3479 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3480 if (sized || clamped) pr_border_clear(pr); |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3481 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3482 if (lazy) |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3483 { |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3484 pr_queue_clear(pr); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3485 } |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3486 else |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3487 { |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3488 pr_redraw(pr, redrawn); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3489 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3490 |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3491 pr_scroll_notify_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3492 pr_zoom_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3493 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3494 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3495 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3496 static void pr_size_sync(PixbufRenderer *pr, gint new_width, gint new_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3497 { |
1435 | 3498 gboolean zoom_changed = FALSE; |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3499 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3500 if (pr->window_width == new_width && pr->window_height == new_height) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3501 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3502 pr->window_width = new_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3503 pr->window_height = new_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3504 |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3505 if (pr->zoom == 0.0) |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3506 { |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3507 gdouble old_scale = pr->scale; |
859 | 3508 pr_zoom_clamp(pr, 0.0, PR_ZOOM_FORCE, NULL); |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3509 zoom_changed = (old_scale != pr->scale); |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3510 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3511 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3512 pr_size_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3513 pr_scroll_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3514 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3515 pr_overlay_update_sizes(pr); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3516 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3517 /* ensure scroller remains visible */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3518 if (pr->scroller_overlay != -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3519 { |
1435 | 3520 gboolean update = FALSE; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3521 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3522 if (pr->scroller_x > new_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3523 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3524 pr->scroller_x = new_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3525 pr->scroller_xpos = new_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3526 update = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3527 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3528 if (pr->scroller_y > new_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3529 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3530 pr->scroller_y = new_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3531 pr->scroller_ypos = new_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3532 update = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3533 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3534 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3535 if (update) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3536 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3537 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3538 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3539 if (pixbuf_renderer_overlay_get(pr, pr->scroller_overlay, &pixbuf, NULL, NULL)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3540 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3541 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3542 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3543 w = gdk_pixbuf_get_width(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3544 h = gdk_pixbuf_get_height(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3545 pixbuf_renderer_overlay_set(pr, pr->scroller_overlay, pixbuf, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3546 pr->scroller_x - w / 2, pr->scroller_y - h / 2); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3547 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3548 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3549 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3550 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3551 pr_border_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3552 |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3553 pr_scroll_notify_signal(pr); |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3554 if (zoom_changed) pr_zoom_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3555 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3556 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3557 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3558 static void pr_size_cb(GtkWidget *widget, GtkAllocation *allocation, gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3559 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3560 PixbufRenderer *pr = data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3561 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3562 pr_size_sync(pr, allocation->width, allocation->height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3563 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3564 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3565 static void pixbuf_renderer_paint(PixbufRenderer *pr, GdkRectangle *area) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3566 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3567 gint x, y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3568 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3569 pr_border_draw(pr, area->x, area->y, area->width, area->height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3570 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3571 x = MAX(0, (gint)area->x - pr->x_offset + pr->x_scroll); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3572 y = MAX(0, (gint)area->y - pr->y_offset + pr->y_scroll); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3573 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3574 pr_queue(pr, x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3575 MIN((gint)area->width, pr->width - x), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3576 MIN((gint)area->height, pr->height - y), |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3577 FALSE, TILE_RENDER_ALL, FALSE, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3578 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3579 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3580 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3581 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3582 * scrolling |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3583 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3584 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3585 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3586 void pixbuf_renderer_scroll(PixbufRenderer *pr, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3587 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3588 gint old_x, old_y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3589 gint x_off, y_off; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3590 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3591 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3592 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3593 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3594 if (!pr->pixbuf && !pr->source_tiles_enabled) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3595 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3596 old_x = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3597 old_y = pr->y_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3598 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3599 pr->x_scroll += x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3600 pr->y_scroll += y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3601 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3602 pr_scroll_clamp(pr); |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3603 |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3604 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3605 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3606 if (pr->x_scroll == old_x && pr->y_scroll == old_y) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3607 |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3608 pr_scroll_notify_signal(pr); |
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3609 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3610 x_off = pr->x_scroll - old_x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3611 y_off = pr->y_scroll - old_y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3612 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3613 w = pr->vis_width - abs(x_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3614 h = pr->vis_height - abs(y_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3615 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3616 if (w < 1 || h < 1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3617 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3618 /* scrolled completely to new material */ |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3619 pr_queue(pr, 0, 0, pr->width, pr->height, TRUE, TILE_RENDER_ALL, FALSE, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3620 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3621 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3622 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3623 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3624 gint x1, y1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3625 gint x2, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3626 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3627 GdkGC *gc; |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3628 GdkEvent *event; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3629 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3630 if (x_off < 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3631 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3632 x1 = abs(x_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3633 x2 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3634 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3635 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3636 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3637 x1 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3638 x2 = abs(x_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3639 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3640 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3641 if (y_off < 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3642 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3643 y1 = abs(y_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3644 y2 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3645 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3646 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3647 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3648 y1 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3649 y2 = abs(y_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3650 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3651 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3652 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3653 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3654 gc = gdk_gc_new(box->window); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3655 gdk_gc_set_exposures(gc, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3656 gdk_draw_drawable(box->window, gc, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3657 box->window, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3658 x2 + pr->x_offset, y2 + pr->y_offset, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3659 x1 + pr->x_offset, y1 + pr->y_offset, w, h); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3660 g_object_unref(gc); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3661 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3662 if (pr->overlay_list) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3663 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3664 pr_overlay_queue_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3665 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3666 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3667 w = pr->vis_width - w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3668 h = pr->vis_height - h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3669 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3670 if (w > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3671 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3672 pr_queue(pr, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3673 x_off > 0 ? pr->x_scroll + (pr->vis_width - w) : pr->x_scroll, pr->y_scroll, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3674 w, pr->vis_height, TRUE, TILE_RENDER_ALL, FALSE, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3675 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3676 if (h > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3677 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3678 /* FIXME, to optimize this, remove overlap */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3679 pr_queue(pr, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3680 pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3681 pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE, FALSE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3682 } |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3683 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3684 /* process exposures here, "expose_event" seems to miss a few with obstructed windows */ |
1767 | 3685 #if ! GTK_CHECK_VERSION(2,18,0) |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3686 while ((event = gdk_event_get_graphics_expose(box->window)) != NULL) |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3687 { |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3688 pixbuf_renderer_paint(pr, &event->expose.area); |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3689 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3690 if (event->expose.count == 0) |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3691 { |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3692 gdk_event_free(event); |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3693 break; |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3694 } |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3695 gdk_event_free(event); |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3696 } |
1767 | 3697 #endif |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3698 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3699 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3700 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3701 void pixbuf_renderer_scroll_to_point(PixbufRenderer *pr, gint x, gint y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3702 gdouble x_align, gdouble y_align) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3703 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3704 gint px, py; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3705 gint ax, ay; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3706 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3707 x_align = CLAMP(x_align, 0.0, 1.0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3708 y_align = CLAMP(y_align, 0.0, 1.0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3709 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3710 ax = (gdouble)pr->vis_width * x_align; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3711 ay = (gdouble)pr->vis_height * y_align; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3712 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3713 px = (gdouble)x * pr->scale - (pr->x_scroll + ax); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3714 py = (gdouble)y * pr->scale - (pr->y_scroll + ay); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3715 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3716 pixbuf_renderer_scroll(pr, px, py); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3717 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3718 |
131 | 3719 /* get or set coordinates of viewport center in the image, in range 0.0 - 1.0 */ |
3720 | |
3721 void pixbuf_renderer_get_scroll_center(PixbufRenderer *pr, gdouble *x, gdouble *y) | |
3722 { | |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3723 *x = pr->norm_center_x; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3724 *y = pr->norm_center_y; |
131 | 3725 } |
3726 | |
3727 void pixbuf_renderer_set_scroll_center(PixbufRenderer *pr, gdouble x, gdouble y) | |
3728 { | |
3729 gdouble dst_x, dst_y; | |
3730 | |
3731 dst_x = x * pr->width - pr->vis_width / 2 - pr->x_scroll + CLAMP(pr->subpixel_x_scroll, -1.0, 1.0); | |
3732 dst_y = y * pr->height - pr->vis_height / 2 - pr->y_scroll + CLAMP(pr->subpixel_y_scroll, -1.0, 1.0); | |
3733 | |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3734 pr->subpixel_x_scroll = dst_x - (gint)dst_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3735 pr->subpixel_y_scroll = dst_y - (gint)dst_y; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3736 |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3737 pixbuf_renderer_scroll(pr, (gint)dst_x, (gint)dst_y); |
131 | 3738 } |
3739 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3740 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3741 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3742 * mouse |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3743 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3744 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3745 |
1435 | 3746 static gboolean pr_mouse_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3747 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3748 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3749 gint accel; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3750 |
1709 | 3751 /* This is a hack, but work far the best, at least for single pointer systems. |
3752 * See http://bugzilla.gnome.org/show_bug.cgi?id=587714 for more. */ | |
3753 gint x, y; | |
3754 gdk_window_get_pointer (bevent->window, &x, &y, NULL); | |
3755 bevent->x = x; | |
3756 bevent->y = y; | |
3757 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3758 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3759 |
1523 | 3760 if (pr->scroller_id) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3761 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3762 pr->scroller_xpos = bevent->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3763 pr->scroller_ypos = bevent->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3764 } |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3765 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3766 pr->x_mouse = bevent->x; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3767 pr->y_mouse = bevent->y; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3768 pr_update_pixel_signal(pr); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3769 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3770 if (!pr->in_drag || !gdk_pointer_is_grabbed()) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3771 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3772 if (pr->drag_moved < PR_DRAG_SCROLL_THRESHHOLD) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3773 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3774 pr->drag_moved++; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3775 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3776 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3777 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3778 widget_set_cursor(widget, GDK_FLEUR); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3779 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3780 |
1047 | 3781 if (bevent->state & GDK_CONTROL_MASK) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3782 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3783 accel = PR_PAN_SHIFT_MULTIPLIER; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3784 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3785 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3786 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3787 accel = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3788 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3789 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3790 /* do the scroll */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3791 pixbuf_renderer_scroll(pr, (pr->drag_last_x - bevent->x) * accel, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3792 (pr->drag_last_y - bevent->y) * accel); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3793 |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3794 pr_drag_signal(pr, bevent); |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3795 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3796 pr->drag_last_x = bevent->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3797 pr->drag_last_y = bevent->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3798 |
1709 | 3799 /* This is recommended by the GTK+ documentation, but does not work properly. |
3800 * Use deprecated way until GTK+ gets a solution for correct motion hint handling: | |
3801 * http://bugzilla.gnome.org/show_bug.cgi?id=587714 | |
3802 */ | |
3803 /* gdk_event_request_motions (bevent); */ | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3804 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3805 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3806 |
1584
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3807 static gboolean pr_leave_notify_cb(GtkWidget *widget, GdkEventCrossing *cevent, gpointer data) |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3808 { |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3809 PixbufRenderer *pr; |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3810 |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3811 pr = PIXBUF_RENDERER(widget); |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3812 pr->x_mouse = -1; |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3813 pr->y_mouse = -1; |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3814 |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3815 pr_update_pixel_signal(pr); |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3816 return FALSE; |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3817 } |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3818 |
1435 | 3819 static gboolean pr_mouse_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3820 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3821 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3822 GtkWidget *parent; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3823 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3824 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3825 |
1523 | 3826 if (pr->scroller_id) return TRUE; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3827 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3828 switch (bevent->button) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3829 { |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3830 case MOUSE_BUTTON_LEFT: |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3831 pr->in_drag = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3832 pr->drag_last_x = bevent->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3833 pr->drag_last_y = bevent->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3834 pr->drag_moved = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3835 gdk_pointer_grab(widget->window, FALSE, |
1709 | 3836 GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3837 NULL, NULL, bevent->time); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3838 gtk_grab_add(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3839 break; |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3840 case MOUSE_BUTTON_MIDDLE: |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3841 pr->drag_moved = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3842 break; |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3843 case MOUSE_BUTTON_RIGHT: |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3844 pr_clicked_signal(pr, bevent); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3845 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3846 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3847 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3848 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3849 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3850 parent = gtk_widget_get_parent(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3851 if (widget && GTK_WIDGET_CAN_FOCUS(parent)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3852 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3853 gtk_widget_grab_focus(parent); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3854 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3855 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3856 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3857 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3858 |
1435 | 3859 static gboolean pr_mouse_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3860 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3861 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3862 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3863 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3864 |
1523 | 3865 if (pr->scroller_id) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3866 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3867 pr_scroller_stop(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3868 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3869 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3870 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3871 if (gdk_pointer_is_grabbed() && GTK_WIDGET_HAS_GRAB(pr)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3872 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3873 gtk_grab_remove(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3874 gdk_pointer_ungrab(bevent->time); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3875 widget_set_cursor(widget, -1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3876 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3877 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3878 if (pr->drag_moved < PR_DRAG_SCROLL_THRESHHOLD) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3879 { |
1047 | 3880 if (bevent->button == MOUSE_BUTTON_LEFT && (bevent->state & GDK_CONTROL_MASK)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3881 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3882 pr_scroller_start(pr, bevent->x, bevent->y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3883 } |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3884 else if (bevent->button == MOUSE_BUTTON_LEFT || bevent->button == MOUSE_BUTTON_MIDDLE) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3885 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3886 pr_clicked_signal(pr, bevent); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3887 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3888 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3889 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3890 pr->in_drag = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3891 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3892 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3893 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3894 |
1435 | 3895 static gboolean pr_mouse_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3896 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3897 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3898 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3899 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3900 |
1523 | 3901 if (pr->scroller_id) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3902 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3903 pr->scroller_xpos = pr->scroller_x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3904 pr->scroller_ypos = pr->scroller_y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3905 pr->scroller_xinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3906 pr->scroller_yinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3907 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3908 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3909 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3910 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3911 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3912 static void pr_mouse_drag_cb(GtkWidget *widget, GdkDragContext *context, gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3913 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3914 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3915 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3916 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3917 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3918 pr->drag_moved = PR_DRAG_SCROLL_THRESHHOLD; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3919 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3920 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3921 static void pr_signals_connect(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3922 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3923 g_signal_connect(G_OBJECT(pr), "motion_notify_event", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3924 G_CALLBACK(pr_mouse_motion_cb), pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3925 g_signal_connect(G_OBJECT(pr), "button_press_event", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3926 G_CALLBACK(pr_mouse_press_cb), pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3927 g_signal_connect(G_OBJECT(pr), "button_release_event", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3928 G_CALLBACK(pr_mouse_release_cb), pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3929 g_signal_connect(G_OBJECT(pr), "leave_notify_event", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3930 G_CALLBACK(pr_mouse_leave_cb), pr); |
1500 | 3931 g_signal_connect(G_OBJECT(pr), "hierarchy-changed", |
3932 G_CALLBACK(pr_hierarchy_changed_cb), pr); | |
1584
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3933 g_signal_connect(G_OBJECT(pr), "leave_notify_event", |
0cd2268f500b
improved pixel info, changed the menu entry from "Hide" to "Show",
nadvornik
parents:
1523
diff
changeset
|
3934 G_CALLBACK(pr_leave_notify_cb), pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3935 |
1709 | 3936 gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3937 GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3938 GDK_LEAVE_NOTIFY_MASK); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3939 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3940 g_signal_connect(G_OBJECT(pr), "drag_begin", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3941 G_CALLBACK(pr_mouse_drag_cb), pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3942 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3943 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3944 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3945 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3946 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3947 * public |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3948 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3949 */ |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3950 static void pr_pixbuf_size_sync(PixbufRenderer *pr) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3951 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3952 if (!pr->pixbuf) return; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3953 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3954 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3955 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3956 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3957 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3958 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3959 pr->image_width = gdk_pixbuf_get_height(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3960 pr->image_height = gdk_pixbuf_get_width(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3961 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3962 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3963 pr->image_width = gdk_pixbuf_get_width(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3964 pr->image_height = gdk_pixbuf_get_height(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3965 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3966 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3967 |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3968 static void pr_set_pixbuf(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom, PrZoomFlags flags) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3969 { |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3970 if (pixbuf) g_object_ref(pixbuf); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3971 if (pr->pixbuf) g_object_unref(pr->pixbuf); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3972 pr->pixbuf = pixbuf; |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3973 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3974 if (!pr->pixbuf) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3975 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3976 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3977 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3978 /* no pixbuf so just clear the window */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3979 pr->image_width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3980 pr->image_height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3981 pr->scale = 1.0; |
1634 | 3982 pr->zoom = zoom; /* don't throw away the zoom value, it is set by pixbuf_renderer_move, among others, |
3983 and used for pixbuf_renderer_zoom_get */ | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3984 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3985 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3986 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3987 if (GTK_WIDGET_REALIZED(box)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3988 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3989 gdk_window_clear(box->window); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3990 pr_overlay_draw(pr, 0, 0, pr->window_width, pr->window_height, NULL); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3991 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3992 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3993 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3994 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3995 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3996 } |
442 | 3997 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3998 pr_pixbuf_size_sync(pr); |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3999 pr_zoom_sync(pr, zoom, flags | PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4000 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4001 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4002 void pixbuf_renderer_set_pixbuf(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4003 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4004 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4005 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4006 pr_source_tile_unset(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4007 |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4008 pr_set_pixbuf(pr, pixbuf, zoom, 0); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4009 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4010 pr_update_signal(pr); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4011 } |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4012 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4013 void pixbuf_renderer_set_pixbuf_lazy(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom, gint orientation) |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4014 { |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4015 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4016 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4017 pr_source_tile_unset(pr); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4018 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4019 pr->orientation = orientation; |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
4020 pr_set_pixbuf(pr, pixbuf, zoom, PR_ZOOM_LAZY); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4021 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4022 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4023 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4024 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4025 GdkPixbuf *pixbuf_renderer_get_pixbuf(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4026 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4027 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), NULL); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4028 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4029 return pr->pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4030 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4031 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4032 void pixbuf_renderer_set_orientation(PixbufRenderer *pr, gint orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4033 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4034 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4035 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4036 pr->orientation = orientation; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4037 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4038 pr_pixbuf_size_sync(pr); |
859 | 4039 pr_zoom_sync(pr, pr->zoom, PR_ZOOM_FORCE, 0, 0); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4040 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4041 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4042 gint pixbuf_renderer_get_orientation(PixbufRenderer *pr) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4043 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4044 if (!pr) return 1; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4045 return pr->orientation; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4046 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4047 |
1435 | 4048 void pixbuf_renderer_set_post_process_func(PixbufRenderer *pr, PixbufRendererPostProcessFunc func, gpointer user_data, gboolean slow) |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4049 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4050 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
442 | 4051 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4052 pr->func_post_process = func; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4053 pr->post_process_user_data = user_data; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4054 pr->post_process_slow = func && slow; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4055 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4056 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4057 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4058 |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4059 void pixbuf_renderer_move(PixbufRenderer *pr, PixbufRenderer *source) |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4060 { |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4061 GObject *object; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4062 PixbufRendererScrollResetType scroll_reset; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4063 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4064 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4065 g_return_if_fail(IS_PIXBUF_RENDERER(source)); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4066 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4067 if (pr == source) return; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4068 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4069 object = G_OBJECT(pr); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4070 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4071 g_object_set(object, "zoom_min", source->zoom_min, NULL); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4072 g_object_set(object, "zoom_max", source->zoom_max, NULL); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4073 g_object_set(object, "loading", source->loading, NULL); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4074 |
42
606fcf461a68
Sat May 14 13:04:23 2005 John Ellis <johne@verizon.net>
gqview
parents:
38
diff
changeset
|
4075 pr->complete = source->complete; |
606fcf461a68
Sat May 14 13:04:23 2005 John Ellis <johne@verizon.net>
gqview
parents:
38
diff
changeset
|
4076 |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4077 pr->x_scroll = source->x_scroll; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4078 pr->y_scroll = source->y_scroll; |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4079 pr->x_mouse = source->x_mouse; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4080 pr->y_mouse = source->y_mouse; |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4081 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4082 scroll_reset = pr->scroll_reset; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4083 pr->scroll_reset = PR_SCROLL_RESET_NOCHANGE; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4084 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4085 pr->func_post_process = source->func_post_process; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4086 pr->post_process_user_data = source->post_process_user_data; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4087 pr->post_process_slow = source->post_process_slow; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4088 pr->orientation = source->orientation; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4089 |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4090 if (source->source_tiles_enabled) |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4091 { |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4092 pr_source_tile_unset(pr); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4093 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4094 pr->source_tiles_enabled = source->source_tiles_enabled; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4095 pr->source_tiles_cache_size = source->source_tiles_cache_size; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4096 pr->source_tile_width = source->source_tile_width; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4097 pr->source_tile_height = source->source_tile_height; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4098 pr->image_width = source->image_width; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4099 pr->image_height = source->image_height; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4100 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4101 pr->func_tile_request = source->func_tile_request; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4102 pr->func_tile_dispose = source->func_tile_dispose; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4103 pr->func_tile_data = source->func_tile_data; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4104 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4105 pr->source_tiles = source->source_tiles; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4106 source->source_tiles = NULL; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4107 |
859 | 4108 pr_zoom_sync(pr, source->zoom, PR_ZOOM_FORCE | PR_ZOOM_NEW, 0, 0); |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4109 pr_redraw(pr, TRUE); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4110 } |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4111 else |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4112 { |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4113 pixbuf_renderer_set_pixbuf(pr, source->pixbuf, source->zoom); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4114 } |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4115 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4116 pr->scroll_reset = scroll_reset; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4117 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4118 pixbuf_renderer_set_pixbuf(source, NULL, source->zoom); |
38
d5f8f8a4d47b
Thu Apr 14 04:49:57 2005 John Ellis <johne@verizon.net>
gqview
parents:
36
diff
changeset
|
4119 pr_queue_clear(source); |
36
9b01fe7e84d5
Tue Apr 12 07:59:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
34
diff
changeset
|
4120 pr_tile_free_all(source); |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4121 } |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4122 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4123 void pixbuf_renderer_area_changed(PixbufRenderer *pr, gint src_x, gint src_y, gint src_w, gint src_h) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4124 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4125 gint x, y, width, height, x1, y1, x2, y2; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4126 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4127 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4128 |
442 | 4129 pr_coords_map_orientation_reverse(pr, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4130 src_x, src_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4131 pr->image_width, pr->image_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4132 src_w, src_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4133 &x, &y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4134 &width, &height); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4135 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4136 if (pr->source_tiles_enabled) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4137 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4138 pr_source_tile_changed(pr, x, y, width, height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4139 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4140 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4141 if (pr->scale != 1.0 && pr->zoom_quality != GDK_INTERP_NEAREST) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4142 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4143 /* increase region when using a zoom quality that may access surrounding pixels */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4144 y -= 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4145 height += 2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4146 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4147 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4148 x1 = (gint)floor((gdouble)x * pr->scale); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4149 y1 = (gint)floor((gdouble)y * pr->scale); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4150 x2 = (gint)ceil((gdouble)(x + width) * pr->scale); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4151 y2 = (gint)ceil((gdouble)(y + height) * pr->scale); |
26
acd9885ebd78
Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents:
25
diff
changeset
|
4152 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
4153 pr_queue(pr, x1, y1, x2 - x1, y2 - y1, FALSE, TILE_RENDER_AREA, TRUE, TRUE); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4154 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4155 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4156 void pixbuf_renderer_zoom_adjust(PixbufRenderer *pr, gdouble increment) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4157 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4158 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4159 |
859 | 4160 pr_zoom_adjust_real(pr, increment, PR_ZOOM_NONE, 0, 0); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4161 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4162 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4163 void pixbuf_renderer_zoom_adjust_at_point(PixbufRenderer *pr, gdouble increment, gint x, gint y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4164 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4165 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4166 |
859 | 4167 pr_zoom_adjust_real(pr, increment, PR_ZOOM_CENTER, x, y); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4168 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4169 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4170 void pixbuf_renderer_zoom_set(PixbufRenderer *pr, gdouble zoom) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4171 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4172 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4173 |
859 | 4174 pr_zoom_sync(pr, zoom, PR_ZOOM_NONE, 0, 0); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4175 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4176 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4177 gdouble pixbuf_renderer_zoom_get(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4178 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4179 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), 1.0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4180 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4181 return pr->zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4182 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4183 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4184 gdouble pixbuf_renderer_zoom_get_scale(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4185 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4186 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), 1.0); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4187 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4188 return pr->scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4189 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4190 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4191 void pixbuf_renderer_zoom_set_limits(PixbufRenderer *pr, gdouble min, gdouble max) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4192 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4193 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4194 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4195 if (min > 1.0 || max < 1.0) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4196 if (min < 1.0 && min > -1.0) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4197 if (min < -200.0 || max > 200.0) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4198 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4199 if (pr->zoom_min != min) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4200 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4201 pr->zoom_min = min; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4202 g_object_notify(G_OBJECT(pr), "zoom_min"); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4203 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4204 if (pr->zoom_max != max) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4205 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4206 pr->zoom_max = max; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4207 g_object_notify(G_OBJECT(pr), "zoom_max"); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4208 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4209 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4210 |
1435 | 4211 gboolean pixbuf_renderer_get_pixel_colors(PixbufRenderer *pr, gint x_pixel, gint y_pixel, |
4212 gint *r_mouse, gint *g_mouse, gint *b_mouse) | |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4213 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4214 GdkPixbuf *pb = pr->pixbuf; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4215 gint p_alpha, prs; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4216 guchar *p_pix, *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4217 gint map_x, map_y, map_w, map_h; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4218 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4219 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4220 g_return_val_if_fail(r_mouse != NULL && g_mouse != NULL && b_mouse != NULL, FALSE); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4221 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4222 if (!pr->pixbuf && !pr->source_tiles_enabled) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4223 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4224 *r_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4225 *g_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4226 *b_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4227 return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4228 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4229 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4230 if (!pb) return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4231 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4232 pr_tile_region_map_orientation(pr, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4233 x_pixel, y_pixel, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4234 pr->image_width, pr->image_height, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4235 1, 1, /*single pixel */ |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4236 &map_x, &map_y, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4237 &map_w, &map_h); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4238 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4239 if (map_x < 0 || map_x > gdk_pixbuf_get_width(pr->pixbuf) - 1) return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4240 if (map_y < 0 || map_y > gdk_pixbuf_get_height(pr->pixbuf) - 1) return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4241 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4242 p_alpha = gdk_pixbuf_get_has_alpha(pb); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4243 prs = gdk_pixbuf_get_rowstride(pb); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4244 p_pix = gdk_pixbuf_get_pixels(pb); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4245 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4246 pp = p_pix + map_y * prs + (map_x * (p_alpha ? 4 : 3)); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4247 *r_mouse = *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4248 pp++; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4249 *g_mouse = *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4250 pp++; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4251 *b_mouse = *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4252 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4253 return TRUE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4254 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4255 |
1435 | 4256 gboolean pixbuf_renderer_get_mouse_position(PixbufRenderer *pr, gint *x_pixel_return, gint *y_pixel_return) |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4257 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4258 gint x_pixel, y_pixel, x_pixel_clamped, y_pixel_clamped; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4259 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4260 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4261 g_return_val_if_fail(x_pixel_return != NULL && y_pixel_return != NULL, FALSE); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4262 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4263 if (!pr->pixbuf && !pr->source_tiles_enabled) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4264 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4265 *x_pixel_return = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4266 *y_pixel_return = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4267 return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4268 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4269 |
1492
c350242b1a5d
Fixed bug where pixel/color information at x=0 coordinates werent shown:
zas_
parents:
1435
diff
changeset
|
4270 x_pixel = floor((gdouble)(pr->x_mouse - pr->x_offset + pr->x_scroll) / pr->scale); |
c350242b1a5d
Fixed bug where pixel/color information at x=0 coordinates werent shown:
zas_
parents:
1435
diff
changeset
|
4271 y_pixel = floor((gdouble)(pr->y_mouse - pr->y_offset + pr->y_scroll) / pr->scale); |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4272 x_pixel_clamped = CLAMP(x_pixel, 0, pr->image_width - 1); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4273 y_pixel_clamped = CLAMP(y_pixel, 0, pr->image_height - 1); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4274 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4275 if(x_pixel != x_pixel_clamped || y_pixel != y_pixel_clamped) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4276 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4277 /* mouse is not on pr */ |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4278 x_pixel = y_pixel = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4279 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4280 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4281 *x_pixel_return = x_pixel; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4282 *y_pixel_return = y_pixel; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4283 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4284 return TRUE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4285 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4286 |
1431 | 4287 gboolean pixbuf_renderer_get_image_size(PixbufRenderer *pr, gint *width, gint *height) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4288 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4289 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4290 g_return_val_if_fail(width != NULL && height != NULL, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4291 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4292 if (!pr->pixbuf && !pr->source_tiles_enabled) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4293 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4294 *width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4295 *height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4296 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4297 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4298 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4299 *width = pr->image_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4300 *height = pr->image_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4301 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4302 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4303 |
1435 | 4304 gboolean pixbuf_renderer_get_scaled_size(PixbufRenderer *pr, gint *width, gint *height) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4305 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4306 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4307 g_return_val_if_fail(width != NULL && height != NULL, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4308 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4309 if (!pr->pixbuf && !pr->source_tiles_enabled) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4310 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4311 *width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4312 *height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4313 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4314 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4315 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4316 *width = pr->width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4317 *height = pr->height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4318 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4319 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4320 |
1435 | 4321 gboolean pixbuf_renderer_get_visible_rect(PixbufRenderer *pr, GdkRectangle *rect) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4322 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4323 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4324 g_return_val_if_fail(rect != NULL, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4325 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4326 if ((!pr->pixbuf && !pr->source_tiles_enabled) || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4327 !pr->scale) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4328 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4329 rect->x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4330 rect->y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4331 rect->width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4332 rect->height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4333 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4334 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4335 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4336 rect->x = (gint)((gdouble)pr->x_scroll / pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4337 rect->y = (gint)((gdouble)pr->y_scroll / pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4338 rect->width = (gint)((gdouble)pr->vis_width / pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4339 rect->height = (gint)((gdouble)pr->vis_height / pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4340 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4341 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4342 |
1435 | 4343 gboolean pixbuf_renderer_get_virtual_rect(PixbufRenderer *pr, GdkRectangle *rect) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4344 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4345 g_return_val_if_fail(IS_PIXBUF_RENDERER(pr), FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4346 g_return_val_if_fail(rect != NULL, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4347 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4348 if ((!pr->pixbuf && !pr->source_tiles_enabled)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4349 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4350 rect->x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4351 rect->y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4352 rect->width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4353 rect->height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4354 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4355 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4356 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4357 rect->x = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4358 rect->y = pr->y_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4359 rect->width = pr->vis_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4360 rect->height = pr->vis_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4361 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4362 } |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1047
diff
changeset
|
4363 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |