class Gtk::PaperSize

Overview

Gtk::PaperSize handles paper sizes.

It uses the standard called PWG 5101.1-2002 PWG: Standard for Media Standardized Names to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, Gtk::PaperSize allows to construct custom paper sizes with arbitrary dimensions.

The Gtk::PaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/paper_size.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

def self.new(name : String?) : self #

def self.new_custom(name : String, display_name : String, width : Float64, height : Float64, unit : Gtk::Unit) : self #

def self.new_from_gvariant(variant : _) : self #

def self.new_from_ipp(ipp_name : String, width : Float64, height : Float64) : self #

def self.new_from_key_file(key_file : GLib::KeyFile, group_name : String?) : self #

def self.new_from_ppd(ppd_name : String, ppd_display_name : String, width : Float64, height : Float64) : self #

Class Method Detail

def self.default : String #

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


def self.paper_sizes(include_custom : Bool) : GLib::List #

Instance Method Detail

def copy : Gtk::PaperSize #

def default_bottom_margin(unit : Gtk::Unit) : Float64 #

def default_left_margin(unit : Gtk::Unit) : Float64 #

def default_right_margin(unit : Gtk::Unit) : Float64 #

def default_top_margin(unit : Gtk::Unit) : Float64 #

def display_name : String #

def finalize #

def free : Nil #

def height(unit : Gtk::Unit) : Float64 #

def is_custom : Bool #

def is_equal(size2 : Gtk::PaperSize) : Bool #

def is_ipp : Bool #

def name : String #

def ppd_name : String #

def set_size(width : Float64, height : Float64, unit : Gtk::Unit) : Nil #

def to_gvariant : GLib::Variant #

def to_key_file(key_file : GLib::KeyFile, group_name : String) : Nil #

def to_unsafe : Pointer(Void) #

def width(unit : Gtk::Unit) : Float64 #