package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Print_context

type t = [ `print_context | `object_ ] Gobject.obj
val set_cairo_context : t -> Ocgtk_cairo.Cairo.Wrappers.Context.t -> float -> float -> unit

Sets a new cairo context on a print context.

This function is intended to be used when implementing an internal print preview, it is not needed for printing, since GTK itself creates a suitable cairo context in that case.

val get_width : t -> float

Obtains the width of the `GtkPrintContext`, in pixels.

val get_pango_fontmap : t -> Ocgtk_pango.Pango.Wrappers.Font_map.t

Returns a `PangoFontMap` that is suitable for use with the `GtkPrintContext`.

val get_page_setup : t -> [ `page_setup | `object_ ] Gobject.obj

Obtains the `GtkPageSetup` that determines the page dimensions of the `GtkPrintContext`.

val get_height : t -> float

Obtains the height of the `GtkPrintContext`, in pixels.

val get_hard_margins : t -> bool * float * float * float * float

Obtains the hardware printer margins of the `GtkPrintContext`, in units.

val get_dpi_y : t -> float

Obtains the vertical resolution of the `GtkPrintContext`, in dots per inch.

val get_dpi_x : t -> float

Obtains the horizontal resolution of the `GtkPrintContext`, in dots per inch.

val get_cairo_context : t -> Ocgtk_cairo.Cairo.Wrappers.Context.t

Obtains the cairo context that is associated with the `GtkPrintContext`.

val create_pango_layout : t -> Ocgtk_pango.Pango.Wrappers.Layout.t

Creates a new `PangoLayout` that is suitable for use with the `GtkPrintContext`.

val create_pango_context : t -> Ocgtk_pango.Pango.Wrappers.Context.t

Creates a new `PangoContext` that can be used with the `GtkPrintContext`.