EomPrintPreview

EomPrintPreview

Synopsis

struct              EomPrintPreview;
GtkWidget *         eom_print_preview_new               (void);
GtkWidget *         eom_print_preview_new_with_pixbuf   (GdkPixbuf *pixbuf);
void                eom_print_preview_set_page_margins  (EomPrintPreview *preview,
                                                         gfloat l_margin,
                                                         gfloat r_margin,
                                                         gfloat t_margin,
                                                         gfloat b_margin);
void                eom_print_preview_set_from_page_setup
                                                        (EomPrintPreview *preview,
                                                         GtkPageSetup *setup);
void                eom_print_preview_get_image_position
                                                        (EomPrintPreview *preview,
                                                         gdouble *x,
                                                         gdouble *y);
void                eom_print_preview_set_image_position
                                                        (EomPrintPreview *preview,
                                                         gdouble x,
                                                         gdouble y);
void                eom_print_preview_set_scale         (EomPrintPreview *preview,
                                                         gfloat scale);

Description

Details

struct EomPrintPreview

struct EomPrintPreview {
	GtkAspectFrame aspect_frame;

	EomPrintPreviewPrivate *priv;
};


eom_print_preview_new ()

GtkWidget *         eom_print_preview_new               (void);

Creates a new EomPrintPreview widget, setting it to the default values, and leaving the page empty. You still need to set the "image" property to make it useful.

Returns :

A new and empty EomPrintPreview widget.

eom_print_preview_new_with_pixbuf ()

GtkWidget *         eom_print_preview_new_with_pixbuf   (GdkPixbuf *pixbuf);

Creates a new EomPrintPreview widget, and sets the GdkPixbuf to preview on it.

pixbuf :

a GdkPixbuf

Returns :

A new EomPrintPreview widget.

eom_print_preview_set_page_margins ()

void                eom_print_preview_set_page_margins  (EomPrintPreview *preview,
                                                         gfloat l_margin,
                                                         gfloat r_margin,
                                                         gfloat t_margin,
                                                         gfloat b_margin);

Manually set the margins, in inches.

preview :

a EomPrintPreview

l_margin :

Left margin.

r_margin :

Right margin.

t_margin :

Top margin.

b_margin :

Bottom margin.

eom_print_preview_set_from_page_setup ()

void                eom_print_preview_set_from_page_setup
                                                        (EomPrintPreview *preview,
                                                         GtkPageSetup *setup);

Sets up the page properties from a GtkPageSetup. Useful when using the widget with the GtkPrint API.

preview :

a EomPrintPreview

setup :

a GtkPageSetup to set the properties from

eom_print_preview_get_image_position ()

void                eom_print_preview_get_image_position
                                                        (EomPrintPreview *preview,
                                                         gdouble *x,
                                                         gdouble *y);

Gets current image position in inches, relative to the margins. A (0, 0) position is the intersection between the left and top margins.

preview :

a EomPrintPreview

x :

a pointer to a gdouble, or NULL to ignore it

y :

a pointer to a gdouble, or NULL to ignore it

eom_print_preview_set_image_position ()

void                eom_print_preview_set_image_position
                                                        (EomPrintPreview *preview,
                                                         gdouble x,
                                                         gdouble y);

Sets the image position. You can pass -1 to one of the coordinates if you only want to set the other.

preview :

a EomPrintPreview

x :

The X coordinate, in inches, or -1 to ignore it.

y :

The Y coordinate, in inches, or -1 to ignore it.

eom_print_preview_set_scale ()

void                eom_print_preview_set_scale         (EomPrintPreview *preview,
                                                         gfloat scale);

Sets the scale for the image.

preview :

a EomPrintPreview

scale :

a scale value, between 0 and 1.