Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ev-render-context.h File Reference
#include <glib-object.h>
#include "ev-page.h"
+ Include dependency graph for ev-render-context.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _EvRenderContextClass
 
struct  _EvRenderContext
 

Macros

#define EV_TYPE_RENDER_CONTEXT   (ev_render_context_get_type())
 
#define EV_RENDER_CONTEXT(object)   (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_RENDER_CONTEXT, EvRenderContext))
 
#define EV_RENDER_CONTEXT_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_RENDER_CONTEXT, EvRenderContextClass))
 
#define EV_IS_RENDER_CONTEXT(object)   (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_RENDER_CONTEXT))
 

Typedefs

typedef typedefG_BEGIN_DECLS
struct _EvRenderContext 
EvRenderContext
 
typedef struct
_EvRenderContextClass 
EvRenderContextClass
 

Functions

GType ev_render_context_get_type (void) G_GNUC_CONST
 
EvRenderContextev_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, gint 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)
 

Macro Definition Documentation

#define EV_IS_RENDER_CONTEXT (   object)    (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_RENDER_CONTEXT))

Definition at line 39 of file ev-render-context.h.

#define EV_RENDER_CONTEXT (   object)    (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_RENDER_CONTEXT, EvRenderContext))

Definition at line 37 of file ev-render-context.h.

#define EV_RENDER_CONTEXT_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_RENDER_CONTEXT, EvRenderContextClass))

Definition at line 38 of file ev-render-context.h.

#define EV_TYPE_RENDER_CONTEXT   (ev_render_context_get_type())

Definition at line 36 of file ev-render-context.h.

Typedef Documentation

typedef typedefG_BEGIN_DECLS struct _EvRenderContext EvRenderContext

Definition at line 33 of file ev-render-context.h.

Definition at line 34 of file ev-render-context.h.

Function Documentation

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.

122 {
123  g_return_if_fail (rc != NULL);
124 
125  if (scaled_width) {
126  if (rc->target_width >= 0) {
127  *scaled_width = FLIP_DIMENSIONS (rc) ? rc->target_height : rc->target_width;
128  } else {
129  *scaled_width = (int) (width_points * rc->scale + 0.5);
130  }
131  }
132 
133  if (scaled_height) {
134  if (rc->target_height >= 0) {
135  *scaled_height = FLIP_DIMENSIONS (rc) ? rc->target_width : rc->target_height;
136  } else {
137  *scaled_height = (int) (height_points * rc->scale + 0.5);
138  }
139  }
140 }

+ Here is the caller graph for this function:

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.

169 {
170  int scaled_width, scaled_height;
171 
172  g_return_if_fail (rc != NULL);
173 
174  ev_render_context_compute_scaled_size (rc, width_points, height_points,
175  &scaled_width, &scaled_height);
176 
177  if (scale_x)
178  *scale_x = scaled_width / width_points;
179 
180  if (scale_y)
181  *scale_y = scaled_height / height_points;
182 }

+ Here is the caller graph for this function:

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.

148 {
149  int scaled_width, scaled_height;
150 
151  g_return_if_fail (rc != NULL);
152 
153  ev_render_context_compute_scaled_size (rc, width_points, height_points,
154  &scaled_width, &scaled_height);
155 
156  if (transformed_width)
157  *transformed_width = FLIP_DIMENSIONS (rc) ? scaled_height : scaled_width;
158 
159  if (transformed_height)
160  *transformed_height = FLIP_DIMENSIONS (rc) ? scaled_width : scaled_height;
161 }

+ Here is the caller graph for this function:

GType ev_render_context_get_type ( void  )
EvRenderContext* ev_render_context_new ( EvPage page,
gint  rotation,
gdouble  scale 
)

Definition at line 58 of file ev-render-context.c.

61 {
62  EvRenderContext *rc;
63 
64  rc = (EvRenderContext *) g_object_new (EV_TYPE_RENDER_CONTEXT, NULL);
65 
66  rc->page = page ? g_object_ref (page) : NULL;
67  rc->rotation = rotation;
68  rc->scale = scale;
69  rc->target_width = -1;
70  rc->target_height = -1;
71 
72  return rc;
73 }

+ Here is the caller graph for this function:

void ev_render_context_set_page ( EvRenderContext rc,
EvPage page 
)

Definition at line 76 of file ev-render-context.c.

78 {
79  g_return_if_fail (rc != NULL);
80  g_return_if_fail (EV_IS_PAGE (page));
81 
82  if (rc->page)
83  g_object_unref (rc->page);
84  rc->page = g_object_ref (page);
85 }

+ Here is the caller graph for this function:

void ev_render_context_set_rotation ( EvRenderContext rc,
gint  rotation 
)
void ev_render_context_set_scale ( EvRenderContext rc,
gdouble  scale 
)

Definition at line 97 of file ev-render-context.c.

99 {
100  g_return_if_fail (rc != NULL);
101 
102  rc->scale = scale;
103 }
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.

109 {
110  g_return_if_fail (rc != NULL);
111 
112  rc->target_width = target_width;
113  rc->target_height = target_height;
114 }

+ Here is the caller graph for this function: