28 #define FLIP_DIMENSIONS(rc) ((rc)->rotation == 90 || (rc)->rotation == 270)
40 g_object_unref (rc->page);
44 (* G_OBJECT_CLASS (ev_render_context_parent_class)->dispose) (
object);
52 oclass = G_OBJECT_CLASS (
class);
66 rc->page = page ? g_object_ref (page) : NULL;
67 rc->rotation = rotation;
69 rc->target_width = -1;
70 rc->target_height = -1;
79 g_return_if_fail (rc != NULL);
83 g_object_unref (rc->page);
84 rc->page = g_object_ref (page);
91 g_return_if_fail (rc != NULL);
93 rc->rotation = rotation;
100 g_return_if_fail (rc != NULL);
110 g_return_if_fail (rc != NULL);
112 rc->target_width = target_width;
113 rc->target_height = target_height;
119 double height_points,
123 g_return_if_fail (rc != NULL);
126 if (rc->target_width >= 0) {
127 *scaled_width =
FLIP_DIMENSIONS (rc) ? rc->target_height : rc->target_width;
129 *scaled_width = (int) (width_points * rc->scale + 0.5);
134 if (rc->target_height >= 0) {
135 *scaled_height =
FLIP_DIMENSIONS (rc) ? rc->target_width : rc->target_height;
137 *scaled_height = (int) (height_points * rc->scale + 0.5);
145 double height_points,
146 int *transformed_width,
147 int *transformed_height)
149 int scaled_width, scaled_height;
151 g_return_if_fail (rc != NULL);
154 &scaled_width, &scaled_height);
156 if (transformed_width)
157 *transformed_width =
FLIP_DIMENSIONS (rc) ? scaled_height : scaled_width;
159 if (transformed_height)
160 *transformed_height =
FLIP_DIMENSIONS (rc) ? scaled_width : scaled_height;
166 double height_points,
170 int scaled_width, scaled_height;
172 g_return_if_fail (rc != NULL);
175 &scaled_width, &scaled_height);
178 *scale_x = scaled_width / width_points;
181 *scale_y = scaled_height / height_points;