Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GtkPaperSizeCtors

[293:14] static extends: object

Alternate constructors for GtkPaperSize. Usage: GtkPaperSizeCtors.<name>(...). The primary constructor lives directly on GtkPaperSize.

Methods

  • newCustom (string name, string display_name, double width, double height, string unit)

    Creates a new GtkPaperSize object with the given parameters.

    • @p name is the paper name.
    • @p display_name is the human-readable name.
    • @p width is the paper width, in units of @unit.
    • @p height is the paper height, in units of @unit.
    • @p unit is the unit for @width and @height. not %GTK_UNIT_NONE..
    • @r A new GtkPaperSize.
  • newFromGvariant (object variant)

    Deserialize a paper size from a GVariant. The `GVariant must be in the format produced by [method@Gtk.PaperSize.to_gvariant].

    • @p variant is an a{sv} GVariant.
    • @r A new GtkPaperSize.
  • newFromIpp (string ipp_name, double width, double height)

    Creates a new GtkPaperSize object by using IPP information. If

    • @ipp_name is not a recognized paper name, @width and @height are used to construct a custom GtkPaperSize object.
    • @p ipp_name is an IPP paper name.
    • @p width is the paper width, in points.
    • @p height is the paper height in points.
    • @r A new GtkPaperSize.
  • newFromKeyFile (object key_file, string group_name)

    Reads a paper size from the group @group_name in the key file @key_file.

    • @p key_file is the GKeyFile to retrieve the papersize from.
    • @p group_name is the name of the group in the key file to read, or %NULL to read the first group.
    • @r A new GtkPaperSize.
  • newFromPpd (string ppd_name, string ppd_display_name, double width, double height)

    Creates a new GtkPaperSize object by using PPD information. If

    • @ppd_name is not a recognized PPD paper name, @ppd_display_name, @width and @height are used to construct a custom GtkPaperSize object.
    • @p ppd_name is a PPD paper name.
    • @p ppd_display_name is the corresponding human-readable name.
    • @p width is the paper width, in points.
    • @p height is the paper height in points.
    • @r A new GtkPaperSize.

class: GtkPaperSize

[20:7] extends: object

GtkPaperSize 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, GtkPaperSize allows to construct custom paper sizes with arbitrary dimensions. The GtkPaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GtkPaperSize (name = null)

    Creates a new GtkPaperSize object by parsing a PWG 5101.1-2002 paper name. If @name is %NULL, the default paper size is returned, see [func@Gtk.PaperSize.get_default].

    • @p name is a paper size name.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • copy ()

    Copies an existing GtkPaperSize.

    • @r a copy of @other.
  • free ()

    Free the given GtkPaperSize object.

    • @r None.
  • get_default_bottom_margin (string unit)

    Gets the default bottom margin for the GtkPaperSize.

    • @p unit is the unit for the return value, not %GTK_UNIT_NONE.
    • @r the default bottom margin.
  • get_default_left_margin (string unit)

    Gets the default left margin for the GtkPaperSize.

    • @p unit is the unit for the return value, not %GTK_UNIT_NONE.
    • @r the default left margin.
  • get_default_right_margin (string unit)

    Gets the default right margin for the GtkPaperSize.

    • @p unit is the unit for the return value, not %GTK_UNIT_NONE.
    • @r the default right margin.
  • get_default_top_margin (string unit)

    Gets the default top margin for the GtkPaperSize.

    • @p unit is the unit for the return value, not %GTK_UNIT_NONE.
    • @r the default top margin.
  • get_display_name ()

    Gets the human-readable name of the GtkPaperSize.

    • @r the human-readable name of @size.
  • get_height (string unit)

    Gets the paper height of the GtkPaperSize, in units of @unit.

    • @p unit is the unit for the return value, not %GTK_UNIT_NONE.
    • @r the paper height.
  • get_name ()

    Gets the name of the GtkPaperSize.

    • @r the name of @size.
  • get_ppd_name ()

    Gets the PPD name of the GtkPaperSize, which may be %NULL.

    • @r the PPD name of @size.
  • get_width (string unit)

    Gets the paper width of the GtkPaperSize, in units of @unit.

    • @p unit is the unit for the return value, not %GTK_UNIT_NONE.
    • @r the paper width.
  • is_custom ()

    Returns %TRUE if @size is not a standard paper size.

    • @r whether @size is a custom paper size..
  • is_equal (object size2)

    Compares two GtkPaperSize objects.

    • @p size2 is another GtkPaperSize object.
    • @r %TRUE, if @size1 and @size2 represent the same paper size.
  • is_ipp ()

    Returns %TRUE if @size is an IPP standard paper size.

    • @r whether @size is not an IPP custom paper size..
  • set_size (double width, double height, string unit)

    Changes the dimensions of a @size to @width x @height.

    • @p width is the new width in units of @unit.
    • @p height is the new height in units of @unit.
    • @p unit is the unit for @width and @height.
    • @r None.
  • to_gvariant ()

    Serialize a paper size to an a{sv} variant.

    • @r a new, floating, GVariant.
  • to_key_file (object key_file, string group_name)

    This function adds the paper size from @size to @key_file.

    • @p key_file is the GKeyFile to save the paper size to.
    • @p group_name is the group to add the settings to in @key_file.
    • @r None.