#include <config.h>
#include "ev-render-context.h"
Go to the source code of this file.
|
#define | FLIP_DIMENSIONS(rc) ((rc)->rotation == 90 || (rc)->rotation == 270) |
|
|
static void | ev_render_context_init (EvRenderContext *rc) |
|
static void | ev_render_context_class_init (EvRenderContextClass *class) |
|
| G_DEFINE_TYPE (EvRenderContext, ev_render_context, G_TYPE_OBJECT) |
|
static void | ev_render_context_dispose (GObject *object) |
|
EvRenderContext * | ev_render_context_new (EvPage *page, gint rotation, gdouble scale) |
|
void | ev_render_context_set_page (EvRenderContext *rc, EvPage *page) |
|
void | ev_render_context_set_rotation (EvRenderContext *rc, int rotation) |
|
void | ev_render_context_set_scale (EvRenderContext *rc, gdouble scale) |
|
void | ev_render_context_set_target_size (EvRenderContext *rc, int target_width, int target_height) |
|
void | ev_render_context_compute_scaled_size (EvRenderContext *rc, double width_points, double height_points, int *scaled_width, int *scaled_height) |
|
void | ev_render_context_compute_transformed_size (EvRenderContext *rc, double width_points, double height_points, int *transformed_width, int *transformed_height) |
|
void | ev_render_context_compute_scales (EvRenderContext *rc, double width_points, double height_points, double *scale_x, double *scale_y) |
|
#define FLIP_DIMENSIONS |
( |
|
rc) | |
((rc)->rotation == 90 || (rc)->rotation == 270) |
void ev_render_context_compute_scaled_size |
( |
EvRenderContext * |
rc, |
|
|
double |
width_points, |
|
|
double |
height_points, |
|
|
int * |
scaled_width, |
|
|
int * |
scaled_height |
|
) |
| |
Definition at line 117 of file ev-render-context.c.
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);
void ev_render_context_compute_scales |
( |
EvRenderContext * |
rc, |
|
|
double |
width_points, |
|
|
double |
height_points, |
|
|
double * |
scale_x, |
|
|
double * |
scale_y |
|
) |
| |
Definition at line 164 of file ev-render-context.c.
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;
void ev_render_context_compute_transformed_size |
( |
EvRenderContext * |
rc, |
|
|
double |
width_points, |
|
|
double |
height_points, |
|
|
int * |
transformed_width, |
|
|
int * |
transformed_height |
|
) |
| |
Definition at line 143 of file ev-render-context.c.
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;
static void ev_render_context_dispose |
( |
GObject * |
object) | |
|
|
static |
Definition at line 33 of file ev-render-context.c.
40 g_object_unref (rc->page);
44 (* G_OBJECT_CLASS (ev_render_context_parent_class)->dispose) (
object);
Definition at line 58 of file ev-render-context.c.
66 rc->page = page ? g_object_ref (page) : NULL;
67 rc->rotation = rotation;
69 rc->target_width = -1;
70 rc->target_height = -1;
Definition at line 76 of file ev-render-context.c.
79 g_return_if_fail (rc != NULL);
83 g_object_unref (rc->page);
84 rc->page = g_object_ref (page);
Definition at line 88 of file ev-render-context.c.
91 g_return_if_fail (rc != NULL);
93 rc->rotation = rotation;
void ev_render_context_set_target_size |
( |
EvRenderContext * |
rc, |
|
|
int |
target_width, |
|
|
int |
target_height |
|
) |
| |
Definition at line 106 of file ev-render-context.c.
110 g_return_if_fail (rc != NULL);
112 rc->target_width = target_width;
113 rc->target_height = target_height;