annotate src/pixbuf-renderer.c @ 67:f63ecca6c087

Fri Oct 13 05:22:43 2006 John Ellis <johne@verizon.net> * bar_sort.c, pan-view.c, preferences.c: Mark strings for translation, plus punctuation fix. * utilops.c: Change auto rename start number to default to 1. * configure.in (ALL_LINGUAS): Add be, ca, ko translations. * gqview.spec.in: Add Italian translation to RPM spec file, submitted by HappyCactus <happycactus@people.it>. * be.po: Add Belarusion translation, submitted by Pavel Piatruk <berserker@neolocation.com>. * ca.po: Add Catalan translation [merge from 2.0.2], submitted by catux.org <mecatxis@ya.com>. * de.po: Update German translation [merge from 2.0.2], submitted by Ronny Steiner <Post@SIRSteiner.de>. * fr.po: Update French translation, submitted by ?ric Lassauge <lassauge@users.sourceforge.net>. * it.po: Update Italian translation, submitted by Kostantino <ciclope10ATalice.it>. * ko.po: Add Korean translation (mostly menus), submitted by Hyun-Jin Moon <moonhyunjin@gmail.com>. * pt_BR.po: Update Brazilian Portuguese translation, submitted by Herval Ribeiro de Azev??do <heraze@gmail.com>. * sk.po: Update Slovak translation, submitted by Mgr. Peter Tuharsky <tuharsky@misbb.sk>. * zh_TW.po: Update Traditional Chinese translation, submitted by S.J. Luo <crystal@mickey.ee.nctu.edu.tw>
author gqview
date Fri, 13 Oct 2006 10:14:59 +0000
parents 0c912a2d94f1
children 44f2223541d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2 * GQview
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3 * (C) 2005 John Ellis
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
4 *
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
5 * Author: John Ellis
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
6 *
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
7 * 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
8 * 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
9 * 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
10 */
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 #include <stdio.h>
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
13 #include <stdlib.h>
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
14 #include <math.h>
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
15 #include "pixbuf-renderer.h"
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
16 #include "intl.h"
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
17
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
18 #include <gtk/gtk.h>
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
19
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
20
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
21 /* comment this out if not using this from within GQview
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
22 * defining GQVIEW_BUILD does these things:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
23 * - 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
24 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
25 #define GQVIEW_BUILD 1
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
26
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
27
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
28 #ifdef GQVIEW_BUILD
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
29 #include "pixbuf_util.h"
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
30 #endif
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
31
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
32
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
33 /* 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
34 #define PR_TILE_SIZE 128
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
35
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
36 /* default size of tile cache (mb) */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
37 #define PR_CACHE_SIZE_DEFAULT 8
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
38
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
39 /* default min and max zoom */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
40 #define PR_ZOOM_MIN -32.0
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
41 #define PR_ZOOM_MAX 32.0
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
42
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
43 /* 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
44 #define PR_DRAG_SCROLL_THRESHHOLD 4
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
45
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
46 /* 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
47 #define PR_PAN_SHIFT_MULTIPLIER 6
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
48
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
49 /* scroller config */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
50 #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
51 #define PR_SCROLLER_DEAD_ZONE 6
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
52
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
53 /* 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
54 #define PR_ALPHA_CHECK1 0x00999999
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
55 #define PR_ALPHA_CHECK2 0x00666666
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
56 #define PR_ALPHA_CHECK_SIZE 16
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 /* 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
59 * (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
60 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
61 #define PR_MIN_SCALE_SIZE 8
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
62
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
63
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
64 typedef enum {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
65 TILE_RENDER_NONE = 0, /* do nothing */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
66 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
67 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
68 } ImageTileRenderType;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
69
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
70 typedef struct _ImageTile ImageTile;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
71 typedef struct _QueueData QueueData;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
72
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
73 struct _ImageTile
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
74 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
75 GdkPixmap *pixmap; /* off screen buffer */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
76 GdkPixbuf *pixbuf; /* pixbuf area for zooming */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
77 gint x; /* x offset into image */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
78 gint y; /* y offset into image */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
79 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
80 gint h; /* height '' */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
81
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
82 gboolean blank;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
83
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
84 /* render_todo: (explanation)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
85 NONE do nothing
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
86 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
87 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
88 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
89 */
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 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
92 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
93
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
94 QueueData *qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
95 QueueData *qd2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
96
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
97 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
98 };
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 struct _QueueData
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 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
103 gint x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
104 gint y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
105 gint w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
106 gint h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
107 gboolean new_data;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
110 typedef struct _SourceTile SourceTile;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
111 struct _SourceTile
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
112 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
113 gint x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
114 gint y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
115 GdkPixbuf *pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
116 gboolean blank;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
119 typedef struct _OverlayData OverlayData;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
120 struct _OverlayData
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
121 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
122 gint id;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
123
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
124 GdkPixbuf *pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
125
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
126 gint x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
127 gint y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
128 gint relative; /* x,y coordinates are relative, negative values start bottom right */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
129
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
130 gint visible;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
131 gint always; /* hide temporarily when scrolling */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
132 };
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
133
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
134 enum {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
135 SIGNAL_ZOOM = 0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
136 SIGNAL_CLICKED,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
137 SIGNAL_SCROLL_NOTIFY,
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
138 SIGNAL_RENDER_COMPLETE,
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
139 SIGNAL_COUNT
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
140 };
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
141
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
142 enum {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
143 PROP_0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
144 PROP_ZOOM_MIN,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
145 PROP_ZOOM_MAX,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
146 PROP_ZOOM_QUALITY,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
147 PROP_ZOOM_2PASS,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
148 PROP_ZOOM_EXPAND,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
149 PROP_DITHER_QUALITY,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
150 PROP_SCROLL_RESET,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
151 PROP_DELAY_FLIP,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
152 PROP_LOADING,
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
153 PROP_COMPLETE,
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
154 PROP_CACHE_SIZE_DISPLAY,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
155 PROP_CACHE_SIZE_TILES,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
156 PROP_WINDOW_FIT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
157 PROP_WINDOW_LIMIT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
158 PROP_WINDOW_LIMIT_VALUE
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
162
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
163 static guint signals[SIGNAL_COUNT] = { 0 };
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
164 static GtkEventBoxClass *parent_class = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
165
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
166
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
167
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
168 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
169 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
170 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
171 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
172 const GValue *value, GParamSpec *pspec);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
173 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
174 GValue *value, GParamSpec *pspec);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
175 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
176
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
177 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
178
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
179 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
180 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
181 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
182
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
183
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
184 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
185 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
186 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
187 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
188 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
189 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
190 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
191 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
192
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
193 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
194
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
195 static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
196 gint force, gint blank, gint new,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
197 gint center_point, gint px, gint py);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
198
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
199 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
200 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
201 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
202
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
203
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
204 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
205 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
206 * Pixbuf Renderer object
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
207 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
208 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
209
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
210 GType pixbuf_renderer_get_type(void)
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 GType pixbuf_renderer_type = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
213
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
214 if (!pixbuf_renderer_type)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
215 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
216 static const GTypeInfo pixbuf_renderer_info =
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
217 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
218 sizeof(PixbufRendererClass),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
219 NULL, /* base_init */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
220 NULL, /* base_finalize */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
221 (GClassInitFunc)pixbuf_renderer_class_init,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
222 NULL, /* class_finalize */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
223 NULL, /* class_data */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
224 sizeof(PixbufRenderer),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
225 0, /* n_preallocs */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
226 (GInstanceInitFunc)pixbuf_renderer_init,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
227 };
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
228
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
229 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
230 &pixbuf_renderer_info, 0);
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 return pixbuf_renderer_type;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
236 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
237 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
238 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
239 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
240
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
241 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
242
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
243 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
244 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
245
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
246 gobject_class->finalize = pixbuf_renderer_finalize;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
247
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
248 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
249
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
250 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
251 PROP_ZOOM_MIN,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
252 g_param_spec_double("zoom_min",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
253 "Zoom minimum",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
254 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
255 -1000.0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
256 1000.0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
257 PR_ZOOM_MIN,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
258 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
259
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
260 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
261 PROP_ZOOM_MAX,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
262 g_param_spec_double("zoom_max",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
263 "Zoom maximum",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
264 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
265 -1000.0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
266 1000.0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
267 PR_ZOOM_MIN,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
268 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
269
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
270 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
271 PROP_ZOOM_QUALITY,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
272 g_param_spec_uint("zoom_quality",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
273 "Zoom quality",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
274 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
275 GDK_INTERP_NEAREST,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
276 GDK_INTERP_HYPER,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
277 GDK_INTERP_BILINEAR,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
278 G_PARAM_READABLE | G_PARAM_WRITABLE));
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_2PASS,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
282 g_param_spec_boolean("zoom_2pass",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
283 "2 pass zoom",
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 TRUE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
286 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
287
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
288 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
289 PROP_ZOOM_EXPAND,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
290 g_param_spec_boolean("zoom_expand",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
291 "Expand image in autozoom.",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
292 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
293 FALSE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
294 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
295
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
296 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
297 PROP_DITHER_QUALITY,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
298 g_param_spec_uint("dither_quality",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
299 "Dither quality",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
300 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
301 GDK_RGB_DITHER_NONE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
302 GDK_RGB_DITHER_MAX,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
303 GDK_RGB_DITHER_NORMAL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
304 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
305
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
306 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
307 PROP_SCROLL_RESET,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
308 g_param_spec_uint("scroll_reset",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
309 "New image scroll reset",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
310 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
311 PR_SCROLL_RESET_TOPLEFT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
312 PR_SCROLL_RESET_NOCHANGE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
313 PR_SCROLL_RESET_TOPLEFT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
314 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
315
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
316 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
317 PROP_DELAY_FLIP,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
318 g_param_spec_boolean("delay_flip",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
319 "Delay image update",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
320 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
321 FALSE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
322 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
323
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
324 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
325 PROP_LOADING,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
326 g_param_spec_boolean("loading",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
327 "Image actively loading",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
328 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
329 FALSE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
330 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
331
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
332 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
333 PROP_COMPLETE,
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
334 g_param_spec_boolean("complete",
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
335 "Image rendering complete",
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
336 NULL,
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
337 FALSE,
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
338 G_PARAM_READABLE | G_PARAM_WRITABLE));
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
339
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
340 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
341 PROP_CACHE_SIZE_DISPLAY,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
342 g_param_spec_uint("cache_display",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
343 "Display cache size MB",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
344 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
345 0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
346 128,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
347 PR_CACHE_SIZE_DEFAULT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
348 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
349
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
350 g_object_class_install_property(gobject_class,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
351 PROP_CACHE_SIZE_TILES,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
352 g_param_spec_uint("cache_tiles",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
353 "Tile cache count",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
354 "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
355 0,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
356 256,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
357 PR_CACHE_SIZE_DEFAULT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
358 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
359
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
360 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
361 PROP_WINDOW_FIT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
362 g_param_spec_boolean("window_fit",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
363 "Fit window to image size",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
364 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
365 FALSE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
366 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
367
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
368 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
369 PROP_WINDOW_LIMIT,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
370 g_param_spec_boolean("window_limit",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
371 "Limit size of parent window",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
372 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
373 FALSE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
374 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
375
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
376 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
377 PROP_WINDOW_LIMIT_VALUE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
378 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
379 "Size limit of parent window",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
380 NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
381 10,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
382 150,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
383 100,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
384 G_PARAM_READABLE | G_PARAM_WRITABLE));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
385
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
386 signals[SIGNAL_ZOOM] =
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
387 g_signal_new("zoom",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
388 G_OBJECT_CLASS_TYPE(gobject_class),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
389 G_SIGNAL_RUN_LAST,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
390 G_STRUCT_OFFSET(PixbufRendererClass, zoom),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
391 NULL, NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
392 g_cclosure_marshal_VOID__DOUBLE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
393 G_TYPE_NONE, 1,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
394 G_TYPE_DOUBLE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
395
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
396 signals[SIGNAL_CLICKED] =
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
397 g_signal_new("clicked",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
398 G_OBJECT_CLASS_TYPE(gobject_class),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
399 G_SIGNAL_RUN_LAST,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
400 G_STRUCT_OFFSET(PixbufRendererClass, clicked),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
401 NULL, NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
402 g_cclosure_marshal_VOID__BOXED,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
403 G_TYPE_NONE, 1,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
404 GDK_TYPE_EVENT);
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 signals[SIGNAL_SCROLL_NOTIFY] =
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
407 g_signal_new("scroll-notify",
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
408 G_OBJECT_CLASS_TYPE(gobject_class),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
409 G_SIGNAL_RUN_LAST,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
410 G_STRUCT_OFFSET(PixbufRendererClass, scroll_notify),
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
411 NULL, NULL,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
412 g_cclosure_marshal_VOID__VOID,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
413 G_TYPE_NONE, 0);
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
414
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
415 signals[SIGNAL_RENDER_COMPLETE] =
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
416 g_signal_new("render-complete",
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
417 G_OBJECT_CLASS_TYPE(gobject_class),
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
418 G_SIGNAL_RUN_LAST,
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
419 G_STRUCT_OFFSET(PixbufRendererClass, render_complete),
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
420 NULL, NULL,
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
421 g_cclosure_marshal_VOID__VOID,
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
422 G_TYPE_NONE, 0);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
423 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
424
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
425 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
426 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
427 GtkWidget *box;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
428
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
429 box = GTK_WIDGET(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
430
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
431 pr->zoom_min = PR_ZOOM_MIN;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
432 pr->zoom_max = PR_ZOOM_MAX;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
433 pr->zoom_quality = GDK_INTERP_BILINEAR;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
434 pr->zoom_2pass = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
435
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
436 pr->zoom = 1.0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
437 pr->scale = 1.0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
438
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
439 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
440
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
441 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
442
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
443 pr->draw_idle_id = -1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
444
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
445 pr->tile_width = PR_TILE_SIZE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
446 pr->tile_height = PR_TILE_SIZE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
447
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
448 pr->tiles = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
449 pr->tile_cache_size = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
450
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
451 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
452
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
453 pr->scroller_id = -1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
454 pr->scroller_overlay = -1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
455
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
456 pr->source_tiles_enabled = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
457 pr->source_tiles = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
458
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
459 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
460 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
461 G_CALLBACK(pr_size_cb), pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
462
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
463 pr_signals_connect(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
464 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
465
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
466 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
467 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
468 PixbufRenderer *pr;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
469
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
470 pr = PIXBUF_RENDERER(object);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
471
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
472 pr_queue_clear(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
473 pr_tile_free_all(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
474
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
475 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
476
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
477 pr_scroller_timer_set(pr, FALSE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
478 pr_overlay_list_clear(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
479
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
480 pr_source_tile_free_all(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
481 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
482
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
483 PixbufRenderer* pixbuf_renderer_new(void)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
484 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
485 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
486 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
487
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
488 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
489 const GValue *value, GParamSpec *pspec)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
490 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
491 PixbufRenderer *pr;
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 pr = PIXBUF_RENDERER(object);
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 switch (prop_id)
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 case PROP_ZOOM_MIN:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
498 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
499 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
500 case PROP_ZOOM_MAX:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
501 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
502 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
503 case PROP_ZOOM_QUALITY:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
504 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
505 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
506 case PROP_ZOOM_2PASS:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
507 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
508 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
509 case PROP_ZOOM_EXPAND:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
510 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
511 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
512 case PROP_DITHER_QUALITY:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
513 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
514 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
515 case PROP_SCROLL_RESET:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
516 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
517 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
518 case PROP_DELAY_FLIP:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
519 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
520 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
521 case PROP_LOADING:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
522 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
523 break;
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
524 case PROP_COMPLETE:
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
525 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
526 break;
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
527 case PROP_CACHE_SIZE_DISPLAY:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
528 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
529 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
530 case PROP_CACHE_SIZE_TILES:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
531 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
532 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
533 case PROP_WINDOW_FIT:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
534 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
535 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
536 case PROP_WINDOW_LIMIT:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
537 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
538 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
539 case PROP_WINDOW_LIMIT_VALUE:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
540 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
541 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
542 default:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
543 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
544 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
545 }
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
548 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
549 GValue *value, GParamSpec *pspec)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
550 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
551 PixbufRenderer *pr;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
552
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
553 pr = PIXBUF_RENDERER(object);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
554
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
555 switch (prop_id)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
556 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
557 case PROP_ZOOM_MIN:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
558 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
559 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
560 case PROP_ZOOM_MAX:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
561 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
562 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
563 case PROP_ZOOM_QUALITY:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
564 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
565 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
566 case PROP_ZOOM_2PASS:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
567 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
568 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
569 case PROP_ZOOM_EXPAND:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
570 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
571 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
572 case PROP_DITHER_QUALITY:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
573 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
574 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
575 case PROP_SCROLL_RESET:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
576 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
577 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
578 case PROP_DELAY_FLIP:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
579 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
580 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
581 case PROP_LOADING:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
582 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
583 break;
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
584 case PROP_COMPLETE:
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
585 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
586 break;
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
587 case PROP_CACHE_SIZE_DISPLAY:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
588 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
589 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
590 case PROP_CACHE_SIZE_TILES:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
591 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
592 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
593 case PROP_WINDOW_FIT:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
594 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
595 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
596 case PROP_WINDOW_LIMIT:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
597 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
598 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
599 case PROP_WINDOW_LIMIT_VALUE:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
600 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
601 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
602 default:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
603 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
604 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
605 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
606 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
607
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
608 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
609 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
610 if (GTK_WIDGET_DRAWABLE(widget))
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
611 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
612 if (!GTK_WIDGET_NO_WINDOW(widget))
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
613 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
614 pixbuf_renderer_paint(PIXBUF_RENDERER(widget), &event->area);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
615 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
616 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
617
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
618 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
619 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
620
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
621 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
622 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
623 * misc utilities
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
624 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
625 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
626
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
627 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
628 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
629 GdkCursor *cursor;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
630
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
631 if (!widget->window) return;
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 if (icon == -1)
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 cursor = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
636 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
637 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
638 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
639 cursor = gdk_cursor_new (icon);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
640 }
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 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
643
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
644 if (cursor) gdk_cursor_unref(cursor);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
645 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
646
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
647 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
648 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
649 gint w, h, d;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
650
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
651 d = gdk_drawable_get_depth(pixmap);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
652 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
653 return w * h * (d / 8);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
654 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
655
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
656 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
657 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
658 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
659 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
660 if (clip_x + clip_w <= x ||
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
661 clip_x >= x + w ||
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
662 clip_y + clip_h <= y ||
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
663 clip_y >= y + h)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
664 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
665 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
666 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
667
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
668 *rx = MAX(x, clip_x);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
669 *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
670
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
671 *ry = MAX(y, clip_y);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
672 *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
673
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
674 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
675 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
676
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
677 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
678 {
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
679 GdkWindowState state;
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
680
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
681 if (!pr->parent_window) return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
682 if (!pr->window_fit) return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
683 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
684
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
685 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
686 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
687 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
688
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
689 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
690 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
691
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
692 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
693 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
694 GtkWidget *widget;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
695 GtkWidget *parent;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
696 gint ww, wh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
697
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
698 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
699
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
700 if (pr->window_limit)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
701 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
702 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
703 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
704
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
705 if (w > sw) w = sw;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
706 if (h > sh) h = sh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
707 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
708
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
709 widget = GTK_WIDGET(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
710 parent = GTK_WIDGET(pr->parent_window);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
711
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
712 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
713 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
714
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
715 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
716 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
717
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
718 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
719
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
720 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
721 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
722
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
723 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
724 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
725 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
726 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
727
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
728 pr->parent_window = GTK_WIDGET(window);
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 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
732 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
733 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
734
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
735 return GTK_WINDOW(pr->parent_window);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
736 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
737
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
738
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
739 /*
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 * overlays
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 */
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 static void pr_overlay_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
746 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
747 GtkWidget *box;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
748 GList *work;
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 box = GTK_WIDGET(pr);
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 work = pr->overlay_list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
753 while (work)
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 OverlayData *od;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
756 gint px, py, pw, ph;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
757 gint rx, ry, rw, rh;
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 od = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
760 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
761
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
762 if (!od->visible) continue;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
763
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
764 pw = gdk_pixbuf_get_width(od->pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
765 ph = gdk_pixbuf_get_height(od->pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
766 px = od->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
767 py = od->y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
768
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
769 if (od->relative)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
770 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
771 if (px < 0) px = pr->window_width - pw + px;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
772 if (py < 0) py = pr->window_height - ph + py;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
773 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
774
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
775 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
776 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
777 gdk_draw_pixbuf(box->window,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
778 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
779 od->pixbuf,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
780 rx - px, ry - py,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
781 rx, ry, rw, rh,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
782 pr->dither_quality, rx, ry);
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 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
786
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
787 static void pr_overlay_queue_draw(PixbufRenderer *pr, OverlayData *od, gint hidden)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
788 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
789 gint x, y, w, h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
790 gint old_vis;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
791
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
792 w = gdk_pixbuf_get_width(od->pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
793 h = gdk_pixbuf_get_height(od->pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
794 x = od->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
795 y = od->y;
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 if (od->relative)
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 if (x < 0) x = pr->window_width - w + x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
800 if (y < 0) y = pr->window_height - h + y;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
803 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
804 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
805 w, h,
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
806 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
807
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
808 old_vis = od->visible;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
809 if (hidden) od->visible = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
810 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
811 od->visible = old_vis;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
814 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
815 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
816 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
817
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
818 work = pr->overlay_list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
819 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
820 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
821 OverlayData *od = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
822 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
823
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
824 pr_overlay_queue_draw(pr, od, 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 }
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 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
829 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
830 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
831
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
832 work = pr->overlay_list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
833 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
834 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
835 OverlayData *od = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
836 work = work->next;
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 if (od->id == id) return od;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
839 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
840
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
841 return 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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
844 gint pixbuf_renderer_overlay_add(PixbufRenderer *pr, GdkPixbuf *pixbuf, gint x, gint y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
845 gint relative, gint always)
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 OverlayData *od;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
848 gint id;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
849
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
850 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
851 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
852
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
853 id = 1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
854 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
855
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
856 od = g_new0(OverlayData, 1);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
857 od->id = id;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
858 od->pixbuf = pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
859 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
860 od->x = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
861 od->y = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
862 od->relative = relative;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
863 od->visible = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
864 od->always = always;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
865
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
866 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
867
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
868 pr_overlay_queue_draw(pr, od, FALSE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
869
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
870 return od->id;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
871 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
872
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
873 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
874 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
875 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
876
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
877 if (od->pixbuf) 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
878 g_free(od);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
879 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
880
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
881 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
882 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
883 while (pr->overlay_list)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
884 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
885 OverlayData *od;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
886
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
887 od = pr->overlay_list->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
888 pr_overlay_free(pr, od);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
889 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
890 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
891
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
892 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
893 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
894 OverlayData *od;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
895
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
896 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
897
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
898 od = pr_overlay_find(pr, id);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
899 if (!od) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
900
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
901 if (pixbuf)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
902 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
903 pr_overlay_queue_draw(pr, od, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
904
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
905 g_object_ref(G_OBJECT(pixbuf));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
906 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
907 od->pixbuf = pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
908
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
909 od->x = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
910 od->y = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
911
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
912 pr_overlay_queue_draw(pr, od, FALSE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
913 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
914 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
915 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
916 pr_overlay_queue_draw(pr, od, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
917 pr_overlay_free(pr, od);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
918 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
919 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
920
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
921 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
922 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
923 OverlayData *od;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
924
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
925 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
926
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
927 od = pr_overlay_find(pr, id);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
928 if (!od) return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
929
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
930 if (pixbuf) *pixbuf = od->pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
931 if (x) *x = od->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
932 if (y) *y = od->y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
933
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
934 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
935 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
936
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
937 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
938 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
939 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
940 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
941
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
942 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
943 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
944 * scroller overlay
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
945 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
946 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
947
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
948
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
949 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
950 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
951 PixbufRenderer *pr = data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
952 gint x, y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
953 gint xinc, yinc;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
954
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
955 /* 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
956 * 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
957 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
958
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
959 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
960 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
961 x = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
962 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
963 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
964 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
965 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
966 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
967 x += (x > 0) ? -shift : shift;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
968 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
969
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
970 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
971 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
972 y = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
973 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
974 else
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 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
977 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
978 y += (y > 0) ? -shift : shift;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
979 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
980
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
981 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
982 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
983 xinc = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
984 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
985 else
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 xinc = pr->scroller_xinc;
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 if (x >= 0)
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 if (xinc < 0) xinc = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
992 if (x < xinc) xinc = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
993 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
994 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
995 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
996 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
997 if (xinc > 0) xinc = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
998 if (x > xinc) xinc = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
999 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
1000 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1001 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1002
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1003 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
1004 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1005 yinc = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1006 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1007 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1008 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1009 yinc = pr->scroller_yinc;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1010
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1011 if (y >= 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1012 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1013 if (yinc < 0) yinc = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1014 if (y < yinc) yinc = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1015 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
1016 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1017 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1018 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1019 if (yinc > 0) yinc = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1020 if (y > yinc) yinc = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1021 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
1022 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1023 }
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 pr->scroller_xinc = xinc;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1026 pr->scroller_yinc = yinc;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1027
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1028 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
1029 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
1030
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1031 pixbuf_renderer_scroll(pr, xinc, yinc);
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 return TRUE;
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 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
1037 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1038 if (pr->scroller_id != -1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1039 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1040 g_source_remove(pr->scroller_id);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1041 pr->scroller_id = -1;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1044 if (start)
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 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
1047 pr_scroller_update_cb, pr);
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 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1050
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1051 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
1052 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1053 if (pr->scroller_overlay == -1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1054 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1055 GdkPixbuf *pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1056 gint w, h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1057
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1058 #ifdef GQVIEW_BUILD
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1059 pixbuf = pixbuf_inline(PIXBUF_INLINE_SCROLLER);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1060 #else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1061 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
1062 gdk_pixbuf_fill(pixbuf, 0x000000ff);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1063 #endif
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1064 w = gdk_pixbuf_get_width(pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1065 h = gdk_pixbuf_get_height(pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1066
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1067 pr->scroller_overlay = pixbuf_renderer_overlay_add(pr, pixbuf, x - w / 2, y - h / 2, FALSE, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1068 g_object_unref(pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1069 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1070
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1071 pr->scroller_x = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1072 pr->scroller_y = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1073 pr->scroller_xpos = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1074 pr->scroller_ypos = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1075
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1076 pr_scroller_timer_set(pr, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1077 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1078
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1079 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
1080 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1081 if (pr->scroller_id == -1) return;
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 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
1084 pr->scroller_overlay = -1;
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 pr_scroller_timer_set(pr, FALSE);
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
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 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1091 * borders
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1095 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
1096 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1097 GtkWidget *box;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1098 gint rx, ry, rw, rh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1099
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1100 box = GTK_WIDGET(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1101
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1102 if (!box->window) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1103
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1104 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
1105 {
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1106 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
1107 0, 0,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1108 pr->window_width, pr->window_height,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1109 &rx, &ry, &rw, &rh))
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1110 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1111 gdk_window_clear_area(box->window, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1112 pr_overlay_draw(pr, rx, ry, rw, rh);
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 return;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1117 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
1118 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1119 if (pr->x_offset > 0 &&
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1120 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
1121 0, 0,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1122 pr->x_offset, pr->window_height,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1123 &rx, &ry, &rw, &rh))
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 gdk_window_clear_area(box->window, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1126 pr_overlay_draw(pr, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1127 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1128 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
1129 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
1130 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
1131 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
1132 &rx, &ry, &rw, &rh))
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1133 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1134 gdk_window_clear_area(box->window, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1135 pr_overlay_draw(pr, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1136 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1137 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1138 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
1139 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1140 if (pr->y_offset > 0 &&
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1141 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
1142 pr->x_offset, 0,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1143 pr->vis_width, pr->y_offset,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1144 &rx, &ry, &rw, &rh))
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1145 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1146 gdk_window_clear_area(box->window, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1147 pr_overlay_draw(pr, rx, ry, rw, rh);
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 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
1150 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
1151 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
1152 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
1153 &rx, &ry, &rw, &rh))
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1154 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1155 gdk_window_clear_area(box->window, rx, ry, rw, rh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1156 pr_overlay_draw(pr, rx, ry, rw, rh);
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 }
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 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
1162 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1163 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
1164 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1165
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1166 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
1167 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1168 GtkStyle *style;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1169 GtkWidget *widget;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1170
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1171 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
1172
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1173 widget = GTK_WIDGET(pr);
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 style = gtk_style_copy(gtk_widget_get_style(widget));
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1176 g_object_ref(G_OBJECT(style));
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 if (color)
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 GdkColor *slot;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1181
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1182 slot = &style->bg[GTK_STATE_NORMAL];
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 slot->red = color->red;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1185 slot->green = color->green;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1186 slot->blue = color->blue;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1189 gtk_widget_set_style(widget, style);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1190 g_object_unref(G_OBJECT(style));
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 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
1193 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1194
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1195 void pixbuf_renderer_set_black(PixbufRenderer *pr, gint black)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1196 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1197 GdkColor color = { 0, 0, 0, 0};
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 pixbuf_renderer_set_color(pr, &color);
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
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 /*
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 * source tiles
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1206 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1207 */
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 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
1210 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1211 if (!st) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1212
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1213 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
1214 g_free(st);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1217 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
1218 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1219 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1220
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1221 work = pr->source_tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1222 while (work)
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 SourceTile *st;
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 st = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1227 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1228
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1229 pr_source_tile_free(st);
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 g_list_free(pr->source_tiles);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1233 pr->source_tiles = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1234 }
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 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
1237 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1238 pr_source_tile_free_all(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1239 pr->source_tiles_enabled = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1240 }
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 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
1243 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1244 gint x1, y1, x2, y2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1245
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1246 if (!st) return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1247
32
96ac60a9c0f1 Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents: 31
diff changeset
1248 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
1249 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
1250 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
1251 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
1252
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1253 return !((double)st->x * pr->scale > (double)x2 ||
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1254 (double)(st->x + pr->source_tile_width) * pr->scale < (double)x1 ||
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
1255 (double)st->y * pr->scale > (double)y2 ||
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1256 (double)(st->y + pr->source_tile_height) * pr->scale < (double)y1);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1257 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1258
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1259 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
1260 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1261 SourceTile *st = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1262 gint count;
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 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
1265
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1266 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
1267
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1268 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
1269 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
1270 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1271 GList *work;
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 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
1274 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
1275 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1276 SourceTile *needle;
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 needle = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1279 work = work->prev;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1280
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1281 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
1282 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1283 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
1284
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1285 if (pr->func_tile_dispose)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1286 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1287 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
1288 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
1289 needle->pixbuf, pr->func_tile_data);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1290 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1291
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1292 if (!st)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1293 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1294 st = needle;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1295 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1296 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1297 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1298 pr_source_tile_free(needle);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1301 count--;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1302 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1303 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1304 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1305
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1306 if (!st)
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 st = g_new0(SourceTile, 1);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1309 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
1310 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
1311 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1312
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1313 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
1314 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
1315 st->blank = TRUE;
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 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
1318
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1319 return st;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1320 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1321
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1322 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
1323 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1324 SourceTile *st;
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 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
1327 if (!st) return NULL;
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 if (pr->func_tile_request &&
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1330 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
1331 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
1332 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1333 st->blank = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1334 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1335
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1336 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
1337 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
1338
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1339 return st;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1340 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1341
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1342 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
1343 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1344 GList *work;
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 work = pr->source_tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1347 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1348 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1349 SourceTile *st = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1350
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1351 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
1352 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
1353 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1354 if (work != pr->source_tiles)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1355 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1356 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
1357 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
1358 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1359 return st;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1360 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1361
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1362 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1363 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1364
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1365 return NULL;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1368 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
1369 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1370 gint x1, y1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1371 GList *list = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1372 gint sx, sy;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1373
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1374 if (x < 0) x = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1375 if (y < 0) y = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1376 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
1377 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
1378
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1379 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
1380 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
1381
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1382 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
1383 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1384 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
1385 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1386 SourceTile *st;
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 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
1389 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
1390
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1391 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
1392 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1393 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1394
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1395 return g_list_reverse(list);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1398 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
1399 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1400 GList *work;
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 work = pr->source_tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1403 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1404 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1405 SourceTile *st;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1406 gint rx, ry, rw, rh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1407
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1408 st = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1409 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1410
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1411 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
1412 x, y, width, height,
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1413 &rx, &ry, &rw, &rh))
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1414 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1415 GdkPixbuf *pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1416
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1417 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
1418 if (pr->func_tile_request &&
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1419 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
1420 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1421 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
1422 rw * pr->scale, rh * pr->scale);
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 g_object_unref(pixbuf);
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 }
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 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
1430 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
1431 gint new_data, gint fast)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1432 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1433 GtkWidget *box;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1434 GList *list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1435 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1436 gint draw = FALSE;
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 box = GTK_WIDGET(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 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
1441 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1442 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
1443 work = list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1444 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1445 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1446 SourceTile *st;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1447 gint rx, ry, rw, rh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1448
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1449 st = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1450 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1451
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1452 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
1453 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
1454 &rx, &ry, &rw, &rh))
23
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 if (st->blank)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1457 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1458 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
1459 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
1460 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1461 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
1462 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1463 gdk_draw_pixbuf(it->pixmap,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1464 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
1465 st->pixbuf,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1466 rx - st->x, ry - st->y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1467 rx - it->x, ry - it->y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1468 rw, rh,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1469 pr->dither_quality, rx, ry);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1470 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1471 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1472 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1473 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1474 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1475 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1476 double scale_x, scale_y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1477 gint sx, sy, sw, sh;
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 if (pr->image_width == 0 || pr->image_height == 0) return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1480 scale_x = (double)pr->width / pr->image_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1481 scale_y = (double)pr->height / pr->image_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1482
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1483 sx = (double)(it->x + x) / scale_x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1484 sy = (double)(it->y + y) / scale_y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1485 sw = (double)w / scale_x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1486 sh = (double)h / scale_y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1487
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1488 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
1489
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1490 #if 0
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1491 /* 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
1492 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
1493 #endif
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1494
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1495 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
1496 work = list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1497 while (work)
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 SourceTile *st;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1500 gint rx, ry, rw, rh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1501 gint stx, sty, stw, sth;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1502
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1503 st = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1504 work = work->next;
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 stx = floor((double)st->x * scale_x);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1507 sty = floor((double)st->y * scale_y);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1508 stw = ceil ((double)(st->x + pr->source_tile_width) * scale_x) - stx;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1509 sth = ceil ((double)(st->y + pr->source_tile_height) * scale_y) - sty;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1510
33
a41ecbb26a96 Wed Apr 6 06:41:25 2005 John Ellis <johne@verizon.net>
gqview
parents: 32
diff changeset
1511 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
1512 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
1513 &rx, &ry, &rw, &rh))
23
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 if (st->blank)
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 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
1518 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
1519 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1520 else
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 double offset_x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1523 double offset_y;
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 /* may need to use unfloored stx,sty values here */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1526 offset_x = (double)(stx - it->x);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1527 offset_y = (double)(sty - it->y);
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 gdk_pixbuf_scale(st->pixbuf, it->pixbuf, rx - it->x, ry - it->y, rw, rh,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1530 (double) 0.0 + offset_x,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1531 (double) 0.0 + offset_y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1532 scale_x, scale_y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1533 (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
1534 draw = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1535 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1536 }
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 }
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 g_list_free(list);
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 return draw;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1543 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1544
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1545 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
1546 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
1547 PixbufRendererTileRequestFunc func_request,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1548 PixbufRendererTileDisposeFunc func_dispose,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1549 gpointer user_data,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1550 gdouble zoom)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1551 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1552 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
1553 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
1554 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
1555 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
1556
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1557 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
1558 pr->pixbuf = NULL;
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 pr_source_tile_unset(pr);
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 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
1563
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1564 pr->source_tiles_enabled = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1565 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
1566 pr->source_tile_width = tile_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1567 pr->source_tile_height = tile_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1568
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1569 pr->image_width = width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1570 pr->image_height = height;
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 pr->func_tile_request = func_request;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1573 pr->func_tile_dispose = func_dispose;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1574 pr->func_tile_data = user_data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1575
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1576 pr_zoom_sync(pr, zoom, TRUE, FALSE, TRUE, FALSE, 0, 0);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1577 pr_redraw(pr, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1578 }
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 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
1581 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1582 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
1583
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1584 return pr->source_tiles_enabled;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1587 static void pr_zoom_adjust_real(PixbufRenderer *pr, gdouble increment,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1588 gint center_point, gint x, gint y)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1589 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1590 gdouble zoom = pr->zoom;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1591
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1592 if (increment == 0.0) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1593
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1594 if (zoom == 0.0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1595 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1596 if (pr->scale < 1.0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1597 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1598 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
1599 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1600 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1601 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1602 zoom = pr->scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1603 }
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1606 if (increment < 0.0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1607 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1608 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
1609 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1610 zoom = zoom + increment - 2.0;
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 else
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 zoom = zoom + increment;
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 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1617 else
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 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
1620 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1621 zoom = zoom + increment + 2.0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1622 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1623 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1624 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1625 zoom = zoom + increment;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1626 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1627 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1628
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1629 pr_zoom_sync(pr, zoom, FALSE, FALSE, FALSE, center_point, x, y);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1632 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1633 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1634 * display tiles
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1635 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1636 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1637
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1638 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
1639 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1640 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1641
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1642 it = g_new0(ImageTile, 1);
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 it->x = x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1645 it->y = y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1646 it->w = width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1647 it->h = height;
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 it->render_done = TILE_RENDER_NONE;
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 return it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1652 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1653
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1654 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
1655 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1656 if (!it) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1657
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1658 if (it->pixbuf) gdk_pixbuf_unref(it->pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1659 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
1660
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1661 g_free(it);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1664 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
1665 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1666 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1667
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1668 work = pr->tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1669 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1670 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1671 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1672
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1673 it = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1674 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1675
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1676 pr_tile_free(it);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1677 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1678
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1679 g_list_free(pr->tiles);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1680 pr->tiles = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1681 pr->tile_cache_size = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1682 }
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 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
1685 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1686 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1687
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1688 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
1689
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1690 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
1691 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
1692
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1693 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
1694 pr->tile_cache_size += it->size;
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 return it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1697 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1698
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1699 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
1700 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1701 if (it->qd)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1702 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1703 QueueData *qd = it->qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1704
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1705 it->qd = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1706 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
1707 g_free(qd);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1708 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1709
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1710 if (it->qd2)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1711 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1712 QueueData *qd = it->qd2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1713
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1714 it->qd2 = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1715 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
1716 g_free(qd);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1719 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
1720 pr->tile_cache_size -= it->size;
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 pr_tile_free(it);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1723 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1724
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1725 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
1726 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1727 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1728 gint tile_max;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1729
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1730 work = g_list_last(pr->tiles);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1731
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1732 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
1733 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1734 gint tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1735
32
96ac60a9c0f1 Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents: 31
diff changeset
1736 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
1737 tile_max = MAX(tiles * pr->tile_width * pr->tile_height * 3,
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1738 (gint)((double)pr->tile_cache_max * 1048576.0 * pr->scale));
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 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1741 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1742 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
1743 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1744
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1745 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
1746 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1747 ImageTile *needle;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1748
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1749 needle = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1750 work = work->prev;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1751 if (needle != it &&
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1752 ((!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
1753 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1754 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1755
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1756 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
1757 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1758 GList *work;
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 work = pr->tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1761 while (work)
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 ImageTile *it;
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 it = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1766 work = work->next;
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 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
1769 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
1770 it->blank = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1771
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1772 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
1773 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
1774 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1775 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1776
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1777 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
1778 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1779 gint x1, x2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1780 gint y1, y2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1781 GList *work;
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 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
1784 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
1785
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1786 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
1787 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
1788
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1789 work = pr->tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1790 while (work)
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 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1793
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1794 it = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1795 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1796
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1797 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
1798 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
1799 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1800 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
1801 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
1802 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1803 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1804 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1805
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
1806 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
1807 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1808 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1809
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1810 work = pr->tiles;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1811 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1812 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1813 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1814
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1815 it = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1816 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
1817 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1818 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
1819 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
1820 return it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1821 }
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 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1824 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1825
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
1826 if (only_existing) return NULL;
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
1827
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1828 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
1829 }
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 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
1832 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1833 if (!it->pixmap)
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 GdkPixmap *pixmap;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1836 guint size;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1837
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1838 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
1839
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1840 size = pixmap_calc_size(pixmap);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1841 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
1842
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1843 it->pixmap = pixmap;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1844 it->size += size;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1845 pr->tile_cache_size += size;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1846 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1847
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1848 if ((pr->zoom != 1.0 || pr->source_tiles_enabled || (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
1849 !it->pixbuf)
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 GdkPixbuf *pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1852 guint size;
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 if (pr->pixbuf)
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 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
1857 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
1858 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
1859 pr->tile_width, pr->tile_height);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1860 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1861 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1862 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1863 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
1864 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1865
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1866 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
1867 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
1868
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1869 it->pixbuf = pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1870 it->size += size;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1871 pr->tile_cache_size += size;
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 /*
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 * drawing
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1878 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1879 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1880
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1881 static 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
1882 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
1883 gint new_data, gint fast)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1884 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1885 GtkWidget *box;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1886 gint has_alpha;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1887 gint draw = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1888
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1889 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
1890
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1891 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
1892 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1893 x = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1894 y = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1895 w = it->w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1896 h = it->h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1897 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
1898 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1899 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
1900 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1901 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
1902 return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1903 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1904
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1905 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
1906
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1907 if (new_data) it->blank = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1908
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1909 pr_tile_prepare(pr, it);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1910 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
1911
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1912 box = GTK_WIDGET(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1913
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1914 /* 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
1915 * 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
1916 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1917
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1918 if (it->blank)
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 /* no data, do fast rect fill */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1921 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
1922 0, 0, it->w, it->h);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1923 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1924 else if (pr->source_tiles_enabled)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1925 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1926 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
1927 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1928 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
1929 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1930 if (has_alpha)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1931 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1932 gdk_pixbuf_composite_color(pr->pixbuf, it->pixbuf, x, y, w, h,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1933 (double) 0.0 - it->x,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1934 (double) 0.0 - it->y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1935 1.0, 1.0, GDK_INTERP_NEAREST,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1936 255, it->x + x, it->y + y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1937 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
1938 draw = TRUE;
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 else
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 /* faster, simple */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1943 gdk_draw_pixbuf(it->pixmap,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1944 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
1945 pr->pixbuf,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1946 it->x + x, it->y + y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1947 x, y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1948 w, h,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1949 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
1950 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1951 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1952 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1953 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1954 double scale_x, scale_y;
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 if (pr->image_width == 0 || pr->image_height == 0) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1957 scale_x = (double)pr->width / pr->image_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1958 scale_y = (double)pr->height / pr->image_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1959
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1960 /* 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
1961 * 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
1962 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1963 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
1964
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1965 if (!has_alpha)
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 gdk_pixbuf_scale(pr->pixbuf, it->pixbuf, x, y, w, h,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1968 (double) 0.0 - it->x,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1969 (double) 0.0 - it->y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1970 scale_x, scale_y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1971 (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
1972 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1973 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1974 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1975 gdk_pixbuf_composite_color(pr->pixbuf, it->pixbuf, x, y, w, h,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1976 (double) 0.0 - it->x,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1977 (double) 0.0 - it->y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1978 scale_x, scale_y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1979 (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
1980 255, it->x + x, it->y + y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1981 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
1982 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1983 draw = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1984 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1985
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1986 if (draw && it->pixbuf && !it->blank)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1987 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1988 gdk_draw_pixbuf(it->pixmap,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1989 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
1990 it->pixbuf,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1991 x, y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1992 x, y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1993 w, h,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1994 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
1995 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1996 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1997
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1998
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
1999 static void pr_tile_expose(PixbufRenderer *pr, ImageTile *it,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2000 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
2001 gint new_data, gint fast)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2002 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2003 GtkWidget *box;
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 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
2006
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2007 box = GTK_WIDGET(pr);
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 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
2010 it->pixmap, x, y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2011 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
2012
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2013 if (pr->overlay_list)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2014 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2015 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
2016 pr->y_offset + (it->y - pr->y_scroll) + y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2017 w, h);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2018 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2019 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2020
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2021
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2022 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
2023 {
32
96ac60a9c0f1 Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents: 31
diff changeset
2024 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
2025 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
2026 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2027
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 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2030 * draw queue
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2031 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2032 */
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 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
2035 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2036 PixbufRenderer *pr = data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2037 QueueData *qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2038 gint fast;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2039
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2040 if ((!pr->pixbuf && !pr->source_tiles_enabled) ||
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2041 (!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
2042 pr->draw_idle_id == -1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2043 {
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2044 pr_render_complete_signal(pr);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2045
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2046 pr->draw_idle_id = -1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2047 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2048 }
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 if (pr->draw_queue)
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 qd = pr->draw_queue->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2053 fast = (pr->zoom_2pass && pr->zoom_quality != GDK_INTERP_NEAREST && pr->scale != 1.0);
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 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2056 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2057 if (pr->loading)
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 /* 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
2060
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2061 pr->draw_idle_id = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2062 pr_queue_draw_idle_cb, pr, NULL);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2063 pr->draw_idle_high = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2064 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2065 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2066
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2067 qd = pr->draw_queue_2pass->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2068 fast = FALSE;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2071 if (GTK_WIDGET_REALIZED(pr))
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2072 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2073 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
2074 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2075 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
2076 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2077 else if (qd->new_data)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2078 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2079 /* 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
2080 qd->it->blank = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2081 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
2082 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2083 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
2084 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2085 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2086 }
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 if (pr->draw_queue)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2089 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2090 qd->it->qd = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2091 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
2092 if (fast)
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 if (qd->it->qd2)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2095 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2096 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
2097 g_free(qd);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2100 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2101 qd->it->qd2 = qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2102 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
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 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2106 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2107 g_free(qd);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2108 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2109 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2110 else
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 qd->it->qd2 = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2113 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
2114 g_free(qd);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2117 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
2118 {
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2119 pr_render_complete_signal(pr);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2120
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2121 pr->draw_idle_id = -1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2122 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2123 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2124
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2125 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2126 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2127
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2128 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
2129 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2130 GList *work;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2131
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2132 work = list;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2133 while (work)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2134 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2135 QueueData *qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2136
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2137 qd = work->data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2138 work = work->next;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2139
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2140 qd->it->qd = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2141 qd->it->qd2 = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2142 g_free(qd);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2143 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2144
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2145 g_list_free(list);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2146 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2147
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2148 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
2149 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2150 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
2151 pr->draw_queue = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2152
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2153 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
2154 pr->draw_queue_2pass = NULL;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2155
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2156 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
2157 pr->draw_idle_id = -1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2158 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2159
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2160 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
2161 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2162 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
2163 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2164 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
2165 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2166 if (parent->x > qd->x)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2167 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2168 parent->w += parent->x - qd->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2169 parent->x = qd->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2170 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2171
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2172 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
2173 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2174 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
2175 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2176 if (parent->y > qd->y)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2177 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2178 parent->h += parent->y - qd->y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2179 parent->y = qd->y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2180 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2181
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2182 parent->new_data |= qd->new_data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2183 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2184
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2185 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
2186 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2187 gint nx, ny;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2188 gint nw, nh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2189 gint vx, vy;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2190 gint vw, vh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2191
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2192 vw = pr->vis_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2193 vh = pr->vis_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2194
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2195 vx = pr->x_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2196 vy = pr->y_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2197
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2198 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
2199
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2200 /* now clamp it */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2201 nx = CLAMP(*x, vx, vx + vw);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2202 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
2203
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2204 ny = CLAMP(*y, vy, vy + vh);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2205 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
2206
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2207 *x = nx;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2208 *y = ny;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2209 *w = nw;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2210 *h = nh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2211
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2212 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2213 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2214
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2215 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
2216 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
2217 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2218 gint i, j;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2219 gint x1, x2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2220 gint y1, y2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2221
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2222 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
2223
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2224 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
2225 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
2226
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2227 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
2228 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
2229
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2230 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
2231 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2232 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
2233 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2234 ImageTile *it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2235
32
96ac60a9c0f1 Wed Apr 6 02:43:40 2005 John Ellis <johne@verizon.net>
gqview
parents: 31
diff changeset
2236 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
2237 (only_existing &&
34
772fe5a509b1 Thu Apr 7 08:42:54 2005 John Ellis <johne@verizon.net>
gqview
parents: 33
diff changeset
2238 (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
2239 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
2240 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
2241 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
2242 if (it)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2243 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2244 QueueData *qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2245
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2246 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
2247 (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
2248 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2249 it->render_todo = render;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2250 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2251
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2252 qd = g_new(QueueData, 1);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2253 qd->it = it;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2254 qd->new_data = new_data;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2255
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2256 if (i < x)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2257 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2258 qd->x = x - i;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2259 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2260 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2261 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2262 qd->x = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2263 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2264 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
2265 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
2266
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2267 if (j < y)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2268 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2269 qd->y = y - j;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2270 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2271 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2272 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2273 qd->y = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2274 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2275 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
2276 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
2277
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2278 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
2279 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2280 g_free(qd);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2281 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2282 else if (it->qd)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2283 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2284 pr_queue_merge(it->qd, qd);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2285 g_free(qd);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2286 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2287 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2288 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2289 it->qd = qd;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2290 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
2291 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2292 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2293 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2294 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2295
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2296 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2297 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2298
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2299 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
2300 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
2301 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2302 gint nx, ny;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2303
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2304 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
2305 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
2306 w -= (nx - x);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2307 h -= (ny - y);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2308 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
2309 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
2310 if (w < 1 || h < 1) return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2311
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
2312 if (pr_queue_to_tiles(pr, nx, ny, w, h, clamp, render, new_data, only_existing) &&
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2313 ((!pr->draw_queue && !pr->draw_queue_2pass) || pr->draw_idle_id == -1 || !pr->draw_idle_high))
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2314 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2315 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
2316 pr->draw_idle_id = g_idle_add_full(GDK_PRIORITY_REDRAW,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2317 pr_queue_draw_idle_cb, pr, NULL);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2318 pr->draw_idle_high = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2319 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2320 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2321
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2322 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
2323 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2324 pr_queue_clear(pr);
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
2325 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
2326 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2327
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2328 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2329 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2330 * signal emission
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2331 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2332 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2333
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2334 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
2335 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2336 #if 0
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2337 printf("FIXME: send updated signal\n");
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2338 #endif
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2339 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2340
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2341 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
2342 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2343 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
2344 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2345
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2346 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
2347 {
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2348 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
2349 }
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2350
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2351 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
2352 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2353 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
2354 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2355
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2356 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
2357 {
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2358 if (!pr->complete)
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2359 {
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2360 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
2361 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
2362 }
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2363 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2364
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2365 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2366 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2367 * sync and clamp
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2368 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2369 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2370
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2371 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
2372 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2373 gint old_xs;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2374 gint old_ys;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2375
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2376 if (pr->zoom == 0.0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2377 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2378 pr->x_scroll = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2379 pr->y_scroll = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2380
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2381 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2382 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2383
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2384 old_xs = pr->x_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2385 old_ys = pr->y_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2386
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2387 if (pr->x_offset > 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2388 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2389 pr->x_scroll = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2390 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2391 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2392 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2393 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
2394 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2395
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2396 if (pr->y_offset > 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2397 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2398 pr->y_scroll = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2399 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2400 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2401 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2402 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
2403 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2404
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2405 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
2406 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2407
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2408 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
2409 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2410 gint old_vw, old_vh;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2411
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2412 old_vw = pr->vis_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2413 old_vh = pr->vis_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2414
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2415 if (pr->width < pr->window_width)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2416 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2417 pr->vis_width = pr->width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2418 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
2419 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2420 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2421 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2422 pr->vis_width = pr->window_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2423 pr->x_offset = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2424 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2425
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2426 if (pr->height < pr->window_height)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2427 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2428 pr->vis_height = pr->height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2429 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
2430 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2431 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2432 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2433 pr->vis_height = pr->window_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2434 pr->y_offset = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2435 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2436
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2437 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
2438 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2439
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2440 static gint pr_zoom_clamp(PixbufRenderer *pr, gdouble zoom,
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2441 gint force, gint new, gint invalidate,
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2442 gint *redrawn)
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2443 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2444 gint w, h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2445 gdouble scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2446 gint invalid;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2447
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2448 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
2449
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2450 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
2451
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2452 w = pr->image_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2453 h = pr->image_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2454
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2455 if (zoom == 0.0 && !pr->pixbuf)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2456 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2457 scale = 1.0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2458 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2459 else if (zoom == 0.0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2460 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2461 gint max_w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2462 gint max_h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2463 gint sizeable;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2464
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2465 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
2466
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2467 if (sizeable)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2468 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2469 max_w = gdk_screen_width();
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2470 max_h = gdk_screen_height();
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2471
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2472 if (pr->window_limit)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2473 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2474 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
2475 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
2476 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2477 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2478 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2479 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2480 max_w = pr->window_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2481 max_h = pr->window_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2482 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2483
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2484 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
2485 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2486 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
2487 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2488 scale = (gdouble)max_h / h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2489 h = max_h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2490 w = w * scale + 0.5;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2491 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
2492 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2493 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2494 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2495 scale = (gdouble)max_w / w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2496 w = max_w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2497 h = h * scale + 0.5;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2498 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
2499 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2500 if (w < 1) w = 1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2501 if (h < 1) h = 1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2502 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2503 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2504 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2505 scale = 1.0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2506 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2507 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2508 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
2509 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2510 scale = zoom;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2511 w = w * scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2512 h = h * scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2513 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2514 else /* zoom out */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2515 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2516 scale = 1.0 / (0.0 - zoom);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2517 w = w * scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2518 h = h * scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2519 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2520
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2521 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
2522
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2523 pr->zoom = zoom;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2524 pr->width = w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2525 pr->height = h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2526 pr->scale = scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2527
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2528 if (invalidate || invalid)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2529 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2530 pr_tile_invalidate_all(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2531 pr_redraw(pr, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2532 }
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2533 if (redrawn) *redrawn = (invalidate || invalid);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2534
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2535 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2536 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2537
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2538 static void pr_zoom_sync(PixbufRenderer *pr, gdouble zoom,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2539 gint force, gint blank, gint new,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2540 gint center_point, gint px, gint py)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2541 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2542 gdouble old_scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2543 gint old_cx, old_cy;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2544 gint clamped;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2545 gint sized;
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2546 gint redrawn = FALSE;
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2547
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2548 old_scale = pr->scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2549 if (center_point)
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 px = CLAMP(px, 0, pr->width);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2552 py = CLAMP(py, 0, pr->height);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2553 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
2554 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
2555 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2556 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2557 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2558 px = py = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2559 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
2560 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
2561 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2562
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2563 if (!pr_zoom_clamp(pr, zoom, force, new, force, &redrawn)) return;
23
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 clamped = pr_size_clamp(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2566 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
2567
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2568 if (force)
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 switch (pr->scroll_reset)
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 case PR_SCROLL_RESET_NOCHANGE:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2573 /* maintain old scroll position, do nothing */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2574 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2575 case PR_SCROLL_RESET_CENTER:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2576 /* center new image */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2577 pr->x_scroll = ((double)pr->image_width / 2.0 * pr->scale) - pr->vis_width / 2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2578 pr->y_scroll = ((double)pr->image_height / 2.0 * pr->scale) - pr->vis_height / 2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2579 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2580 case PR_SCROLL_RESET_TOPLEFT:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2581 default:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2582 /* reset to upper left */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2583 pr->x_scroll = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2584 pr->y_scroll = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2585 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2586 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2587 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2588 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2589 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2590 /* 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
2591 if (center_point)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2592 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2593 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
2594 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
2595 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2596 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2597 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2598 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
2599 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
2600 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2601 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2602
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2603 pr_scroll_clamp(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2604
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2605 #if 0
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2606 pr_tile_sync(pr, blank);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2607 #endif
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2608
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2609 /* 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
2610 * 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
2611 * so redraw the window anyway :/
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 if (sized || clamped) pr_border_clear(pr);
27
9c24765c2d3a Sat Apr 2 17:28:16 2005 John Ellis <johne@verizon.net>
gqview
parents: 26
diff changeset
2614 pr_redraw(pr, redrawn);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2615
29
8a8ec4b3e769 Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents: 27
diff changeset
2616 pr_scroll_notify_signal(pr);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2617 pr_zoom_signal(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2618 pr_update_signal(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2619 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2620
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2621 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
2622 {
61
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2623 gint zoom_changed = FALSE;
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2624
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2625 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
2626
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2627 pr->window_width = new_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2628 pr->window_height = new_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2629
61
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2630 if (pr->zoom == 0.0)
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2631 {
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2632 gdouble old_scale = pr->scale;
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2633 pr_zoom_clamp(pr, 0.0, TRUE, FALSE, FALSE, NULL);
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2634 zoom_changed = (old_scale != pr->scale);
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2635 }
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2636
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2637 pr_size_clamp(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2638 pr_scroll_clamp(pr);
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 /* ensure scroller remains visible */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2641 if (pr->scroller_overlay != -1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2642 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2643 gint update = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2644
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2645 if (pr->scroller_x > new_width)
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 pr->scroller_x = new_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2648 pr->scroller_xpos = new_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2649 update = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2650 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2651 if (pr->scroller_y > new_height)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2652 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2653 pr->scroller_y = new_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2654 pr->scroller_ypos = new_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2655 update = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2656 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2657
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2658 if (update)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2659 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2660 GdkPixbuf *pixbuf;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2661
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2662 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
2663 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2664 gint w, h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2665
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2666 w = gdk_pixbuf_get_width(pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2667 h = gdk_pixbuf_get_height(pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2668 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
2669 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
2670 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2671 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2672 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2673
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2674 pr_border_clear(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2675
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2676 #if 0
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2677 pr_tile_sync(pr, pr->width, pr->height, FALSE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2678 #endif
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2679
29
8a8ec4b3e769 Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents: 27
diff changeset
2680 pr_scroll_notify_signal(pr);
61
0c912a2d94f1 Mon Jun 13 20:22:58 2005 John Ellis <johne@verizon.net>
gqview
parents: 42
diff changeset
2681 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
2682 pr_update_signal(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2683 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2684
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2685 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
2686 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2687 PixbufRenderer *pr = data;
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 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
2690 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2691
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2692 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
2693 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2694 gint x, y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2695
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2696 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
2697
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2698 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
2699 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
2700
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2701 pr_queue(pr, x, y,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2702 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
2703 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
2704 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
2705 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2706
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2707 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2708 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2709 * scrolling
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2710 *-------------------------------------------------------------------
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 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
2714 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2715 gint old_x, old_y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2716 gint x_off, y_off;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2717 gint w, h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2718
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2719 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
2720
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2721 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
2722
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2723 old_x = pr->x_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2724 old_y = pr->y_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2725
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2726 pr->x_scroll += x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2727 pr->y_scroll += y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2728
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2729 pr_scroll_clamp(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2730 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
2731
29
8a8ec4b3e769 Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents: 27
diff changeset
2732 pr_scroll_notify_signal(pr);
8a8ec4b3e769 Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents: 27
diff changeset
2733
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2734 if (pr->overlay_list)
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 gint new_x, new_y;
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 new_x = pr->x_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2739 new_y = pr->y_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2740 pr->x_scroll = old_x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2741 pr->y_scroll = old_y;
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 pr_overlay_queue_all(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2744
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2745 pr->x_scroll = new_x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2746 pr->y_scroll = new_y;
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 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
2750 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
2751
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2752 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
2753 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
2754
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2755 if (w < 1 || h < 1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2756 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2757 /* scrolled completely to new material */
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
2758 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
2759 return;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2760 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2761 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2762 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2763 gint x1, y1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2764 gint x2, y2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2765 GtkWidget *box;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2766 GdkGC *gc;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2767
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2768 if (x_off < 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2769 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2770 x1 = abs(x_off);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2771 x2 = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2772 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2773 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2774 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2775 x1 = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2776 x2 = abs(x_off);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2777 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2778
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2779 if (y_off < 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2780 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2781 y1 = abs(y_off);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2782 y2 = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2783 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2784 else
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2785 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2786 y1 = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2787 y2 = abs(y_off);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2788 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2789
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2790 box = GTK_WIDGET(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2791
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2792 gc = gdk_gc_new(box->window);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2793 gdk_gc_set_exposures(gc, TRUE);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2794 gdk_draw_drawable(box->window, gc,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2795 box->window,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2796 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
2797 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
2798 g_object_unref(gc);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2799
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2800 if (pr->overlay_list)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2801 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2802 pr_overlay_queue_all(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2803 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2804
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2805 w = pr->vis_width - w;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2806 h = pr->vis_height - h;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2807
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2808 if (w > 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2809 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2810 pr_queue(pr,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2811 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
2812 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
2813 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2814 if (h > 0)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2815 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2816 /* FIXME, to optimize this, remove overlap */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2817 pr_queue(pr,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2818 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
2819 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
2820 }
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 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2823
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2824 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
2825 gdouble x_align, gdouble y_align)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2826 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2827 gint px, py;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2828 gint ax, ay;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2829
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2830 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
2831 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
2832
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2833 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
2834 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
2835
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2836 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
2837 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
2838
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2839 pixbuf_renderer_scroll(pr, px, py);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2840 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2841
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 * mouse
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2845 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2846 */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2847
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2848 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
2849 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2850 PixbufRenderer *pr;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2851 gint accel;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2852
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2853 pr = PIXBUF_RENDERER(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2854
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2855 if (pr->scroller_id != -1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2856 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2857 pr->scroller_xpos = bevent->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2858 pr->scroller_ypos = bevent->y;
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->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
2862
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2863 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
2864 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2865 pr->drag_moved++;
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 else
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 widget_set_cursor(widget, GDK_FLEUR);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2870 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2871
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2872 if (bevent->state & GDK_SHIFT_MASK)
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 accel = PR_PAN_SHIFT_MULTIPLIER;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2875 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2876 else
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 accel = 1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2879 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2880
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2881 /* do the scroll */
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2882 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
2883 (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
2884
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2885 pr->drag_last_x = bevent->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2886 pr->drag_last_y = bevent->y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2887
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2888 return FALSE;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2891 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
2892 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2893 PixbufRenderer *pr;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2894 GtkWidget *parent;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2895
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2896 pr = PIXBUF_RENDERER(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2897
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2898 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
2899
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2900 switch (bevent->button)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2901 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2902 case 1:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2903 pr->in_drag = TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2904 pr->drag_last_x = bevent->x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2905 pr->drag_last_y = bevent->y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2906 pr->drag_moved = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2907 gdk_pointer_grab(widget->window, FALSE,
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2908 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
2909 NULL, NULL, bevent->time);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2910 gtk_grab_add(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2911 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2912 case 2:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2913 pr->drag_moved = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2914 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2915 case 3:
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2916 pr_clicked_signal(pr, bevent);
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2917 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2918 default:
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2919 break;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2920 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2921
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2922 parent = gtk_widget_get_parent(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2923 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
2924 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2925 gtk_widget_grab_focus(parent);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2926 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2927
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2928 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2929 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2930
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2931 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
2932 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2933 PixbufRenderer *pr;
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 pr = PIXBUF_RENDERER(widget);
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 if (pr->scroller_id != -1)
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 pr_scroller_stop(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2940 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2941 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2942
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2943 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
2944 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2945 gtk_grab_remove(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2946 gdk_pointer_ungrab(bevent->time);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2947 widget_set_cursor(widget, -1);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2950 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
2951 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2952 if (bevent->button == 1 && (bevent->state & GDK_SHIFT_MASK))
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 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
2955 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2956 else if (bevent->button == 1 || bevent->button == 2)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2957 {
25
0c3b353b666e Fri Mar 25 22:39:30 2005 John Ellis <johne@verizon.net>
gqview
parents: 24
diff changeset
2958 pr_clicked_signal(pr, bevent);
23
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 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2961
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2962 pr->in_drag = FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2963
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2964 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2965 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2966
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2967 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
2968 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2969 PixbufRenderer *pr;
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 pr = PIXBUF_RENDERER(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2972
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2973 if (pr->scroller_id != -1)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2974 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2975 pr->scroller_xpos = pr->scroller_x;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2976 pr->scroller_ypos = pr->scroller_y;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2977 pr->scroller_xinc = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2978 pr->scroller_yinc = 0;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2981 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2982 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2983
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2984 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
2985 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2986 PixbufRenderer *pr;
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 pr = PIXBUF_RENDERER(widget);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2989
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2990 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
2991 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2992
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2993 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
2994 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
2995 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
2996 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
2997 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
2998 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
2999 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
3000 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
3001 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
3002 G_CALLBACK(pr_mouse_leave_cb), pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3003
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3004 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
3005 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
3006 GDK_LEAVE_NOTIFY_MASK);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3007
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3008 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
3009 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
3010
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3011 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3012
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3013 /*
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3014 *-------------------------------------------------------------------
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3015 * public
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 */
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 static void pr_pixbuf_sync(PixbufRenderer *pr, gdouble zoom, gint blank, gint new)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3020 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3021 if (!pr->pixbuf)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3022 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3023 GtkWidget *box;
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 /* 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
3026 pr->image_width = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3027 pr->image_height = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3028 pr->scale = 1.0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3029
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3030 box = GTK_WIDGET(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3031
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3032 if (GTK_WIDGET_REALIZED(box))
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3033 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3034 gdk_window_clear(box->window);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3035 pr_overlay_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
3036 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3037
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3038 pr_update_signal(pr);
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 return;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3043 pr->image_width = gdk_pixbuf_get_width(pr->pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3044 pr->image_height = gdk_pixbuf_get_height(pr->pixbuf);
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 pr_zoom_sync(pr, zoom, TRUE, blank, new, FALSE, 0, 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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3049 static void pr_set_pixbuf(PixbufRenderer *pr, GdkPixbuf *pixbuf, gdouble zoom, gint new)
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 (pixbuf) g_object_ref(pixbuf);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3052 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
3053 pr->pixbuf = pixbuf;
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 pr_pixbuf_sync(pr, zoom, FALSE, new);
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3058 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
3059 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3060 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
3061
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3062 pr_source_tile_unset(pr);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3063
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3064 pr_set_pixbuf(pr, pixbuf, zoom, TRUE);
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 pr_update_signal(pr);
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 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
3070 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3071 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
3072
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3073 return pr->pixbuf;
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
24
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3076 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
3077 {
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3078 GObject *object;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3079 PixbufRendererScrollResetType scroll_reset;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3080
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3081 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
3082 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
3083
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3084 if (pr == source) return;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3085
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3086 object = G_OBJECT(pr);
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3087
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3088 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
3089 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
3090 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
3091
42
606fcf461a68 Sat May 14 13:04:23 2005 John Ellis <johne@verizon.net>
gqview
parents: 38
diff changeset
3092 pr->complete = source->complete;
606fcf461a68 Sat May 14 13:04:23 2005 John Ellis <johne@verizon.net>
gqview
parents: 38
diff changeset
3093
24
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3094 pr->x_scroll = source->x_scroll;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3095 pr->y_scroll = source->y_scroll;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3096
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3097 scroll_reset = pr->scroll_reset;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3098 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
3099
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3100 if (source->source_tiles_enabled)
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3101 {
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3102 pr_source_tile_unset(pr);
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3103
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3104 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
3105 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
3106 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
3107 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
3108 pr->image_width = source->image_width;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3109 pr->image_height = source->image_height;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3110
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3111 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
3112 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
3113 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
3114
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3115 pr->source_tiles = source->source_tiles;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3116 source->source_tiles = NULL;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3117
29
8a8ec4b3e769 Sun Apr 3 00:36:22 2005 John Ellis <johne@verizon.net>
gqview
parents: 27
diff changeset
3118 pr_zoom_sync(pr, source->zoom, TRUE, FALSE, TRUE, FALSE, 0, 0);
24
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3119 pr_redraw(pr, TRUE);
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3120 }
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3121 else
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3122 {
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3123 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
3124 }
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3125
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3126 pr->scroll_reset = scroll_reset;
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3127
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3128 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
3129 pr_queue_clear(source);
36
9b01fe7e84d5 Tue Apr 12 07:59:20 2005 John Ellis <johne@verizon.net>
gqview
parents: 34
diff changeset
3130 pr_tile_free_all(source);
24
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3131 }
104e34f9ab1f Wed Mar 23 00:22:28 2005 John Ellis <johne@verizon.net>
gqview
parents: 23
diff changeset
3132
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3133 void pixbuf_renderer_area_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
3134 {
26
acd9885ebd78 Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents: 25
diff changeset
3135 gint x1, y1, x2, y2;
23
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3136
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3137 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
3138
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3139 if (pr->source_tiles_enabled)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3140 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3141 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
3142 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3143
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3144 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
3145 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3146 /* 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
3147 y -= 1;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3148 height += 2;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3149 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3150
26
acd9885ebd78 Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents: 25
diff changeset
3151 x1 = (gint)floor((double)x * pr->scale);
acd9885ebd78 Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents: 25
diff changeset
3152 y1 = (gint)floor((double)y * pr->scale);
acd9885ebd78 Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents: 25
diff changeset
3153 x2 = (gint)ceil((double)(x + width) * pr->scale);
acd9885ebd78 Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents: 25
diff changeset
3154 y2 = (gint)ceil((double)(y + height) * pr->scale);
acd9885ebd78 Mon Mar 28 20:23:34 2005 John Ellis <johne@verizon.net>
gqview
parents: 25
diff changeset
3155
31
c42544f31030 Tue Apr 5 05:09:29 2005 John Ellis <johne@verizon.net>
gqview
parents: 29
diff changeset
3156 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
3157 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3158
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3159 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
3160 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3161 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
3162
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3163 pr_zoom_adjust_real(pr, increment, FALSE, 0, 0);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3164 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3165
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3166 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
3167 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3168 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
3169
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3170 pr_zoom_adjust_real(pr, increment, TRUE, x, y);
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3171 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3172
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3173 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
3174 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3175 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
3176
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3177 pr_zoom_sync(pr, zoom, FALSE, FALSE, FALSE, FALSE, 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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3180 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
3181 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3182 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
3183
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3184 return pr->zoom;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3185 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3186
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3187 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
3188 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3189 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
3190
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3191 return pr->scale;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3192 }
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 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
3195 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3196 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
3197
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3198 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
3199 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
3200 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
3201
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3202 if (pr->zoom_min != min)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3203 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3204 pr->zoom_min = min;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3205 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
3206 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3207 if (pr->zoom_max != max)
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3208 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3209 pr->zoom_max = max;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3210 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
3211 }
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3214 gint pixbuf_renderer_get_image_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
3215 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3216 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
3217 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
3218
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3219 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
3220 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3221 *width = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3222 *height = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3223 return FALSE;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3226 *width = pr->image_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3227 *height = pr->image_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3228 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3229 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3230
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3231 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
3232 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3233 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
3234 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
3235
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3236 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
3237 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3238 *width = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3239 *height = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3240 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3241 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3242
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3243 *width = pr->width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3244 *height = pr->height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3245 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3246 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3247
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3248 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
3249 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3250 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
3251 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
3252
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3253 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
3254 !pr->scale)
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 rect->x = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3257 rect->y = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3258 rect->width = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3259 rect->height = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3260 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3261 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3262
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3263 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
3264 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
3265 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
3266 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
3267 return TRUE;
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
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3270 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
3271 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3272 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
3273 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
3274
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3275 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
3276 {
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3277 rect->x = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3278 rect->y = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3279 rect->width = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3280 rect->height = 0;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3281 return FALSE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3282 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3283
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3284 rect->x = pr->x_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3285 rect->y = pr->y_scroll;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3286 rect->width = pr->vis_width;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3287 rect->height = pr->vis_height;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3288 return TRUE;
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3289 }
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3290
17acca639a86 ##### Note: GQview CVS on sourceforge is not always up to date, please use #####
gqview
parents:
diff changeset
3291