Mercurial > geeqie.yaz
annotate src/pixbuf-renderer.c @ 1431:7e180091e0b7
More gboolean and tidy up.
author | zas_ |
---|---|
date | Sat, 14 Mar 2009 11:26:43 +0000 |
parents | df58e511d90e |
children | 8355da717c68 |
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 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
82 typedef enum { |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
83 TILE_RENDER_NONE = 0, /* do nothing */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
84 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
|
85 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
|
86 } ImageTileRenderType; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
87 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
88 typedef struct _ImageTile ImageTile; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
89 typedef struct _QueueData QueueData; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
90 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
91 struct _ImageTile |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
92 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
93 GdkPixmap *pixmap; /* off screen buffer */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
94 GdkPixbuf *pixbuf; /* pixbuf area for zooming */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
95 gint x; /* x offset into image */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
96 gint y; /* y offset into image */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
97 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
|
98 gint h; /* height '' */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
99 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
100 gboolean blank; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
101 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
102 /* render_todo: (explanation) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
103 NONE do nothing |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
104 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
|
105 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
|
106 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
|
107 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
108 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
109 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
|
110 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
|
111 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
112 QueueData *qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
113 QueueData *qd2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
114 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
115 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
|
116 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
117 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
118 struct _QueueData |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
119 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
120 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
121 gint x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
122 gint y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
123 gint w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
124 gint h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
125 gboolean new_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
126 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
127 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
128 typedef struct _SourceTile SourceTile; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
129 struct _SourceTile |
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 gint x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
132 gint y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
133 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
134 gboolean blank; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
135 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
136 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
137 typedef struct _OverlayData OverlayData; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
138 struct _OverlayData |
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 gint id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
141 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
142 GdkPixbuf *pixbuf; |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
143 GdkWindow *window; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
144 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
145 gint x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
146 gint y; |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
147 |
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
148 OverlayRendererFlags flags; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
149 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
150 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
151 enum { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
152 SIGNAL_ZOOM = 0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
153 SIGNAL_CLICKED, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
154 SIGNAL_SCROLL_NOTIFY, |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
155 SIGNAL_RENDER_COMPLETE, |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
156 SIGNAL_DRAG, |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
157 SIGNAL_UPDATE_PIXEL, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
158 SIGNAL_COUNT |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
159 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
160 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
161 enum { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
162 PROP_0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
163 PROP_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
164 PROP_ZOOM_MAX, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
165 PROP_ZOOM_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
166 PROP_ZOOM_2PASS, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
167 PROP_ZOOM_EXPAND, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
168 PROP_DITHER_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
169 PROP_SCROLL_RESET, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
170 PROP_DELAY_FLIP, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
171 PROP_LOADING, |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
172 PROP_COMPLETE, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
173 PROP_CACHE_SIZE_DISPLAY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
174 PROP_CACHE_SIZE_TILES, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
175 PROP_WINDOW_FIT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
176 PROP_WINDOW_LIMIT, |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
177 PROP_WINDOW_LIMIT_VALUE, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
178 PROP_AUTOFIT_LIMIT, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
179 PROP_AUTOFIT_LIMIT_VALUE |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
180 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
181 |
859 | 182 typedef enum { |
183 PR_ZOOM_NONE = 0, | |
184 PR_ZOOM_FORCE = 1 << 0, | |
185 PR_ZOOM_NEW = 1 << 1, | |
186 PR_ZOOM_CENTER = 1 << 2, | |
187 PR_ZOOM_INVALIDATE = 1 << 3, | |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
188 PR_ZOOM_LAZY = 1 << 4 /* wait with redraw for pixbuf_renderer_area_changed */ |
859 | 189 } PrZoomFlags; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
190 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
191 static guint signals[SIGNAL_COUNT] = { 0 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
192 static GtkEventBoxClass *parent_class = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
193 |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
196 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
|
197 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
|
198 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
|
199 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
|
200 const GValue *value, GParamSpec *pspec); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
201 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
|
202 GValue *value, GParamSpec *pspec); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
203 static gint pixbuf_renderer_expose(GtkWidget *widget, GdkEventExpose *event); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
204 |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
205 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
|
206 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
207 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
|
208 static void pr_scroller_timer_set(PixbufRenderer *pr, gint start); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
209 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
|
210 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
211 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
212 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
|
213 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
|
214 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
|
215 static gint pr_tile_is_visible(PixbufRenderer *pr, ImageTile *it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
216 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
|
217 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
|
218 static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
219 gint clamp, ImageTileRenderType render, gint new_data, gint only_existing); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
220 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
221 static void pr_redraw(PixbufRenderer *pr, gint new_data); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
222 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
223 static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom, |
859 | 224 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
|
225 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
226 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
|
227 static void pr_size_cb(GtkWidget *widget, GtkAllocation *allocation, gpointer data); |
1373 | 228 static void pr_unmap_cb(GtkWidget *widget, gpointer data); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
229 static void pixbuf_renderer_paint(PixbufRenderer *pr, GdkRectangle *area); |
1030 | 230 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
|
231 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
232 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
233 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
234 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
235 * Pixbuf Renderer object |
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 GType pixbuf_renderer_get_type(void) |
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 static GType pixbuf_renderer_type = 0; |
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 if (!pixbuf_renderer_type) |
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 const GTypeInfo pixbuf_renderer_info = |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
246 { |
691 | 247 sizeof(PixbufRendererClass), /* class_size */ |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
248 NULL, /* base_init */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
249 NULL, /* base_finalize */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
250 (GClassInitFunc)pixbuf_renderer_class_init, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
251 NULL, /* class_finalize */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
252 NULL, /* class_data */ |
691 | 253 sizeof(PixbufRenderer), /* instance_size */ |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
254 0, /* n_preallocs */ |
691 | 255 (GInstanceInitFunc)pixbuf_renderer_init, /* instance_init */ |
256 NULL, /* value_table */ | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
257 }; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
258 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
259 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
|
260 &pixbuf_renderer_info, 0); |
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 return pixbuf_renderer_type; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
264 } |
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 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
|
267 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
268 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
|
269 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
|
270 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
271 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
|
272 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
273 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
|
274 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
|
275 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
276 gobject_class->finalize = pixbuf_renderer_finalize; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
277 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
278 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
|
279 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
280 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
|
281 PROP_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
282 g_param_spec_double("zoom_min", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
283 "Zoom minimum", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
284 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
285 -1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
286 1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
287 PR_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
288 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
289 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
290 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
|
291 PROP_ZOOM_MAX, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
292 g_param_spec_double("zoom_max", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
293 "Zoom maximum", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
294 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
295 -1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
296 1000.0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
297 PR_ZOOM_MIN, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
298 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
299 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
300 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
|
301 PROP_ZOOM_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
302 g_param_spec_uint("zoom_quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
303 "Zoom quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
304 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
305 GDK_INTERP_NEAREST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
306 GDK_INTERP_HYPER, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
307 GDK_INTERP_BILINEAR, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
308 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
309 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
310 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
|
311 PROP_ZOOM_2PASS, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
312 g_param_spec_boolean("zoom_2pass", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
313 "2 pass zoom", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
314 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
315 TRUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
316 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
317 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
318 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
|
319 PROP_ZOOM_EXPAND, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
320 g_param_spec_boolean("zoom_expand", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
321 "Expand image in autozoom.", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
322 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
323 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
324 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
325 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
326 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
|
327 PROP_DITHER_QUALITY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
328 g_param_spec_uint("dither_quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
329 "Dither quality", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
330 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
331 GDK_RGB_DITHER_NONE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
332 GDK_RGB_DITHER_MAX, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
333 GDK_RGB_DITHER_NORMAL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
334 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
335 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
336 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
|
337 PROP_SCROLL_RESET, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
338 g_param_spec_uint("scroll_reset", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
339 "New image scroll reset", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
340 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
341 PR_SCROLL_RESET_TOPLEFT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
342 PR_SCROLL_RESET_NOCHANGE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
343 PR_SCROLL_RESET_TOPLEFT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
344 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
345 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
346 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
|
347 PROP_DELAY_FLIP, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
348 g_param_spec_boolean("delay_flip", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
349 "Delay image update", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
350 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
351 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
352 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
353 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
354 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
|
355 PROP_LOADING, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
356 g_param_spec_boolean("loading", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
357 "Image actively loading", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
358 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
359 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
360 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
361 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
362 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
|
363 PROP_COMPLETE, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
364 g_param_spec_boolean("complete", |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
365 "Image rendering complete", |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
366 NULL, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
367 FALSE, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
368 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
369 |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
370 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
|
371 PROP_CACHE_SIZE_DISPLAY, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
372 g_param_spec_uint("cache_display", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
373 "Display cache size MB", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
374 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
375 0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
376 128, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
377 PR_CACHE_SIZE_DEFAULT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
378 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
379 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
380 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
|
381 PROP_CACHE_SIZE_TILES, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
382 g_param_spec_uint("cache_tiles", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
383 "Tile cache count", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
384 "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
|
385 0, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
386 256, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
387 PR_CACHE_SIZE_DEFAULT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
388 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
389 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
390 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
|
391 PROP_WINDOW_FIT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
392 g_param_spec_boolean("window_fit", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
393 "Fit window to image size", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
394 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
395 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
396 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
397 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
398 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
|
399 PROP_WINDOW_LIMIT, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
400 g_param_spec_boolean("window_limit", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
401 "Limit size of parent window", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
402 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
403 FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
404 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
405 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
406 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
|
407 PROP_WINDOW_LIMIT_VALUE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
408 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
|
409 "Size limit of parent window", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
410 NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
411 10, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
412 150, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
413 100, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
414 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
442 | 415 |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
416 g_object_class_install_property(gobject_class, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
417 PROP_AUTOFIT_LIMIT, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
418 g_param_spec_boolean("autofit_limit", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
419 "Limit size of image when autofitting", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
420 NULL, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
421 FALSE, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
422 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
423 |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
424 g_object_class_install_property(gobject_class, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
425 PROP_AUTOFIT_LIMIT_VALUE, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
426 g_param_spec_uint("autofit_limit_value", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
427 "Size limit of image when autofitting", |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
428 NULL, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
429 10, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
430 150, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
431 100, |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
432 G_PARAM_READABLE | G_PARAM_WRITABLE)); |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
433 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
434 |
442 | 435 signals[SIGNAL_ZOOM] = |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
436 g_signal_new("zoom", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
437 G_OBJECT_CLASS_TYPE(gobject_class), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
438 G_SIGNAL_RUN_LAST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
439 G_STRUCT_OFFSET(PixbufRendererClass, zoom), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
440 NULL, NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
441 g_cclosure_marshal_VOID__DOUBLE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
442 G_TYPE_NONE, 1, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
443 G_TYPE_DOUBLE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
444 |
442 | 445 signals[SIGNAL_CLICKED] = |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
446 g_signal_new("clicked", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
447 G_OBJECT_CLASS_TYPE(gobject_class), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
448 G_SIGNAL_RUN_LAST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
449 G_STRUCT_OFFSET(PixbufRendererClass, clicked), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
450 NULL, NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
451 g_cclosure_marshal_VOID__BOXED, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
452 G_TYPE_NONE, 1, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
453 GDK_TYPE_EVENT); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
454 |
442 | 455 signals[SIGNAL_SCROLL_NOTIFY] = |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
456 g_signal_new("scroll-notify", |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
457 G_OBJECT_CLASS_TYPE(gobject_class), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
458 G_SIGNAL_RUN_LAST, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
459 G_STRUCT_OFFSET(PixbufRendererClass, scroll_notify), |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
460 NULL, NULL, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
461 g_cclosure_marshal_VOID__VOID, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
462 G_TYPE_NONE, 0); |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
463 |
442 | 464 signals[SIGNAL_RENDER_COMPLETE] = |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
465 g_signal_new("render-complete", |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
466 G_OBJECT_CLASS_TYPE(gobject_class), |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
467 G_SIGNAL_RUN_LAST, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
468 G_STRUCT_OFFSET(PixbufRendererClass, render_complete), |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
469 NULL, NULL, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
470 g_cclosure_marshal_VOID__VOID, |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
471 G_TYPE_NONE, 0); |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
472 |
442 | 473 signals[SIGNAL_DRAG] = |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
474 g_signal_new("drag", |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
475 G_OBJECT_CLASS_TYPE(gobject_class), |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
476 G_SIGNAL_RUN_LAST, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
477 G_STRUCT_OFFSET(PixbufRendererClass, drag), |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
478 NULL, NULL, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
479 g_cclosure_marshal_VOID__BOXED, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
480 G_TYPE_NONE, 1, |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
481 GDK_TYPE_EVENT); |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
482 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
483 signals[SIGNAL_UPDATE_PIXEL] = |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
484 g_signal_new("update-pixel", |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
485 G_OBJECT_CLASS_TYPE(gobject_class), |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
486 G_SIGNAL_RUN_LAST, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
487 G_STRUCT_OFFSET(PixbufRendererClass, update_pixel), |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
488 NULL, NULL, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
489 g_cclosure_marshal_VOID__VOID, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
490 G_TYPE_NONE, 0); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
491 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
492 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
493 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
|
494 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
495 GtkWidget *box; |
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 box = GTK_WIDGET(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 pr->zoom_min = PR_ZOOM_MIN; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
500 pr->zoom_max = PR_ZOOM_MAX; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
501 pr->zoom_quality = GDK_INTERP_BILINEAR; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
502 pr->zoom_2pass = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
503 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
504 pr->zoom = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
505 pr->scale = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
506 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
507 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
|
508 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
509 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
|
510 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
511 pr->draw_idle_id = -1; |
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->tile_width = PR_TILE_SIZE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
514 pr->tile_height = PR_TILE_SIZE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
515 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
516 pr->tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
517 pr->tile_cache_size = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
518 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
519 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
|
520 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
521 pr->scroller_id = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
522 pr->scroller_overlay = -1; |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
523 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
524 pr->x_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
525 pr->y_mouse = -1; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
526 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
527 pr->source_tiles_enabled = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
528 pr->source_tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
529 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
530 pr->orientation = 1; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
531 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
532 pr->norm_center_x = 0.5; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
533 pr->norm_center_y = 0.5; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
534 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
535 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
|
536 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
|
537 G_CALLBACK(pr_size_cb), pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
538 |
1373 | 539 g_signal_connect(G_OBJECT(pr), "unmap", |
540 G_CALLBACK(pr_unmap_cb), pr); | |
541 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
542 pr_signals_connect(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
543 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
544 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
545 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
|
546 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
547 PixbufRenderer *pr; |
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 pr = PIXBUF_RENDERER(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 pr_queue_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
552 pr_tile_free_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
553 |
1043 | 554 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
555 if (pr->pixbuf) g_object_unref(pr->pixbuf); |
1043 | 556 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
|
557 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
558 pr_scroller_timer_set(pr, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
559 pr_overlay_list_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
560 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
561 pr_source_tile_free_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
562 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
563 |
1001 | 564 PixbufRenderer *pixbuf_renderer_new(void) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
565 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
566 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
|
567 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
568 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
569 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
|
570 const GValue *value, GParamSpec *pspec) |
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 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
573 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
574 pr = PIXBUF_RENDERER(object); |
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 switch (prop_id) |
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 case PROP_ZOOM_MIN: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
579 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
|
580 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
581 case PROP_ZOOM_MAX: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
582 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
|
583 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
584 case PROP_ZOOM_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
585 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
|
586 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
587 case PROP_ZOOM_2PASS: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
588 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
|
589 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
590 case PROP_ZOOM_EXPAND: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
591 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
|
592 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
593 case PROP_DITHER_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
594 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
|
595 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
596 case PROP_SCROLL_RESET: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
597 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
|
598 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
599 case PROP_DELAY_FLIP: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
600 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
|
601 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
602 case PROP_LOADING: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
603 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
|
604 break; |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
605 case PROP_COMPLETE: |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
606 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
|
607 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
608 case PROP_CACHE_SIZE_DISPLAY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
609 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
|
610 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
611 case PROP_CACHE_SIZE_TILES: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
612 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
|
613 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
614 case PROP_WINDOW_FIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
615 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
|
616 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
617 case PROP_WINDOW_LIMIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
618 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
|
619 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
620 case PROP_WINDOW_LIMIT_VALUE: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
621 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
|
622 break; |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
623 case PROP_AUTOFIT_LIMIT: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
624 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
|
625 break; |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
626 case PROP_AUTOFIT_LIMIT_VALUE: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
627 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
|
628 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
629 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
630 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
|
631 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
632 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
633 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
634 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
635 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
|
636 GValue *value, GParamSpec *pspec) |
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 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
639 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
640 pr = PIXBUF_RENDERER(object); |
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 switch (prop_id) |
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 case PROP_ZOOM_MIN: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
645 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
|
646 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
647 case PROP_ZOOM_MAX: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
648 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
|
649 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
650 case PROP_ZOOM_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
651 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
|
652 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
653 case PROP_ZOOM_2PASS: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
654 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
|
655 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
656 case PROP_ZOOM_EXPAND: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
657 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
|
658 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
659 case PROP_DITHER_QUALITY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
660 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
|
661 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
662 case PROP_SCROLL_RESET: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
663 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
|
664 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
665 case PROP_DELAY_FLIP: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
666 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
|
667 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
668 case PROP_LOADING: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
669 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
|
670 break; |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
671 case PROP_COMPLETE: |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
672 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
|
673 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
674 case PROP_CACHE_SIZE_DISPLAY: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
675 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
|
676 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
677 case PROP_CACHE_SIZE_TILES: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
678 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
|
679 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
680 case PROP_WINDOW_FIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
681 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
|
682 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
683 case PROP_WINDOW_LIMIT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
684 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
|
685 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
686 case PROP_WINDOW_LIMIT_VALUE: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
687 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
|
688 break; |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
689 case PROP_AUTOFIT_LIMIT: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
690 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
|
691 break; |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
692 case PROP_AUTOFIT_LIMIT_VALUE: |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
693 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
|
694 break; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
695 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
696 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
|
697 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
698 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
699 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
700 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
701 static gint pixbuf_renderer_expose(GtkWidget *widget, GdkEventExpose *event) |
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 if (GTK_WIDGET_DRAWABLE(widget)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
704 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
705 if (!GTK_WIDGET_NO_WINDOW(widget)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
706 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
707 if (event->window != widget->window) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
708 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
709 GdkRectangle area; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
710 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
711 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
|
712 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
713 area.x += event->area.x; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
714 area.y += event->area.y; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
715 area.width = event->area.width; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
716 area.height = event->area.height; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
717 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
|
718 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
719 else |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
720 { |
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), &event->area); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
722 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
723 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
724 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
725 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
726 return FALSE; |
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 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
731 * misc utilities |
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 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
|
736 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
737 GdkCursor *cursor; |
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 if (!widget->window) return; |
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 if (icon == -1) |
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 cursor = NULL; |
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 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
746 { |
513
985fdfebd89e
Remove whitespace between function name and first parenthesis for the sake of consistency. (pass 2)
zas_
parents:
512
diff
changeset
|
747 cursor = gdk_cursor_new(icon); |
23
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
750 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
|
751 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
752 if (cursor) gdk_cursor_unref(cursor); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
755 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
|
756 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
757 gint w, h, d; |
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 d = gdk_drawable_get_depth(pixmap); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
760 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
|
761 return w * h * (d / 8); |
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 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
764 static gint pr_clip_region(gint x, gint y, gint w, gint h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
765 gint clip_x, gint clip_y, gint clip_w, gint clip_h, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
766 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
|
767 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
768 if (clip_x + clip_w <= x || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
769 clip_x >= x + w || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
770 clip_y + clip_h <= y || |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
771 clip_y >= y + h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
772 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
773 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
774 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
775 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
776 *rx = MAX(x, clip_x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
777 *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
|
778 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
779 *ry = MAX(y, clip_y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
780 *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
|
781 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
782 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
783 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
784 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
785 static gint pr_parent_window_sizable(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
786 { |
27
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
787 GdkWindowState state; |
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
788 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
789 if (!pr->parent_window) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
790 if (!pr->window_fit) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
791 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
|
792 |
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
793 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
|
794 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
|
795 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
|
796 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
797 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
798 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
799 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
800 static gint pr_parent_window_resize(PixbufRenderer *pr, gint w, gint h) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
801 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
802 GtkWidget *widget; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
803 GtkWidget *parent; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
804 gint ww, wh; |
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 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
|
807 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
808 if (pr->window_limit) |
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 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
|
811 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
|
812 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
813 if (w > sw) w = sw; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
814 if (h > sh) h = sh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
815 } |
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 widget = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
818 parent = GTK_WIDGET(pr->parent_window); |
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 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
|
821 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
|
822 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
823 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
|
824 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
|
825 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
826 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
|
827 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
828 return TRUE; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
831 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
|
832 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
833 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
|
834 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
|
835 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
836 pr->parent_window = GTK_WIDGET(window); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
837 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
838 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
839 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
|
840 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
841 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
|
842 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
843 return GTK_WINDOW(pr->parent_window); |
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 |
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 /* |
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 * overlays |
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 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
853 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
|
854 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
|
855 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
856 gint px, py, pw, ph; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
857 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
858 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
|
859 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
|
860 px = od->x; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
861 py = od->y; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
862 |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
863 if (od->flags & OVL_RELATIVE) |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
864 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
865 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
|
866 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
|
867 } |
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 (x) *x = px; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
870 if (y) *y = py; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
871 if (w) *w = pw; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
872 if (h) *h = ph; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
873 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
874 |
1373 | 875 static void pr_overlay_init_window(PixbufRenderer *pr, OverlayData *od) |
876 { | |
877 gint px, py, pw, ph; | |
878 GdkWindowAttr attributes; | |
879 gint attributes_mask; | |
880 | |
881 pr_overlay_get_position(pr, od, &px, &py, &pw, &ph); | |
882 | |
883 attributes.window_type = GDK_WINDOW_CHILD; | |
884 attributes.wclass = GDK_INPUT_OUTPUT; | |
885 attributes.width = pw; | |
886 attributes.height = ph; | |
887 attributes.event_mask = GDK_EXPOSURE_MASK; | |
888 attributes_mask = 0; | |
889 | |
890 od->window = gdk_window_new(GTK_WIDGET(pr)->window, &attributes, attributes_mask); | |
891 gdk_window_set_user_data(od->window, pr); | |
892 gdk_window_move(od->window, px, py); | |
893 gdk_window_show(od->window); | |
894 } | |
895 | |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
896 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
|
897 ImageTile *it) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
898 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
899 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
900 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
901 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
902 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
903 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
904 work = pr->overlay_list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
905 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
906 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
907 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
908 gint px, py, pw, ph; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
909 gint rx, ry, rw, rh; |
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 od = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
912 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
913 |
1373 | 914 if (!od->window) pr_overlay_init_window(pr, od); |
915 | |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
916 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
|
917 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
|
918 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
919 if (!pr->overlay_buffer) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
920 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
921 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
|
922 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
923 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
924 if (it) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
925 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
926 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
|
927 it->pixmap, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
928 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
|
929 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
|
930 0, 0, rw, rh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
931 gdk_draw_pixbuf(pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
932 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
|
933 od->pixbuf, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
934 rx - px, ry - py, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
935 0, 0, rw, rh, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
936 pr->dither_quality, rx, ry); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
937 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
|
938 pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
939 0, 0, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
940 rx - px, ry - py, rw, rh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
941 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
942 else |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
943 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
944 /* 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
|
945 gint sx, sy; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
946 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
947 for (sx = rx; sx < rx + rw; sx += pr->tile_width) |
517 | 948 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
|
949 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
950 gint sw, sh; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
951 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
952 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
|
953 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
|
954 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
955 gdk_draw_rectangle(pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
956 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
|
957 0, 0, sw, sh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
958 gdk_draw_pixbuf(pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
959 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
|
960 od->pixbuf, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
961 sx - px, sy - py, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
962 0, 0, sw, sh, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
963 pr->dither_quality, sx, sy); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
964 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
|
965 pr->overlay_buffer, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
966 0, 0, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
967 sx - px, sy - py, sw, sh); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
968 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
969 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
970 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
971 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
972 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
973 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
974 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
|
975 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
976 gint x, y, w, h; |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
977 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
978 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
|
979 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
|
980 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
|
981 w, h, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
982 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
|
983 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
984 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
|
985 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
986 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
987 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
|
988 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
989 GList *work; |
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 work = pr->overlay_list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
992 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
993 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
994 OverlayData *od = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
995 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
996 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
997 pr_overlay_queue_draw(pr, od); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
998 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
999 } |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1000 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1001 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
|
1002 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1003 GList *work; |
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 work = pr->overlay_list; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1006 while (work) |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1007 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1008 OverlayData *od = work->data; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1009 work = work->next; |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1010 |
1373 | 1011 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
|
1012 |
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1013 if (od->flags & OVL_RELATIVE) |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1014 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1015 gint x, y, w, h; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1016 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1017 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
|
1018 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
|
1019 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1020 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1021 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1022 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1023 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
|
1024 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1025 GList *work; |
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 work = pr->overlay_list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1028 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1029 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1030 OverlayData *od = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1031 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1032 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1033 if (od->id == id) return od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1034 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1035 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1036 return NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1037 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1038 |
1373 | 1039 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1040 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
|
1041 OverlayRendererFlags flags) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1042 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1043 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1044 gint id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1045 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1046 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
|
1047 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
|
1048 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1049 id = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1050 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
|
1051 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1052 od = g_new0(OverlayData, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1053 od->id = id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1054 od->pixbuf = pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1055 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
|
1056 od->x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1057 od->y = y; |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1058 od->flags = flags; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1059 |
1373 | 1060 pr_overlay_init_window(pr, od); |
1061 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1062 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
|
1063 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1064 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
|
1065 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1066 return od->id; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1067 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1068 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1069 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
|
1070 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1071 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
|
1072 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1073 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
|
1074 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
|
1075 g_free(od); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1076 |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1077 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
|
1078 { |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1079 g_object_unref(pr->overlay_buffer); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1080 pr->overlay_buffer = NULL; |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1081 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1082 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1083 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1084 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
|
1085 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1086 while (pr->overlay_list) |
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 OverlayData *od; |
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 od = pr->overlay_list->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1091 pr_overlay_free(pr, od); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1092 } |
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 |
1373 | 1095 static void pr_overlay_list_reset_window(PixbufRenderer *pr) |
1096 { | |
1097 GList *work; | |
1098 | |
1099 if (pr->overlay_buffer) g_object_unref(pr->overlay_buffer); | |
1100 pr->overlay_buffer = NULL; | |
1101 | |
1102 work = pr->overlay_list; | |
1103 while (work) | |
1104 { | |
1105 OverlayData *od = work->data; | |
1106 work = work->next; | |
1107 if (od->window) gdk_window_destroy(od->window); | |
1108 od->window = NULL; | |
1109 } | |
1110 } | |
1111 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1112 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
|
1113 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1114 OverlayData *od; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1115 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1116 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
|
1117 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1118 od = pr_overlay_find(pr, id); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1119 if (!od) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1120 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1121 if (pixbuf) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1122 { |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1123 gint px, py, pw, ph; |
23
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 g_object_ref(G_OBJECT(pixbuf)); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1126 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
|
1127 od->pixbuf = pixbuf; |
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 od->x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1130 od->y = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1131 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1132 pr_overlay_queue_draw(pr, od); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
1133 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
|
1134 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
|
1135 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1136 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
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); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1139 pr_overlay_free(pr, od); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1140 } |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1143 gint pixbuf_renderer_overlay_get(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
|
1144 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1145 OverlayData *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 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
|
1148 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1149 od = pr_overlay_find(pr, id); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1150 if (!od) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1151 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1152 if (pixbuf) *pixbuf = od->pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1153 if (x) *x = od->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1154 if (y) *y = od->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1155 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1156 return TRUE; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1159 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
|
1160 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1161 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
|
1162 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1163 |
1373 | 1164 static void pr_unmap_cb(GtkWidget *widget, gpointer data) |
1165 { | |
1166 PixbufRenderer *pr = data; | |
1167 pr_overlay_list_reset_window(pr); | |
1168 } | |
1169 | |
1170 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1171 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1172 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1173 * scroller overlay |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1174 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1175 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1176 |
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 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
|
1179 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1180 PixbufRenderer *pr = data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1181 gint x, y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1182 gint xinc, yinc; |
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 /* 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
|
1185 * 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
|
1186 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1187 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1188 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
|
1189 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1190 x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1191 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1192 else |
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 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
|
1195 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
|
1196 x += (x > 0) ? -shift : shift; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1199 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
|
1200 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1201 y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1202 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1203 else |
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 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
|
1206 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
|
1207 y += (y > 0) ? -shift : shift; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1210 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
|
1211 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1212 xinc = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1213 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1214 else |
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 xinc = pr->scroller_xinc; |
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 if (x >= 0) |
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 if (xinc < 0) xinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1221 if (x < xinc) xinc = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1222 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
|
1223 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1224 else |
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 = 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
|
1229 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1230 } |
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 (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
|
1233 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1234 yinc = y; |
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 else |
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 yinc = pr->scroller_yinc; |
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 if (y >= 0) |
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 if (yinc < 0) yinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1243 if (y < yinc) yinc = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1244 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
|
1245 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1246 else |
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 = 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
|
1251 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1252 } |
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 pr->scroller_xinc = xinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1255 pr->scroller_yinc = yinc; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1256 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1257 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
|
1258 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
|
1259 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1260 pixbuf_renderer_scroll(pr, xinc, yinc); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1261 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1262 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1263 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1264 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1265 static void pr_scroller_timer_set(PixbufRenderer *pr, gint start) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1266 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1267 if (pr->scroller_id != -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1268 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1269 g_source_remove(pr->scroller_id); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1270 pr->scroller_id = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1271 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1272 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1273 if (start) |
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 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
|
1276 pr_scroller_update_cb, pr); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1280 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
|
1281 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1282 if (pr->scroller_overlay == -1) |
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 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1285 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1286 |
283 | 1287 #ifdef GQ_BUILD |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1288 pixbuf = pixbuf_inline(PIXBUF_INLINE_SCROLLER); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1289 #else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1290 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
|
1291 gdk_pixbuf_fill(pixbuf, 0x000000ff); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1292 #endif |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1293 w = gdk_pixbuf_get_width(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1294 h = gdk_pixbuf_get_height(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1295 |
857
7d387a25b1ec
Use flags instead of int parameters for pixbuf_renderer_overlay_add().
zas_
parents:
856
diff
changeset
|
1296 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
|
1297 g_object_unref(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1298 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1299 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1300 pr->scroller_x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1301 pr->scroller_y = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1302 pr->scroller_xpos = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1303 pr->scroller_ypos = y; |
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 pr_scroller_timer_set(pr, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1306 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1307 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1308 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
|
1309 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1310 if (pr->scroller_id == -1) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1311 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1312 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
|
1313 pr->scroller_overlay = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1314 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1315 pr_scroller_timer_set(pr, FALSE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1316 } |
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 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1319 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1320 * borders |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1321 *------------------------------------------------------------------- |
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 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
|
1325 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1326 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1327 gint rx, ry, rw, rh; |
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 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1330 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1331 if (!box->window) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1332 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1333 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
|
1334 { |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1335 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
|
1336 0, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1337 pr->window_width, pr->window_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1338 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1339 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1340 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
|
1341 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
|
1342 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1343 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1344 } |
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 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
|
1347 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1348 if (pr->x_offset > 0 && |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1349 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
|
1350 0, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1351 pr->x_offset, pr->window_height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1352 &rx, &ry, &rw, &rh)) |
23
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 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
|
1355 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
|
1356 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1357 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
|
1358 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
|
1359 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
|
1360 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
|
1361 &rx, &ry, &rw, &rh)) |
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 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
|
1364 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
|
1365 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1366 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1367 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
|
1368 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1369 if (pr->y_offset > 0 && |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1370 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
|
1371 pr->x_offset, 0, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1372 pr->vis_width, pr->y_offset, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1373 &rx, &ry, &rw, &rh)) |
23
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 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
|
1376 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
|
1377 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1378 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
|
1379 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
|
1380 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
|
1381 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
|
1382 &rx, &ry, &rw, &rh)) |
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 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
|
1385 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
|
1386 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1387 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1388 } |
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 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
|
1391 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1392 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
|
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 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
|
1396 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1397 GtkStyle *style; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1398 GtkWidget *widget; |
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 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
|
1401 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1402 widget = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1403 |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1404 if (color) { |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1405 GdkColor *slot; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1406 |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1407 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
|
1408 slot = &style->bg[GTK_STATE_NORMAL]; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1409 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1410 slot->red = color->red; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1411 slot->green = color->green; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1412 slot->blue = color->blue; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1413 } |
208
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1414 else { |
fa0e05f985c3
set user-defined color as image background - patch by Laurent MONIN
nadvornik
parents:
196
diff
changeset
|
1415 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
|
1416 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1417 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1418 gtk_widget_set_style(widget, style); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1419 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1420 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
|
1421 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1422 |
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 /* |
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 * source tiles |
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 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
|
1431 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1432 if (!st) return; |
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 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
|
1435 g_free(st); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1436 } |
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 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
|
1439 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1440 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1441 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1442 work = pr->source_tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1443 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1444 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1445 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1446 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1447 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1448 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1449 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1450 pr_source_tile_free(st); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1451 } |
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 g_list_free(pr->source_tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1454 pr->source_tiles = NULL; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1457 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
|
1458 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1459 pr_source_tile_free_all(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1460 pr->source_tiles_enabled = FALSE; |
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 gint pr_source_tile_visible(PixbufRenderer *pr, SourceTile *st) |
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 gint x1, y1, x2, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1466 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1467 if (!st) return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1468 |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1469 x1 = (pr->x_scroll / pr->tile_width) * pr->tile_width; |
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1470 y1 = (pr->y_scroll / pr->tile_height) * pr->tile_height; |
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1471 x2 = ((pr->x_scroll + pr->vis_width) / pr->tile_width) * pr->tile_width + pr->tile_width; |
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1472 y2 = ((pr->y_scroll + pr->vis_height) / pr->tile_height) * pr->tile_height + pr->tile_height; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1473 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1474 return !((gdouble)st->x * pr->scale > (gdouble)x2 || |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1475 (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
|
1476 (gdouble)st->y * pr->scale > (gdouble)y2 || |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1477 (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
|
1478 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1479 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1480 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
|
1481 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1482 SourceTile *st = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1483 gint count; |
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 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
|
1486 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1487 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
|
1488 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1489 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
|
1490 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
|
1491 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1492 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1493 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1494 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
|
1495 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
|
1496 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1497 SourceTile *needle; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1498 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1499 needle = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1500 work = work->prev; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1501 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1502 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
|
1503 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1504 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
|
1505 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1506 if (pr->func_tile_dispose) |
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 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
|
1509 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
|
1510 needle->pixbuf, pr->func_tile_data); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1513 if (!st) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1514 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1515 st = needle; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1516 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1517 else |
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 pr_source_tile_free(needle); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1522 count--; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1523 } |
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 } |
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 if (!st) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1528 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1529 st = g_new0(SourceTile, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1530 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
|
1531 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
|
1532 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1533 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1534 st->x = (x / pr->source_tile_width) * pr->source_tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1535 st->y = (y / pr->source_tile_height) * pr->source_tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1536 st->blank = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1537 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1538 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
|
1539 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1540 return st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1541 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1542 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1543 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
|
1544 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1545 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1546 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1547 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
|
1548 if (!st) return NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1549 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1550 if (pr->func_tile_request && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1551 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
|
1552 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
|
1553 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1554 st->blank = FALSE; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1557 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
|
1558 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
|
1559 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1560 return st; |
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 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
|
1564 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1565 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1566 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1567 work = pr->source_tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1568 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1569 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1570 SourceTile *st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1571 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1572 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
|
1573 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
|
1574 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1575 if (work != pr->source_tiles) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1576 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1577 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
|
1578 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
|
1579 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1580 return st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1581 } |
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 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1584 } |
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 NULL; |
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 static GList *pr_source_tile_compute_region(PixbufRenderer *pr, gint x, gint y, gint w, gint h, gint request) |
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 gint x1, y1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1592 GList *list = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1593 gint sx, sy; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1594 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1595 if (x < 0) x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1596 if (y < 0) y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1597 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
|
1598 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
|
1599 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1600 sx = (x / pr->source_tile_width) * pr->source_tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1601 sy = (y / pr->source_tile_height) * pr->source_tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1602 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1603 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
|
1604 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1605 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
|
1606 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1607 SourceTile *st; |
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 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
|
1610 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
|
1611 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1612 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
|
1613 } |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1616 return g_list_reverse(list); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1619 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
|
1620 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1621 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1622 |
95
eb9bb29cbd65
Fri Nov 3 11:40:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
87
diff
changeset
|
1623 if (width < 1 || height < 1) return; |
eb9bb29cbd65
Fri Nov 3 11:40:48 2006 John Ellis <johne@verizon.net>
gqview
parents:
87
diff
changeset
|
1624 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1625 work = pr->source_tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1626 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1627 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1628 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1629 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1630 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1631 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1632 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1633 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1634 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
|
1635 x, y, width, height, |
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1636 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1637 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1638 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1639 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1640 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
|
1641 if (pr->func_tile_request && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1642 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
|
1643 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1644 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
|
1645 rw * pr->scale, rh * pr->scale); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1646 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1647 g_object_unref(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1648 } |
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 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1651 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1652 static gint pr_source_tile_render(PixbufRenderer *pr, ImageTile *it, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1653 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
|
1654 gint new_data, gint fast) |
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 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1657 GList *list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1658 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1659 gint draw = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1660 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1661 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1662 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1663 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
|
1664 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1665 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
|
1666 work = list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1667 while (work) |
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 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1670 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1671 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1672 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1673 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1674 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1675 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
|
1676 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
|
1677 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1678 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1679 if (st->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1680 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1681 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
|
1682 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
|
1683 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1684 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
|
1685 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1686 gdk_draw_pixbuf(it->pixmap, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1687 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
|
1688 st->pixbuf, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1689 rx - st->x, ry - st->y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1690 rx - it->x, ry - it->y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1691 rw, rh, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1692 pr->dither_quality, rx, ry); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1693 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1694 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1695 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1696 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1697 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1698 { |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1699 gdouble scale_x, scale_y; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1700 gint sx, sy, sw, sh; |
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 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
|
1703 scale_x = (gdouble)pr->width / pr->image_width; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1704 scale_y = (gdouble)pr->height / pr->image_height; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1705 |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1706 sx = (gdouble)(it->x + x) / scale_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1707 sy = (gdouble)(it->y + y) / scale_y; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1708 sw = (gdouble)w / scale_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1709 sh = (gdouble)h / scale_y; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1710 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1711 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
|
1712 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1713 #if 0 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1714 /* 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
|
1715 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
|
1716 #endif |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1717 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1718 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
|
1719 work = list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1720 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1721 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1722 SourceTile *st; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1723 gint rx, ry, rw, rh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1724 gint stx, sty, stw, sth; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1725 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1726 st = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1727 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1728 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1729 stx = floor((gdouble)st->x * scale_x); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1730 sty = floor((gdouble)st->y * scale_y); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1731 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
|
1732 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
|
1733 |
33
a41ecbb26a96
Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents:
32
diff
changeset
|
1734 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
|
1735 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
|
1736 &rx, &ry, &rw, &rh)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1737 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1738 if (st->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1739 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1740 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
|
1741 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
|
1742 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1743 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1744 { |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1745 gdouble offset_x; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1746 gdouble offset_y; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1747 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1748 /* 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
|
1749 offset_x = (gdouble)(stx - it->x); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1750 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
|
1751 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1752 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
|
1753 (gdouble) 0.0 + offset_x, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
1754 (gdouble) 0.0 + offset_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1755 scale_x, scale_y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1756 (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
|
1757 draw = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1758 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1759 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1760 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1761 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1762 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1763 g_list_free(list); |
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 return draw; |
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 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
|
1769 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
|
1770 PixbufRendererTileRequestFunc func_request, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1771 PixbufRendererTileDisposeFunc func_dispose, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1772 gpointer user_data, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1773 gdouble zoom) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1774 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1775 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
|
1776 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
|
1777 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
|
1778 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
|
1779 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1780 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
|
1781 pr->pixbuf = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1782 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1783 pr_source_tile_unset(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1784 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1785 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
|
1786 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1787 pr->source_tiles_enabled = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1788 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
|
1789 pr->source_tile_width = tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1790 pr->source_tile_height = tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1791 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1792 pr->image_width = width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1793 pr->image_height = height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1794 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1795 pr->func_tile_request = func_request; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1796 pr->func_tile_dispose = func_dispose; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1797 pr->func_tile_data = user_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1798 |
859 | 1799 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
|
1800 pr_redraw(pr, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1801 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1802 |
77
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1803 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
|
1804 { |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1805 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
|
1806 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
|
1807 |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1808 if (!pr->source_tiles_enabled) return; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1809 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
|
1810 |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1811 pr->image_width = width; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1812 pr->image_height = height; |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1813 |
859 | 1814 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
|
1815 } |
44f2223541d1
Sun Oct 15 10:45:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
61
diff
changeset
|
1816 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1817 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
|
1818 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1819 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
|
1820 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1821 return pr->source_tiles_enabled; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1822 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1823 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1824 static void pr_zoom_adjust_real(PixbufRenderer *pr, gdouble increment, |
859 | 1825 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
|
1826 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1827 gdouble zoom = pr->zoom; |
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 if (increment == 0.0) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1830 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1831 if (zoom == 0.0) |
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 if (pr->scale < 1.0) |
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 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
|
1836 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1837 else |
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 zoom = pr->scale; |
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 } |
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 if (increment < 0.0) |
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 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
|
1846 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1847 zoom = zoom + increment - 2.0; |
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 else |
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 zoom = zoom + increment; |
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 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1854 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1855 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1856 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
|
1857 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1858 zoom = zoom + increment + 2.0; |
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 zoom = zoom + increment; |
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 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1865 |
859 | 1866 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
|
1867 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1868 |
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 * display tiles |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1872 *------------------------------------------------------------------- |
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 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
|
1876 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1877 ImageTile *it; |
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 it = g_new0(ImageTile, 1); |
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 it->x = x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1882 it->y = y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1883 it->w = width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1884 it->h = height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1885 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1886 it->render_done = TILE_RENDER_NONE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1887 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1888 return it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1889 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1890 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1891 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
|
1892 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1893 if (!it) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1894 |
1043 | 1895 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
|
1896 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
|
1897 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1898 g_free(it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1899 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1900 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1901 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
|
1902 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1903 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1904 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1905 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1906 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1907 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1908 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1909 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1910 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1911 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1912 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1913 pr_tile_free(it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1914 } |
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 g_list_free(pr->tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1917 pr->tiles = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1918 pr->tile_cache_size = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1919 } |
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 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
|
1922 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1923 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1924 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1925 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
|
1926 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1927 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
|
1928 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
|
1929 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1930 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
|
1931 pr->tile_cache_size += it->size; |
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 return it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1934 } |
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 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
|
1937 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1938 if (it->qd) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1939 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1940 QueueData *qd = it->qd; |
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 it->qd = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1943 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
|
1944 g_free(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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1947 if (it->qd2) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1948 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1949 QueueData *qd = it->qd2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1950 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1951 it->qd2 = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1952 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
|
1953 g_free(qd); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1956 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
|
1957 pr->tile_cache_size -= it->size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1958 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1959 pr_tile_free(it); |
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 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
|
1963 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1964 GList *work; |
736 | 1965 guint tile_max; |
23
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 work = g_list_last(pr->tiles); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1968 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1969 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
|
1970 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1971 gint tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1972 |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
1973 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
|
1974 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
|
1975 (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
|
1976 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1977 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1978 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1979 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
|
1980 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1981 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1982 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
|
1983 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1984 ImageTile *needle; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1985 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1986 needle = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1987 work = work->prev; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1988 if (needle != it && |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1989 ((!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
|
1990 } |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1993 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
|
1994 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1995 GList *work; |
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 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1998 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
1999 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2000 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2001 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2002 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2003 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2004 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2005 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
|
2006 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
|
2007 it->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2008 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2009 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
|
2010 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
|
2011 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2012 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2013 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2014 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
|
2015 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2016 gint x1, x2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2017 gint y1, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2018 GList *work; |
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 x1 = (gint)floor(x / pr->tile_width) * pr->tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2021 x2 = (gint)ceil((x + w) / pr->tile_width) * pr->tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2022 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2023 y1 = (gint)floor(y / pr->tile_height) * pr->tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2024 y2 = (gint)ceil((y + h) / pr->tile_height) * pr->tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2025 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2026 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2027 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2028 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2029 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2030 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2031 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2032 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2033 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2034 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
|
2035 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
|
2036 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2037 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
|
2038 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
|
2039 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2040 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2041 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2042 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
2043 static ImageTile *pr_tile_get(PixbufRenderer *pr, gint x, gint y, gint only_existing) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2044 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2045 GList *work; |
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 work = pr->tiles; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2048 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2049 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2050 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2051 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2052 it = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2053 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
|
2054 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2055 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
|
2056 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
|
2057 return it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2058 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2059 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2060 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2061 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2062 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
2063 if (only_existing) return NULL; |
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
2064 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2065 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
|
2066 } |
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 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
|
2069 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2070 if (!it->pixmap) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2071 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2072 GdkPixmap *pixmap; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2073 guint size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2074 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2075 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
|
2076 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2077 size = pixmap_calc_size(pixmap); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2078 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
|
2079 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2080 it->pixmap = pixmap; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2081 it->size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2082 pr->tile_cache_size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2083 } |
442 | 2084 |
2085 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
|
2086 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
|
2087 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2088 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2089 guint size; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2090 #if 0 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2091 /* 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
|
2092 if (pr->pixbuf) |
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 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
|
2095 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
|
2096 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
|
2097 pr->tile_width, pr->tile_height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2098 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2099 else |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2100 #endif |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2101 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2102 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
|
2103 } |
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 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
|
2106 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
|
2107 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2108 it->pixbuf = pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2109 it->size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2110 pr->tile_cache_size += size; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2111 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2112 } |
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 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2115 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2116 * drawing |
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 */ |
442 | 2119 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2120 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2121 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
|
2122 gdouble tile_x, gdouble tile_y, /* coordinates of the tile */ |
442 | 2123 gint image_w, gint image_h, |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2124 gdouble tile_w, gdouble tile_h, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2125 gdouble *res_x, gdouble *res_y) |
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 *res_x = tile_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2128 *res_y = tile_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2129 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2130 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2131 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2132 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2133 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2134 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2135 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2136 *res_x = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2137 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2138 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2139 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2140 *res_x = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2141 *res_y = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2142 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2143 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2144 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2145 *res_y = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2146 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2147 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2148 *res_x = tile_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2149 *res_y = tile_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2150 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2151 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2152 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2153 *res_x = tile_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2154 *res_y = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2155 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2156 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2157 *res_x = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2158 *res_y = image_w - tile_x - tile_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2159 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2160 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2161 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2162 *res_x = image_h - tile_y - tile_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2163 *res_y = tile_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2164 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2165 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2166 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2167 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2168 } |
673
fbebf5cf4a55
Do not use printf() directly but use new wrapper function log_printf() instead.
zas_
parents:
671
diff
changeset
|
2169 // log_printf("tile coord y:%f, ih:%d, th:%f ry:%f\n", tile_y, image_h, tile_h, *res_x); |
442 | 2170 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2171 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2172 static void pr_tile_region_map_orientation(PixbufRenderer *pr, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2173 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
|
2174 gint tile_w, gint tile_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2175 gint area_w, gint area_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2176 gint *res_x, gint *res_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2177 gint *res_w, gint *res_h) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2178 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2179 *res_x = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2180 *res_y = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2181 *res_w = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2182 *res_h = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2183 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2184 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2185 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2186 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2187 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2188 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2189 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2190 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2191 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2192 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2193 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2194 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2195 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2196 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2197 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2198 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2199 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2200 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2201 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2202 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2203 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2204 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2205 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2206 *res_h = area_w; |
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_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2209 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2210 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2211 *res_y = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2212 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2213 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2214 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2215 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2216 *res_x = tile_h - area_y - area_h; |
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_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2222 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2223 *res_x = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2224 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2225 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2226 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2227 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2228 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2229 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2230 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2231 } |
673
fbebf5cf4a55
Do not use printf() directly but use new wrapper function log_printf() instead.
zas_
parents:
671
diff
changeset
|
2232 // log_printf("inside y:%d, th:%d, ah:%d ry:%d\n", area_y, tile_h, area_h, *res_x); |
442 | 2233 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2234 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2235 static void pr_coords_map_orientation_reverse(PixbufRenderer *pr, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2236 gint area_x, gint area_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2237 gint tile_w, gint tile_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2238 gint area_w, gint area_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2239 gint *res_x, gint *res_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2240 gint *res_w, gint *res_h) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2241 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2242 *res_x = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2243 *res_y = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2244 *res_w = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2245 *res_h = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2246 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2247 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2248 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2249 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2250 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2251 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2252 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2253 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2254 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2255 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2256 case EXIF_ORIENTATION_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2257 /* upside down */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2258 *res_x = tile_w - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2259 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2260 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2261 case EXIF_ORIENTATION_BOTTOM_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2262 /* flipped */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2263 *res_y = tile_h - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2264 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2265 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2266 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2267 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2268 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2269 *res_h = area_w; |
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_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2272 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2273 *res_x = tile_w - area_y - area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2274 *res_y = area_x; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2275 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2276 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2277 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2278 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
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 = tile_h - area_x - area_w; |
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_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2285 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2286 *res_x = area_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2287 *res_y = tile_h - area_x - area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2288 *res_w = area_h; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2289 *res_h = area_w; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2290 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2291 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2292 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2293 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2294 } |
442 | 2295 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2296 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2297 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2298 static GdkPixbuf *pr_get_spare_tile(PixbufRenderer *pr) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2299 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2300 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
|
2301 return pr->spare_tile; |
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 |
404 | 2304 #define COLOR_BYTES 3 /* rgb */ |
2305 | |
2306 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
|
2307 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2308 GdkPixbuf *src = *tile; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2309 GdkPixbuf *dest; |
404 | 2310 gint srs, drs; |
2311 guchar *s_pix, *d_pix; | |
2312 guchar *sp, *dp; | |
2313 guchar *ip, *spi, *dpi; | |
409 | 2314 gint i, j; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2315 gint tw = pr->tile_width; |
442 | 2316 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2317 srs = gdk_pixbuf_get_rowstride(src); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2318 s_pix = gdk_pixbuf_get_pixels(src); |
404 | 2319 spi = s_pix + (x * COLOR_BYTES); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2320 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2321 dest = pr_get_spare_tile(pr); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2322 drs = gdk_pixbuf_get_rowstride(dest); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2323 d_pix = gdk_pixbuf_get_pixels(dest); |
404 | 2324 dpi = d_pix + (tw - 1) * COLOR_BYTES; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2325 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2326 for (i = y; i < y + h; i++) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2327 { |
404 | 2328 sp = spi + (i * srs); |
2329 ip = dpi - (i * COLOR_BYTES); | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2330 for (j = x; j < x + w; j++) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2331 { |
404 | 2332 dp = ip + (j * drs); |
409 | 2333 memcpy(dp, sp, COLOR_BYTES); |
2334 sp += COLOR_BYTES; | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2335 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2336 } |
442 | 2337 |
404 | 2338 pr->spare_tile = src; |
2339 *tile = dest; | |
2340 } | |
2341 | |
2342 static void pr_tile_rotate_90_counter_clockwise(PixbufRenderer *pr, GdkPixbuf **tile, gint x, gint y, gint w, gint h) | |
2343 { | |
2344 GdkPixbuf *src = *tile; | |
2345 GdkPixbuf *dest; | |
2346 gint srs, drs; | |
2347 guchar *s_pix, *d_pix; | |
2348 guchar *sp, *dp; | |
2349 guchar *ip, *spi, *dpi; | |
409 | 2350 gint i, j; |
404 | 2351 gint th = pr->tile_height; |
442 | 2352 |
404 | 2353 srs = gdk_pixbuf_get_rowstride(src); |
2354 s_pix = gdk_pixbuf_get_pixels(src); | |
2355 spi = s_pix + (x * COLOR_BYTES); | |
2356 | |
2357 dest = pr_get_spare_tile(pr); | |
2358 drs = gdk_pixbuf_get_rowstride(dest); | |
2359 d_pix = gdk_pixbuf_get_pixels(dest); | |
2360 dpi = d_pix + (th - 1) * drs; | |
2361 | |
2362 for (i = y; i < y + h; i++) | |
2363 { | |
2364 sp = spi + (i * srs); | |
2365 ip = dpi + (i * COLOR_BYTES); | |
2366 for (j = x; j < x + w; j++) | |
2367 { | |
2368 dp = ip - (j * drs); | |
409 | 2369 memcpy(dp, sp, COLOR_BYTES); |
2370 sp += COLOR_BYTES; | |
404 | 2371 } |
2372 } | |
442 | 2373 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2374 pr->spare_tile = src; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2375 *tile = dest; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2376 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2377 |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2378 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
|
2379 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2380 GdkPixbuf *src = *tile; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2381 GdkPixbuf *dest; |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2382 gint srs, drs; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2383 guchar *s_pix, *d_pix; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2384 guchar *sp, *dp; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2385 guchar *spi, *dpi; |
409 | 2386 gint i, j; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2387 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2388 gint tw = pr->tile_width; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2389 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2390 srs = gdk_pixbuf_get_rowstride(src); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2391 s_pix = gdk_pixbuf_get_pixels(src); |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2392 spi = s_pix + (x * COLOR_BYTES); |
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 dest = pr_get_spare_tile(pr); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2395 drs = gdk_pixbuf_get_rowstride(dest); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2396 d_pix = gdk_pixbuf_get_pixels(dest); |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2397 dpi = d_pix + (tw - x - 1) * COLOR_BYTES; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2398 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2399 for (i = y; i < y + h; i++) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2400 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2401 sp = spi + (i * srs); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2402 dp = dpi + (i * drs); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2403 for (j = 0; j < w; j++) |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2404 { |
409 | 2405 memcpy(dp, sp, COLOR_BYTES); |
2406 sp += COLOR_BYTES; | |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2407 dp -= COLOR_BYTES; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2408 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2409 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2410 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2411 pr->spare_tile = src; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2412 *tile = dest; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2413 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2414 |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2415 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
|
2416 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2417 GdkPixbuf *src = *tile; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2418 GdkPixbuf *dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2419 gint srs, drs; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2420 guchar *s_pix, *d_pix; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2421 guchar *sp, *dp; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2422 guchar *spi, *dpi; |
409 | 2423 gint i, j; |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2424 gint tw = pr->tile_width; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2425 gint th = pr->tile_height; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2426 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2427 srs = gdk_pixbuf_get_rowstride(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2428 s_pix = gdk_pixbuf_get_pixels(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2429 spi = s_pix + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2430 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2431 dest = pr_get_spare_tile(pr); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2432 drs = gdk_pixbuf_get_rowstride(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2433 d_pix = gdk_pixbuf_get_pixels(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2434 dpi = d_pix + (th - 1) * drs + (tw - 1) * COLOR_BYTES; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2435 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2436 for (i = y; i < y + h; i++) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2437 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2438 sp = s_pix + (i * srs) + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2439 dp = dpi - (i * drs) - (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2440 for (j = 0; j < w; j++) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2441 { |
409 | 2442 memcpy(dp, sp, COLOR_BYTES); |
2443 sp += COLOR_BYTES; | |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2444 dp -= COLOR_BYTES; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2445 } |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2446 } |
442 | 2447 |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2448 pr->spare_tile = src; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2449 *tile = dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2450 } |
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 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
|
2453 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2454 GdkPixbuf *src = *tile; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2455 GdkPixbuf *dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2456 gint srs, drs; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2457 guchar *s_pix, *d_pix; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2458 guchar *sp, *dp; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2459 guchar *spi, *dpi; |
409 | 2460 gint i; |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2461 gint th = pr->tile_height; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2462 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2463 srs = gdk_pixbuf_get_rowstride(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2464 s_pix = gdk_pixbuf_get_pixels(src); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2465 spi = s_pix + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2466 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2467 dest = pr_get_spare_tile(pr); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2468 drs = gdk_pixbuf_get_rowstride(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2469 d_pix = gdk_pixbuf_get_pixels(dest); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2470 dpi = d_pix + (th - 1) * drs + (x * COLOR_BYTES); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2471 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2472 for (i = y; i < y + h; i++) |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2473 { |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2474 sp = spi + (i * srs); |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2475 dp = dpi - (i * drs); |
409 | 2476 memcpy(dp, sp, w * COLOR_BYTES); |
408
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 |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2479 pr->spare_tile = src; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2480 *tile = dest; |
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2481 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2482 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2483 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
|
2484 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2485 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2486 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2487 case EXIF_ORIENTATION_TOP_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2488 /* normal -- nothing to do */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2489 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2490 case EXIF_ORIENTATION_TOP_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2491 /* mirrored */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2492 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2493 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
|
2494 } |
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_BOTTOM_RIGHT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2497 /* upside down */ |
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_and_flip(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_LEFT: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2503 /* flipped */ |
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_flip_only(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_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2509 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2510 pr_tile_flip_only(pr, pixbuf, x, y, w, h); |
404 | 2511 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
|
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_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2515 /* rotated -90 (270) */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2516 { |
404 | 2517 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
|
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_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2521 { |
408
fcba18ac1551
Explode pr_tile_mirror() in three optimized functions:
zas_
parents:
404
diff
changeset
|
2522 pr_tile_flip_only(pr, pixbuf, x, y, w, h); |
404 | 2523 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
|
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_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2527 /* rotated 90 */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2528 { |
404 | 2529 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
|
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 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2533 /* The other values are out of range */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2534 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2535 } |
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 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2538 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2539 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
|
2540 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
|
2541 gint new_data, gint fast) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2542 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2543 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2544 gint has_alpha; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2545 gint draw = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2546 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2547 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
|
2548 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2549 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
|
2550 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2551 x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2552 y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2553 w = it->w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2554 h = it->h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2555 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
|
2556 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2557 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
|
2558 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2559 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
|
2560 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2561 } |
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 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
|
2564 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2565 if (new_data) it->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2566 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2567 pr_tile_prepare(pr, it); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2568 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
|
2569 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2570 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2571 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2572 /* 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
|
2573 * 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
|
2574 */ |
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 if (it->blank) |
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 /* no data, do fast rect fill */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2579 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
|
2580 0, 0, it->w, it->h); |
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 else if (pr->source_tiles_enabled) |
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 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
|
2585 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2586 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
|
2587 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2588 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2589 gdouble src_x, src_y; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2590 gint pb_x, pb_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2591 gint pb_w, pb_h; |
442 | 2592 pr_tile_coords_map_orientation(pr, it->x, it->y, |
2593 pr->image_width, pr->image_height, | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2594 pr->tile_width, pr->tile_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2595 &src_x, &src_y); |
442 | 2596 pr_tile_region_map_orientation(pr, x, y, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2597 pr->tile_width, pr->tile_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2598 w, h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2599 &pb_x, &pb_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2600 &pb_w, &pb_h); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2601 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2602 if (has_alpha) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2603 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2604 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
|
2605 (gdouble) 0.0 - src_x, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2606 (gdouble) 0.0 - src_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2607 1.0, 1.0, GDK_INTERP_NEAREST, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2608 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
|
2609 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
|
2610 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
|
2611 draw = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2612 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2613 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2614 { |
442 | 2615 |
2616 | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2617 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
|
2618 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2619 /* faster, simple, base orientation, no postprocessing */ |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2620 gdk_draw_pixbuf(it->pixmap, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2621 box->style->fg_gc[GTK_WIDGET_STATE(box)], |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2622 pr->pixbuf, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2623 it->x + x, it->y + y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2624 x, y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2625 w, h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2626 pr->dither_quality, it->x + x, it->y + y); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2627 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2628 else |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2629 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2630 gdk_pixbuf_copy_area(pr->pixbuf, |
442 | 2631 src_x + pb_x, src_y + pb_y, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2632 pb_w, pb_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2633 it->pixbuf, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2634 pb_x, pb_y); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2635 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
|
2636 draw = TRUE; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2637 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2638 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2639 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2640 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2641 { |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2642 gdouble scale_x, scale_y; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2643 gdouble src_x, src_y; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2644 gint pb_x, pb_y; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2645 gint pb_w, pb_h; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2646 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2647 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
|
2648 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2649 scale_x = (gdouble)pr->width / pr->image_width; |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2650 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
|
2651 |
442 | 2652 pr_tile_coords_map_orientation(pr, it->x / scale_x, it->y /scale_y , |
2653 pr->image_width, pr->image_height, | |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2654 pr->tile_width / scale_x , pr->tile_height / scale_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2655 &src_x, &src_y); |
442 | 2656 pr_tile_region_map_orientation(pr, x, y, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2657 pr->tile_width, pr->tile_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2658 w, h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2659 &pb_x, &pb_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2660 &pb_w, &pb_h); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2661 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2662 /* 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
|
2663 * 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
|
2664 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2665 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
|
2666 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2667 if (!has_alpha) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2668 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2669 gdk_pixbuf_scale(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
|
2670 (gdouble) 0.0 - src_x * scale_x, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2671 (gdouble) 0.0 - src_y * scale_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2672 scale_x, scale_y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2673 (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
|
2674 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2675 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2676 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2677 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
|
2678 (gdouble) 0.0 - src_x * scale_x, |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
2679 (gdouble) 0.0 - src_y * scale_y, |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2680 scale_x, scale_y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2681 (fast) ? GDK_INTERP_NEAREST : pr->zoom_quality, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2682 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
|
2683 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
|
2684 } |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2685 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
|
2686 draw = 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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2689 if (draw && it->pixbuf && !it->blank) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2690 { |
442 | 2691 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2692 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
|
2693 pr->func_post_process(pr, &it->pixbuf, x, y, w, h, pr->post_process_user_data); |
442 | 2694 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2695 gdk_draw_pixbuf(it->pixmap, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2696 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
|
2697 it->pixbuf, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2698 x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2699 x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2700 w, h, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2701 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
|
2702 } |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2703 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2704 #if 0 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2705 /* 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
|
2706 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
|
2707 FALSE, 0, 0, it->w, it->h); |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2708 gdk_draw_rectangle(it->pixmap, box->style->white_gc, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2709 FALSE, x, y, w, h); |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
2710 #endif |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2711 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2712 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2713 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2714 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
|
2715 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
|
2716 gint new_data, gint fast) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2717 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2718 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2719 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2720 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
|
2721 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2722 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2723 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2724 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
|
2725 it->pixmap, x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2726 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
|
2727 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2728 if (pr->overlay_list) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2729 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2730 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
|
2731 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
|
2732 w, h, |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
2733 it); |
23
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 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2736 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2737 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2738 static gint pr_tile_is_visible(PixbufRenderer *pr, ImageTile *it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2739 { |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
2740 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
|
2741 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
|
2742 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2743 |
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 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2746 * draw queue |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2747 *------------------------------------------------------------------- |
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 |
1030 | 2750 static gint pr_get_queued_area(GList *work) |
2751 { | |
2752 gint area = 0; | |
2753 | |
2754 while (work) | |
2755 { | |
2756 QueueData *qd = work->data; | |
2757 area += qd->w * qd->h; | |
2758 work = work->next; | |
2759 } | |
2760 return area; | |
2761 } | |
2762 | |
2763 | |
2764 static gint pr_queue_schedule_next_draw(PixbufRenderer *pr, gboolean force_set) | |
2765 { | |
2766 gfloat percent; | |
2767 gint visible_area = pr->vis_width * pr->vis_height; | |
2768 | |
2769 if (!pr->loading) | |
2770 { | |
2771 /* 2pass prio */ | |
1035 | 2772 DEBUG_2("redraw priority: 2pass"); |
1033
8db1017c4ca0
adjusted redraw priority relative to icon drawing
nadvornik
parents:
1030
diff
changeset
|
2773 pr->draw_idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, pr_queue_draw_idle_cb, pr, NULL); |
1030 | 2774 return FALSE; |
2775 } | |
2776 | |
2777 if (visible_area == 0) | |
2778 { | |
2779 /* not known yet */ | |
2780 percent = 100.0; | |
2781 } | |
2782 else | |
2783 { | |
2784 percent = 100.0 * pr_get_queued_area(pr->draw_queue) / visible_area; | |
2785 } | |
2786 | |
2787 if (percent > 10.0) | |
2788 { | |
2789 /* we have enough data for starting intensive redrawing */ | |
1035 | 2790 DEBUG_2("redraw priority: high %.2f %%", percent); |
1030 | 2791 pr->draw_idle_id = g_idle_add_full(GDK_PRIORITY_REDRAW, pr_queue_draw_idle_cb, pr, NULL); |
2792 return FALSE; | |
2793 } | |
2794 | |
2795 if (percent < 1.0 || force_set) | |
2796 { | |
2797 /* queue is (almost) empty, wait 50 ms*/ | |
1035 | 2798 DEBUG_2("redraw priority: wait %.2f %%", percent); |
1030 | 2799 pr->draw_idle_id = g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 50, pr_queue_draw_idle_cb, pr, NULL); |
2800 return FALSE; | |
2801 } | |
2802 | |
2803 /* keep the same priority as before */ | |
1035 | 2804 DEBUG_2("redraw priority: no change %.2f %%", percent); |
1030 | 2805 return TRUE; |
2806 } | |
2807 | |
2808 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2809 static gint pr_queue_draw_idle_cb(gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2810 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2811 PixbufRenderer *pr = data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2812 QueueData *qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2813 gint fast; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2814 |
1030 | 2815 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2816 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
|
2817 (!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
|
2818 pr->draw_idle_id == -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2819 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
2820 pr_render_complete_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2821 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2822 pr->draw_idle_id = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2823 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2824 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2825 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2826 if (pr->draw_queue) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2827 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2828 qd = pr->draw_queue->data; |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
2829 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
|
2830 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2831 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2832 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2833 if (pr->loading) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2834 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2835 /* 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
|
2836 |
1030 | 2837 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
|
2838 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2839 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2840 qd = pr->draw_queue_2pass->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2841 fast = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2842 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2843 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2844 if (GTK_WIDGET_REALIZED(pr)) |
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 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
|
2847 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2848 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
|
2849 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2850 else if (qd->new_data) |
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 /* 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
|
2853 qd->it->blank = FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2854 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
|
2855 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2856 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
|
2857 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2858 } |
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 if (pr->draw_queue) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2862 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2863 qd->it->qd = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2864 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
|
2865 if (fast) |
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 (qd->it->qd2) |
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_queue_merge(qd->it->qd2, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2870 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2871 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2872 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2873 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2874 qd->it->qd2 = qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2875 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
|
2876 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2877 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2878 else |
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 g_free(qd); |
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 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2883 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2884 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2885 qd->it->qd2 = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2886 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
|
2887 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2888 } |
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 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
|
2891 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
2892 pr_render_complete_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2893 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2894 pr->draw_idle_id = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2895 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2896 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2897 |
1030 | 2898 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
|
2899 } |
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 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
|
2902 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2903 GList *work; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2904 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2905 work = list; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2906 while (work) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2907 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2908 QueueData *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 qd = work->data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2911 work = work->next; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2912 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2913 qd->it->qd = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2914 qd->it->qd2 = NULL; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2915 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2916 } |
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 g_list_free(list); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2919 } |
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 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
|
2922 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2923 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
|
2924 pr->draw_queue = NULL; |
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 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
|
2927 pr->draw_queue_2pass = NULL; |
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 if (pr->draw_idle_id != -1) g_source_remove(pr->draw_idle_id); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2930 pr->draw_idle_id = -1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2931 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2932 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2933 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
|
2934 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2935 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
|
2936 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2937 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
|
2938 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2939 if (parent->x > qd->x) |
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 parent->w += parent->x - qd->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2942 parent->x = qd->x; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2945 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
|
2946 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2947 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
|
2948 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2949 if (parent->y > qd->y) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2950 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2951 parent->h += parent->y - qd->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2952 parent->y = qd->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2953 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2954 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2955 parent->new_data |= qd->new_data; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2958 static gint pr_clamp_to_visible(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
|
2959 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2960 gint nx, ny; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2961 gint nw, nh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2962 gint vx, vy; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2963 gint vw, vh; |
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 vw = pr->vis_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2966 vh = pr->vis_height; |
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 vx = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2969 vy = pr->y_scroll; |
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 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
|
2972 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2973 /* now clamp it */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2974 nx = CLAMP(*x, vx, vx + vw); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2975 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
|
2976 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2977 ny = CLAMP(*y, vy, vy + vh); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2978 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
|
2979 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2980 *x = nx; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2981 *y = ny; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2982 *w = nw; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2983 *h = nh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2984 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2985 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2986 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2987 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2988 static gint pr_queue_to_tiles(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
2989 gint clamp, ImageTileRenderType render, gint new_data, gint only_existing) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2990 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2991 gint i, j; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2992 gint x1, x2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2993 gint y1, y2; |
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 (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
|
2996 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2997 x1 = (gint)floor(x / pr->tile_width) * pr->tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2998 x2 = (gint)ceil((x + w) / pr->tile_width) * pr->tile_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
2999 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3000 y1 = (gint)floor(y / pr->tile_height) * pr->tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3001 y2 = (gint)ceil((y + h) / pr->tile_height) * pr->tile_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3002 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3003 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
|
3004 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3005 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
|
3006 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3007 ImageTile *it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3008 |
32
96ac60a9c0f1
Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents:
31
diff
changeset
|
3009 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
|
3010 (only_existing && |
34
772fe5a509b1
Thu Apr 7 08:42:54 2005 John Ellis <johne@verizon.net>
gqview
parents:
33
diff
changeset
|
3011 (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
|
3012 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
|
3013 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
|
3014 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
|
3015 if (it) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3016 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3017 QueueData *qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3018 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3019 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
|
3020 (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
|
3021 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3022 it->render_todo = render; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3023 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3024 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3025 qd = g_new(QueueData, 1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3026 qd->it = it; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3027 qd->new_data = new_data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3028 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3029 if (i < x) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3030 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3031 qd->x = x - i; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3032 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3033 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3034 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3035 qd->x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3036 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3037 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
|
3038 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
|
3039 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3040 if (j < y) |
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 qd->y = y - j; |
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 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3045 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3046 qd->y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3047 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3048 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
|
3049 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
|
3050 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3051 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
|
3052 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3053 g_free(qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3054 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3055 else if (it->qd) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3056 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3057 pr_queue_merge(it->qd, qd); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3058 g_free(qd); |
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 else |
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 it->qd = qd; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3063 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
|
3064 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3065 } |
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 } |
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 return TRUE; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3072 static void pr_queue(PixbufRenderer *pr, gint x, gint y, gint w, gint h, |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3073 gint clamp, ImageTileRenderType render, gint new_data, gint only_existing) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3074 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3075 gint nx, ny; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3076 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3077 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
|
3078 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
|
3079 w -= (nx - x); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3080 h -= (ny - y); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3081 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
|
3082 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
|
3083 if (w < 1 || h < 1) return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3084 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3085 if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data, only_existing) && |
1030 | 3086 ((!pr->draw_queue && !pr->draw_queue_2pass) || pr->draw_idle_id == -1)) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3087 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3088 if (pr->draw_idle_id != -1) g_source_remove(pr->draw_idle_id); |
1030 | 3089 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
|
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 static void pr_redraw(PixbufRenderer *pr, gint new_data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3094 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3095 pr_queue_clear(pr); |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3096 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
|
3097 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3098 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3099 /* |
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 * signal emission |
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 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3104 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3105 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
|
3106 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3107 #if 0 |
673
fbebf5cf4a55
Do not use printf() directly but use new wrapper function log_printf() instead.
zas_
parents:
671
diff
changeset
|
3108 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
|
3109 #endif |
506
fc9c8a3e1a8b
Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents:
495
diff
changeset
|
3110 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
|
3111 pr->debug_updated = TRUE; |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3112 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3113 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3114 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
|
3115 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3116 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
|
3117 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3118 |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3119 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
|
3120 { |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3121 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
|
3122 } |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3123 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3124 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
|
3125 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3126 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
|
3127 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3128 |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3129 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
|
3130 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3131 if (!pr->complete) |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3132 { |
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3133 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
|
3134 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
|
3135 } |
386
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3136 if (pr->debug_updated) |
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3137 { |
506
fc9c8a3e1a8b
Handle the newline in DEBUG_N() macro instead of adding one
zas_
parents:
495
diff
changeset
|
3138 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
|
3139 pr->debug_updated = FALSE; |
0226daf8c30b
in debug mode print time information on selected events
nadvornik
parents:
336
diff
changeset
|
3140 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3141 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3142 |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3143 static void pr_drag_signal(PixbufRenderer *pr, GdkEventButton *bevent) |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3144 { |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3145 g_signal_emit(pr, signals[SIGNAL_DRAG], 0, bevent); |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3146 } |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3147 |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3148 static void pr_update_pixel_signal(PixbufRenderer *pr) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3149 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3150 g_signal_emit(pr, signals[SIGNAL_UPDATE_PIXEL], 0); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3151 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3152 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3153 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3154 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3155 * sync and clamp |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3156 *------------------------------------------------------------------- |
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 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3159 static void pixbuf_renderer_sync_scroll_center(PixbufRenderer *pr) |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3160 { |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3161 gint src_x, src_y; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3162 if (!pr->width || !pr->height) return; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3163 |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3164 src_x = pr->x_scroll + pr->vis_width / 2; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3165 src_y = pr->y_scroll + pr->vis_height / 2; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3166 |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3167 pr->norm_center_x = (gdouble)src_x / pr->width; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3168 pr->norm_center_y = (gdouble)src_y / pr->height; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3169 } |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3170 |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3171 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3172 static gint pr_scroll_clamp(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3173 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3174 gint old_xs; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3175 gint old_ys; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3176 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3177 if (pr->zoom == 0.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3178 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3179 pr->x_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3180 pr->y_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3181 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3182 return FALSE; |
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 old_xs = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3186 old_ys = pr->y_scroll; |
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 if (pr->x_offset > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3189 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3190 pr->x_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3191 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3192 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3193 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3194 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
|
3195 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3196 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3197 if (pr->y_offset > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3198 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3199 pr->y_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3200 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3201 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3202 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3203 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
|
3204 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3205 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3206 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3207 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3208 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
|
3209 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3210 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3211 static gint pr_size_clamp(PixbufRenderer *pr) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3212 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3213 gint old_vw, old_vh; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3214 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3215 old_vw = pr->vis_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3216 old_vh = pr->vis_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3217 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3218 if (pr->width < pr->window_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3219 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3220 pr->vis_width = pr->width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3221 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
|
3222 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3223 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3224 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3225 pr->vis_width = pr->window_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3226 pr->x_offset = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3227 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3228 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3229 if (pr->height < pr->window_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3230 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3231 pr->vis_height = pr->height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3232 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
|
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->vis_height = pr->window_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3237 pr->y_offset = 0; |
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 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3240 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3241 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3242 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
|
3243 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3244 |
27
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
3245 static gint pr_zoom_clamp(PixbufRenderer *pr, gdouble zoom, |
859 | 3246 PrZoomFlags flags, gboolean *redrawn) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3247 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3248 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3249 gdouble scale; |
859 | 3250 gboolean invalid; |
3251 gboolean force = !!(flags & PR_ZOOM_FORCE); | |
3252 gboolean new = !!(flags & PR_ZOOM_NEW); | |
3253 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
|
3254 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
|
3255 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3256 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
|
3257 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3258 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
|
3259 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3260 w = pr->image_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3261 h = pr->image_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3262 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3263 if (zoom == 0.0 && !pr->pixbuf) |
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 scale = 1.0; |
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 else if (zoom == 0.0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3268 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3269 gint max_w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3270 gint max_h; |
859 | 3271 gboolean sizeable; |
23
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 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
|
3274 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3275 if (sizeable) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3276 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3277 max_w = gdk_screen_width(); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3278 max_h = gdk_screen_height(); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3279 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3280 if (pr->window_limit) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3281 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3282 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
|
3283 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
|
3284 } |
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 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3287 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3288 max_w = pr->window_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3289 max_h = pr->window_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3290 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3291 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3292 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
|
3293 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3294 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
|
3295 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3296 scale = (gdouble)max_h / h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3297 h = max_h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3298 w = w * scale + 0.5; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3299 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
|
3300 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3301 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3302 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3303 scale = (gdouble)max_w / w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3304 w = max_w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3305 h = h * scale + 0.5; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3306 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
|
3307 } |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3308 |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3309 if (pr->autofit_limit) |
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3310 { |
336
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3311 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
|
3312 w = w * factor + 0.5; |
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3313 h = h * factor + 0.5; |
9122c5da1223
Fix display bug when using "Limit image size when autofitting" option.
zas_
parents:
283
diff
changeset
|
3314 scale = scale * factor; |
209
ad78ad18523a
configurable frame around image - geeqie_autofit_maxsize.patch by Laurent MONIN
nadvornik
parents:
208
diff
changeset
|
3315 } |
442 | 3316 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3317 if (w < 1) w = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3318 if (h < 1) h = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3319 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3320 else |
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 scale = 1.0; |
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 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3325 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
|
3326 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3327 scale = zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3328 w = w * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3329 h = h * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3330 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3331 else /* zoom out */ |
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 scale = 1.0 / (0.0 - zoom); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3334 w = w * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3335 h = h * scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3336 } |
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 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
|
3339 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3340 pr->zoom = zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3341 pr->width = w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3342 pr->height = h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3343 pr->scale = scale; |
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 if (invalidate || invalid) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3346 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3347 pr_tile_invalidate_all(pr); |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3348 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
|
3349 } |
27
9c24765c2d3a
Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents:
26
diff
changeset
|
3350 if (redrawn) *redrawn = (invalidate || invalid); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3351 |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3352 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3353 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3354 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3355 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3356 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3357 static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom, |
859 | 3358 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
|
3359 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3360 gdouble old_scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3361 gint old_cx, old_cy; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3362 gint clamped; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3363 gint sized; |
859 | 3364 gboolean redrawn = FALSE; |
3365 gboolean center_point = !!(flags & PR_ZOOM_CENTER); | |
3366 gboolean force = !!(flags & PR_ZOOM_FORCE); | |
3367 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
|
3368 gboolean lazy = !!(flags & PR_ZOOM_LAZY); |
859 | 3369 PrZoomFlags clamp_flags = flags; |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3370 gdouble old_center_x = pr->norm_center_x; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3371 gdouble old_center_y = pr->norm_center_y; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3372 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3373 old_scale = pr->scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3374 if (center_point) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3375 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3376 px = CLAMP(px, 0, pr->width); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3377 py = CLAMP(py, 0, pr->height); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3378 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
|
3379 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
|
3380 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3381 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3382 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3383 px = py = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3384 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
|
3385 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
|
3386 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3387 |
859 | 3388 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
|
3389 if (lazy) clamp_flags |= PR_ZOOM_LAZY; |
859 | 3390 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
|
3391 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3392 clamped = pr_size_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3393 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
|
3394 |
99
d19b0de6d0bb
Sat Nov 4 17:14:47 2006 John Ellis <johne@verizon.net>
gqview
parents:
95
diff
changeset
|
3395 if (force && new) |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3396 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3397 switch (pr->scroll_reset) |
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 case PR_SCROLL_RESET_NOCHANGE: |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3400 /* maintain old scroll position */ |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3401 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
|
3402 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
|
3403 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3404 case PR_SCROLL_RESET_CENTER: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3405 /* center new image */ |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3406 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
|
3407 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
|
3408 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3409 case PR_SCROLL_RESET_TOPLEFT: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3410 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3411 /* reset to upper left */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3412 pr->x_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3413 pr->y_scroll = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3414 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3415 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3416 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3417 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3418 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3419 /* 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
|
3420 if (center_point) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3421 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3422 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
|
3423 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
|
3424 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3425 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3426 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3427 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
|
3428 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
|
3429 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3430 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3431 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3432 pr_scroll_clamp(pr); |
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 /* 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
|
3435 * 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
|
3436 * so redraw the window anyway :/ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3437 */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3438 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
|
3439 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3440 if (lazy) |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3441 { |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3442 pr_queue_clear(pr); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3443 } |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3444 else |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3445 { |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3446 pr_redraw(pr, redrawn); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3447 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3448 |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3449 pr_scroll_notify_signal(pr); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3450 pr_zoom_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3451 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3452 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3453 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3454 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
|
3455 { |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3456 gint zoom_changed = FALSE; |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3457 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3458 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
|
3459 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3460 pr->window_width = new_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3461 pr->window_height = new_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3462 |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3463 if (pr->zoom == 0.0) |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3464 { |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3465 gdouble old_scale = pr->scale; |
859 | 3466 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
|
3467 zoom_changed = (old_scale != pr->scale); |
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3468 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3469 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3470 pr_size_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3471 pr_scroll_clamp(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3472 |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3473 pr_overlay_update_sizes(pr); |
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3474 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3475 /* ensure scroller remains visible */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3476 if (pr->scroller_overlay != -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3477 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3478 gint update = FALSE; |
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 (pr->scroller_x > new_width) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3481 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3482 pr->scroller_x = new_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3483 pr->scroller_xpos = new_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3484 update = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3485 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3486 if (pr->scroller_y > new_height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3487 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3488 pr->scroller_y = new_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3489 pr->scroller_ypos = new_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3490 update = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3491 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3492 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3493 if (update) |
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 GdkPixbuf *pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3496 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3497 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
|
3498 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3499 gint w, h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3500 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3501 w = gdk_pixbuf_get_width(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3502 h = gdk_pixbuf_get_height(pixbuf); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3503 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
|
3504 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
|
3505 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3506 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3507 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3508 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3509 pr_border_clear(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3510 |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3511 pr_scroll_notify_signal(pr); |
61
0c912a2d94f1
Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents:
42
diff
changeset
|
3512 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
|
3513 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3514 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3515 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3516 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
|
3517 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3518 PixbufRenderer *pr = data; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3519 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3520 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
|
3521 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3522 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3523 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
|
3524 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3525 gint x, y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3526 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3527 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
|
3528 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3529 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
|
3530 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
|
3531 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3532 pr_queue(pr, x, y, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3533 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
|
3534 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
|
3535 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
|
3536 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3537 |
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 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3540 * scrolling |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3541 *------------------------------------------------------------------- |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3544 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
|
3545 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3546 gint old_x, old_y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3547 gint x_off, y_off; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3548 gint w, h; |
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 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
|
3551 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3552 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
|
3553 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3554 old_x = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3555 old_y = pr->y_scroll; |
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 pr->x_scroll += x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3558 pr->y_scroll += y; |
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 pr_scroll_clamp(pr); |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3561 |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3562 pixbuf_renderer_sync_scroll_center(pr); |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3563 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3564 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
|
3565 |
29
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3566 pr_scroll_notify_signal(pr); |
8a8ec4b3e769
Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents:
27
diff
changeset
|
3567 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3568 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
|
3569 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
|
3570 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3571 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
|
3572 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
|
3573 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3574 if (w < 1 || h < 1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3575 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3576 /* scrolled completely to new material */ |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
3577 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
|
3578 return; |
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 else |
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 gint x1, y1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3583 gint x2, y2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3584 GtkWidget *box; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3585 GdkGC *gc; |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3586 GdkEvent *event; |
23
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 if (x_off < 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3589 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3590 x1 = abs(x_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3591 x2 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3592 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3593 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3594 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3595 x1 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3596 x2 = abs(x_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3597 } |
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 if (y_off < 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3600 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3601 y1 = abs(y_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3602 y2 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3603 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3604 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3605 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3606 y1 = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3607 y2 = abs(y_off); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3608 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3609 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3610 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3611 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3612 gc = gdk_gc_new(box->window); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3613 gdk_gc_set_exposures(gc, TRUE); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3614 gdk_draw_drawable(box->window, gc, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3615 box->window, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3616 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
|
3617 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
|
3618 g_object_unref(gc); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3619 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3620 if (pr->overlay_list) |
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 pr_overlay_queue_all(pr); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3625 w = pr->vis_width - w; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3626 h = pr->vis_height - h; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3627 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3628 if (w > 0) |
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 pr_queue(pr, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3631 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
|
3632 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
|
3633 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3634 if (h > 0) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3635 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3636 /* FIXME, to optimize this, remove overlap */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3637 pr_queue(pr, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3638 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
|
3639 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
|
3640 } |
87
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3641 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3642 /* process exposures here, "expose_event" seems to miss a few with obstructed windows */ |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3643 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
|
3644 { |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3645 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
|
3646 |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3647 if (event->expose.count == 0) |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3648 { |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3649 gdk_event_free(event); |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3650 break; |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3651 } |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3652 gdk_event_free(event); |
a2b0a7b0b490
Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net>
gqview
parents:
77
diff
changeset
|
3653 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3654 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3655 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3656 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3657 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
|
3658 gdouble x_align, gdouble y_align) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3659 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3660 gint px, py; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3661 gint ax, ay; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3662 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3663 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
|
3664 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
|
3665 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3666 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
|
3667 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
|
3668 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3669 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
|
3670 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
|
3671 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3672 pixbuf_renderer_scroll(pr, px, py); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3673 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3674 |
131 | 3675 /* get or set coordinates of viewport center in the image, in range 0.0 - 1.0 */ |
3676 | |
3677 void pixbuf_renderer_get_scroll_center(PixbufRenderer *pr, gdouble *x, gdouble *y) | |
3678 { | |
1037
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3679 *x = pr->norm_center_x; |
86148ec8a299
fixed various problems with preserving viewport on image change,
nadvornik
parents:
1035
diff
changeset
|
3680 *y = pr->norm_center_y; |
131 | 3681 } |
3682 | |
3683 void pixbuf_renderer_set_scroll_center(PixbufRenderer *pr, gdouble x, gdouble y) | |
3684 { | |
3685 gdouble dst_x, dst_y; | |
3686 | |
3687 dst_x = x * pr->width - pr->vis_width / 2 - pr->x_scroll + CLAMP(pr->subpixel_x_scroll, -1.0, 1.0); | |
3688 dst_y = y * pr->height - pr->vis_height / 2 - pr->y_scroll + CLAMP(pr->subpixel_y_scroll, -1.0, 1.0); | |
3689 | |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3690 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
|
3691 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
|
3692 |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
3693 pixbuf_renderer_scroll(pr, (gint)dst_x, (gint)dst_y); |
131 | 3694 } |
3695 | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3696 /* |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3697 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3698 * mouse |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3702 static gint pr_mouse_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
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 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3705 gint accel; |
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 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3708 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3709 if (pr->scroller_id != -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3710 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3711 pr->scroller_xpos = bevent->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3712 pr->scroller_ypos = bevent->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3713 } |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3714 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3715 pr->x_mouse = bevent->x; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3716 pr->y_mouse = bevent->y; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3717 pr_update_pixel_signal(pr); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
3718 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3719 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
|
3720 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3721 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
|
3722 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3723 pr->drag_moved++; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3724 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3725 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3726 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3727 widget_set_cursor(widget, GDK_FLEUR); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3728 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3729 |
1047 | 3730 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
|
3731 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3732 accel = PR_PAN_SHIFT_MULTIPLIER; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3733 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3734 else |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3735 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3736 accel = 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3737 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3738 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3739 /* do the scroll */ |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3740 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
|
3741 (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
|
3742 |
128
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3743 pr_drag_signal(pr, bevent); |
98e2632b5d3d
improved connected scroll and active image switching
nadvornik
parents:
104
diff
changeset
|
3744 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3745 pr->drag_last_x = bevent->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3746 pr->drag_last_y = bevent->y; |
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 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3749 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3750 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3751 static gint pr_mouse_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3752 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3753 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3754 GtkWidget *parent; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3755 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3756 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3757 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3758 if (pr->scroller_id != -1) return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3759 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3760 switch (bevent->button) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3761 { |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3762 case MOUSE_BUTTON_LEFT: |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3763 pr->in_drag = TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3764 pr->drag_last_x = bevent->x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3765 pr->drag_last_y = bevent->y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3766 pr->drag_moved = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3767 gdk_pointer_grab(widget->window, FALSE, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3768 GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3769 NULL, NULL, bevent->time); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3770 gtk_grab_add(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3771 break; |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3772 case MOUSE_BUTTON_MIDDLE: |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3773 pr->drag_moved = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3774 break; |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3775 case MOUSE_BUTTON_RIGHT: |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3776 pr_clicked_signal(pr, bevent); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3777 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3778 default: |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3779 break; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3780 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3781 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3782 parent = gtk_widget_get_parent(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3783 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
|
3784 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3785 gtk_widget_grab_focus(parent); |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3788 return FALSE; |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3791 static gint pr_mouse_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3792 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3793 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3794 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3795 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3796 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3797 if (pr->scroller_id != -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3798 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3799 pr_scroller_stop(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3800 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3801 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3802 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3803 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
|
3804 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3805 gtk_grab_remove(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3806 gdk_pointer_ungrab(bevent->time); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3807 widget_set_cursor(widget, -1); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3808 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3809 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3810 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
|
3811 { |
1047 | 3812 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
|
3813 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3814 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
|
3815 } |
448
a73cc0fa14d0
Use explicit names for mouse buttons instead of numbers.
zas_
parents:
446
diff
changeset
|
3816 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
|
3817 { |
25
0c3b353b666e
Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents:
24
diff
changeset
|
3818 pr_clicked_signal(pr, bevent); |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3819 } |
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 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3822 pr->in_drag = FALSE; |
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 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3825 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3826 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3827 static gint pr_mouse_leave_cb(GtkWidget *widget, GdkEventCrossing *event, gpointer data) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3828 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3829 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3830 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3831 pr = PIXBUF_RENDERER(widget); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3832 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3833 if (pr->scroller_id != -1) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3834 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3835 pr->scroller_xpos = pr->scroller_x; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3836 pr->scroller_ypos = pr->scroller_y; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3837 pr->scroller_xinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3838 pr->scroller_yinc = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3839 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3840 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3841 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3842 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3843 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3844 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
|
3845 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3846 PixbufRenderer *pr; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3847 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3848 pr = PIXBUF_RENDERER(widget); |
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 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
|
3851 } |
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 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
|
3854 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3855 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
|
3856 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
|
3857 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
|
3858 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
|
3859 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
|
3860 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
|
3861 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
|
3862 G_CALLBACK(pr_mouse_leave_cb), pr); |
1373 | 3863 g_signal_connect(G_OBJECT(pr), "unmap", |
3864 G_CALLBACK(pr_unmap_cb), pr); | |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3865 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3866 gtk_widget_set_events(GTK_WIDGET(pr), GDK_POINTER_MOTION_MASK | |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3867 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
|
3868 GDK_LEAVE_NOTIFY_MASK); |
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 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
|
3871 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
|
3872 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3873 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3874 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3875 /* |
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 * public |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3878 *------------------------------------------------------------------- |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3879 */ |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3880 static void pr_pixbuf_size_sync(PixbufRenderer *pr) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3881 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3882 if (!pr->pixbuf) return; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3883 switch (pr->orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3884 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3885 case EXIF_ORIENTATION_LEFT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3886 case EXIF_ORIENTATION_RIGHT_TOP: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3887 case EXIF_ORIENTATION_RIGHT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3888 case EXIF_ORIENTATION_LEFT_BOTTOM: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3889 pr->image_width = gdk_pixbuf_get_height(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3890 pr->image_height = gdk_pixbuf_get_width(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3891 break; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3892 default: |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3893 pr->image_width = gdk_pixbuf_get_width(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3894 pr->image_height = gdk_pixbuf_get_height(pr->pixbuf); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3895 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3896 } |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3897 |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3898 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
|
3899 { |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3900 if (pixbuf) g_object_ref(pixbuf); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3901 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
|
3902 pr->pixbuf = pixbuf; |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3903 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3904 if (!pr->pixbuf) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3905 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3906 GtkWidget *box; |
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 /* 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
|
3909 pr->image_width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3910 pr->image_height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3911 pr->scale = 1.0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3912 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3913 box = GTK_WIDGET(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3914 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3915 if (GTK_WIDGET_REALIZED(box)) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3916 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3917 gdk_window_clear(box->window); |
104
8d358a53146e
Wed Nov 8 16:59:14 2006 John Ellis <johne@verizon.net>
gqview
parents:
99
diff
changeset
|
3918 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
|
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 pr_update_signal(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 return; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3924 } |
442 | 3925 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3926 pr_pixbuf_size_sync(pr); |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3927 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
|
3928 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3929 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3930 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
|
3931 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3932 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
|
3933 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3934 pr_source_tile_unset(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3935 |
1045
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3936 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
|
3937 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3938 pr_update_signal(pr); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3939 } |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3940 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3941 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
|
3942 { |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3943 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
|
3944 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3945 pr_source_tile_unset(pr); |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3946 |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3947 pr->orientation = orientation; |
0ab0deb0cfcc
added possibility to redraw only the parts of image that are already
nadvornik
parents:
1043
diff
changeset
|
3948 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
|
3949 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3950 pr_update_signal(pr); |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3951 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3952 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3953 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
|
3954 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3955 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
|
3956 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3957 return pr->pixbuf; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3958 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
3959 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3960 void pixbuf_renderer_set_orientation(PixbufRenderer *pr, gint orientation) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3961 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3962 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3963 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3964 pr->orientation = orientation; |
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 pr_pixbuf_size_sync(pr); |
859 | 3967 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
|
3968 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3969 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3970 gint pixbuf_renderer_get_orientation(PixbufRenderer *pr) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3971 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3972 if (!pr) return 1; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3973 return pr->orientation; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3974 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3975 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3976 void pixbuf_renderer_set_post_process_func(PixbufRenderer *pr, PixbufRendererPostProcessFunc func, gpointer user_data, gint slow) |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3977 { |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3978 g_return_if_fail(IS_PIXBUF_RENDERER(pr)); |
442 | 3979 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3980 pr->func_post_process = func; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3981 pr->post_process_user_data = user_data; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3982 pr->post_process_slow = func && slow; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3983 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3984 } |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3985 |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
3986 |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3987 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
|
3988 { |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3989 GObject *object; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3990 PixbufRendererScrollResetType scroll_reset; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3991 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3992 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
|
3993 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
|
3994 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3995 if (pr == source) return; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3996 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3997 object = G_OBJECT(pr); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3998 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
3999 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
|
4000 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
|
4001 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
|
4002 |
42
606fcf461a68
Sat May 14 13:04:23 2005 John Ellis <johne@verizon.net>
gqview
parents:
38
diff
changeset
|
4003 pr->complete = source->complete; |
606fcf461a68
Sat May 14 13:04:23 2005 John Ellis <johne@verizon.net>
gqview
parents:
38
diff
changeset
|
4004 |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4005 pr->x_scroll = source->x_scroll; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4006 pr->y_scroll = source->y_scroll; |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4007 pr->x_mouse = source->x_mouse; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4008 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
|
4009 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4010 scroll_reset = pr->scroll_reset; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4011 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
|
4012 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4013 pr->func_post_process = source->func_post_process; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4014 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
|
4015 pr->post_process_slow = source->post_process_slow; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4016 pr->orientation = source->orientation; |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4017 |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4018 if (source->source_tiles_enabled) |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4019 { |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4020 pr_source_tile_unset(pr); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4021 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4022 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
|
4023 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
|
4024 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
|
4025 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
|
4026 pr->image_width = source->image_width; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4027 pr->image_height = source->image_height; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4028 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4029 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
|
4030 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
|
4031 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
|
4032 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4033 pr->source_tiles = source->source_tiles; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4034 source->source_tiles = NULL; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4035 |
859 | 4036 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
|
4037 pr_redraw(pr, TRUE); |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4038 } |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4039 else |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4040 { |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4041 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
|
4042 } |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4043 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4044 pr->scroll_reset = scroll_reset; |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4045 |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4046 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
|
4047 pr_queue_clear(source); |
36
9b01fe7e84d5
Tue Apr 12 07:59:20 2005 John Ellis <johne@verizon.net>
gqview
parents:
34
diff
changeset
|
4048 pr_tile_free_all(source); |
24
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4049 } |
104e34f9ab1f
Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents:
23
diff
changeset
|
4050 |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4051 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
|
4052 { |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4053 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
|
4054 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4055 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
|
4056 |
442 | 4057 pr_coords_map_orientation_reverse(pr, |
398
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4058 src_x, src_y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4059 pr->image_width, pr->image_height, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4060 src_w, src_h, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4061 &x, &y, |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4062 &width, &height); |
c4080362d619
image post-processing (rotation and color management) moved to
nadvornik
parents:
386
diff
changeset
|
4063 |
23
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4064 if (pr->source_tiles_enabled) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4065 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4066 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
|
4067 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4068 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4069 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
|
4070 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4071 /* 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
|
4072 y -= 1; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4073 height += 2; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4074 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4075 |
1000
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4076 x1 = (gint)floor((gdouble)x * pr->scale); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4077 y1 = (gint)floor((gdouble)y * pr->scale); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4078 x2 = (gint)ceil((gdouble)(x + width) * pr->scale); |
4fe8f9656107
For the sake of consistency, use glib basic types everywhere.
zas_
parents:
872
diff
changeset
|
4079 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
|
4080 |
31
c42544f31030
Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents:
29
diff
changeset
|
4081 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
|
4082 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4083 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4084 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
|
4085 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4086 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
|
4087 |
859 | 4088 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
|
4089 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4090 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4091 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
|
4092 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4093 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
|
4094 |
859 | 4095 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
|
4096 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4097 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4098 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
|
4099 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4100 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
|
4101 |
859 | 4102 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
|
4103 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4104 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4105 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
|
4106 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4107 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
|
4108 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4109 return pr->zoom; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4110 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4111 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4112 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
|
4113 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4114 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
|
4115 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4116 return pr->scale; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4117 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4118 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4119 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
|
4120 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4121 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
|
4122 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4123 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
|
4124 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
|
4125 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
|
4126 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4127 if (pr->zoom_min != min) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4128 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4129 pr->zoom_min = min; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4130 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
|
4131 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4132 if (pr->zoom_max != max) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4133 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4134 pr->zoom_max = max; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4135 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
|
4136 } |
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 |
1375
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4139 gint pixbuf_renderer_get_pixel_colors(PixbufRenderer *pr, gint x_pixel, gint y_pixel, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4140 gint *r_mouse, gint *g_mouse, gint *b_mouse) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4141 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4142 GdkPixbuf *pb = pr->pixbuf; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4143 gint p_alpha, prs; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4144 guchar *p_pix, *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4145 gint map_x, map_y, map_w, map_h; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4146 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4147 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
|
4148 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
|
4149 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4150 if (!pr->pixbuf && !pr->source_tiles_enabled) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4151 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4152 *r_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4153 *g_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4154 *b_mouse = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4155 return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4156 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4157 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4158 if (!pb) return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4159 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4160 pr_tile_region_map_orientation(pr, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4161 x_pixel, y_pixel, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4162 pr->image_width, pr->image_height, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4163 1, 1, /*single pixel */ |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4164 &map_x, &map_y, |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4165 &map_w, &map_h); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4166 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4167 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
|
4168 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
|
4169 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4170 p_alpha = gdk_pixbuf_get_has_alpha(pb); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4171 prs = gdk_pixbuf_get_rowstride(pb); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4172 p_pix = gdk_pixbuf_get_pixels(pb); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4173 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4174 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
|
4175 *r_mouse = *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4176 pp++; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4177 *g_mouse = *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4178 pp++; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4179 *b_mouse = *pp; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4180 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4181 return TRUE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4182 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4183 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4184 gint pixbuf_renderer_get_mouse_position(PixbufRenderer *pr, gint *x_pixel_return, gint *y_pixel_return) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4185 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4186 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
|
4187 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4188 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
|
4189 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
|
4190 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4191 if (!pr->pixbuf && !pr->source_tiles_enabled) |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4192 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4193 *x_pixel_return = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4194 *y_pixel_return = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4195 return FALSE; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4196 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4197 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4198 x_pixel = (gint)((gdouble)(pr->x_mouse - pr->x_offset + pr->x_scroll) / pr->scale); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4199 y_pixel = (gint)((gdouble)(pr->y_mouse - pr->y_offset + pr->y_scroll) / pr->scale); |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4200 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
|
4201 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
|
4202 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4203 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
|
4204 { |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4205 /* mouse is not on pr */ |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4206 x_pixel = y_pixel = -1; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4207 } |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4208 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4209 *x_pixel_return = x_pixel; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4210 *y_pixel_return = y_pixel; |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4211 |
df58e511d90e
Display pixel coordinates and rgb - patch by Ruben Stein
nadvornik
parents:
1373
diff
changeset
|
4212 return TRUE; |
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 |
1431 | 4215 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
|
4216 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4217 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
|
4218 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
|
4219 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4220 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
|
4221 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4222 *width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4223 *height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4224 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4225 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4226 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4227 *width = pr->image_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4228 *height = pr->image_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4229 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4230 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4231 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4232 gint pixbuf_renderer_get_scaled_size(PixbufRenderer *pr, gint *width, gint *height) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4233 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4234 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
|
4235 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
|
4236 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4237 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
|
4238 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4239 *width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4240 *height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4241 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4242 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4243 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4244 *width = pr->width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4245 *height = pr->height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4246 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4247 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4248 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4249 gint pixbuf_renderer_get_visible_rect(PixbufRenderer *pr, GdkRectangle *rect) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4250 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4251 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
|
4252 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
|
4253 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4254 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
|
4255 !pr->scale) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4256 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4257 rect->x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4258 rect->y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4259 rect->width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4260 rect->height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4261 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4262 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4263 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4264 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
|
4265 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
|
4266 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
|
4267 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
|
4268 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4269 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4270 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4271 gint pixbuf_renderer_get_virtual_rect(PixbufRenderer *pr, GdkRectangle *rect) |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4272 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4273 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
|
4274 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
|
4275 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4276 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
|
4277 { |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4278 rect->x = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4279 rect->y = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4280 rect->width = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4281 rect->height = 0; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4282 return FALSE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4283 } |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4284 |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4285 rect->x = pr->x_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4286 rect->y = pr->y_scroll; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4287 rect->width = pr->vis_width; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4288 rect->height = pr->vis_height; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4289 return TRUE; |
17acca639a86
##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff
changeset
|
4290 } |
1055
1646720364cf
Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents:
1047
diff
changeset
|
4291 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ |