VisualProtocol

public protocol VisualProtocol : ObjectProtocol

The VisualProtocol protocol exposes the methods and properties of an underlying GdkVisual instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Visual. Alternatively, use VisualRef as a lighweight, unowned reference if you already have an instance you just want to use.

A GdkVisual contains information about a particular visual.

  • ptr

    Untyped pointer to the underlying GdkVisual instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • visual_ptr Default implementation

    Typed pointer to the underlying GdkVisual instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GdkVisual instance.

    Declaration

    Swift

    var visual_ptr: UnsafeMutablePointer<GdkVisual>! { get }
  • Required Initialiser for types conforming to VisualProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Visual Class: VisualProtocol extension (methods and fields)

  • getBitsPerRgb() Extension method

    Returns the number of significant bits per red, green and blue value.

    Not all GDK backend provide a meaningful value for this function.

    get_bits_per_rgb is deprecated: Use gdk_visual_get_red_pixel_details() and its variants to learn about the pixel layout of TrueColor and DirectColor visuals

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getBitsPerRgb() -> Int
  • Obtains values that are needed to calculate blue pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the “mask”). Finally, “precision” refers to how much precision the pixel value contains for a particular primary.

    Declaration

    Swift

    @inlinable
    func getBluePixelDetails(mask: UnsafeMutablePointer<guint32>! = nil, shift: UnsafeMutablePointer<gint>! = nil, precision: UnsafeMutablePointer<gint>! = nil)
  • getByteOrder() Extension method

    Returns the byte order of this visual.

    The information returned by this function is only relevant when working with XImages, and not all backends return meaningful information for this.

    get_byte_order is deprecated: This information is not useful

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getByteOrder() -> GdkByteOrder
  • getColormapSize() Extension method

    Returns the size of a colormap for this visual.

    You have to use platform-specific APIs to manipulate colormaps.

    get_colormap_size is deprecated: This information is not useful, since GDK does not provide APIs to operate on colormaps.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getColormapSize() -> Int
  • getDepth() Extension method

    Returns the bit depth of this visual.

    Declaration

    Swift

    @inlinable
    func getDepth() -> Int
  • Obtains values that are needed to calculate green pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the “mask”). Finally, “precision” refers to how much precision the pixel value contains for a particular primary.

    Declaration

    Swift

    @inlinable
    func getGreenPixelDetails(mask: UnsafeMutablePointer<guint32>! = nil, shift: UnsafeMutablePointer<gint>! = nil, precision: UnsafeMutablePointer<gint>! = nil)
  • Obtains values that are needed to calculate red pixel values in TrueColor and DirectColor. The “mask” is the significant bits within the pixel. The “shift” is the number of bits left we must shift a primary for it to be in position (according to the “mask”). Finally, “precision” refers to how much precision the pixel value contains for a particular primary.

    Declaration

    Swift

    @inlinable
    func getRedPixelDetails(mask: UnsafeMutablePointer<guint32>! = nil, shift: UnsafeMutablePointer<gint>! = nil, precision: UnsafeMutablePointer<gint>! = nil)
  • getScreen() Extension method

    Gets the screen to which this visual belongs

    Declaration

    Swift

    @inlinable
    func getScreen() -> ScreenRef!
  • getVisualType() Extension method

    Returns the type of visual this is (PseudoColor, TrueColor, etc).

    Declaration

    Swift

    @inlinable
    func getVisualType() -> GdkVisualType
  • bitsPerRgb Extension method

    Returns the number of significant bits per red, green and blue value.

    Not all GDK backend provide a meaningful value for this function.

    get_bits_per_rgb is deprecated: Use gdk_visual_get_red_pixel_details() and its variants to learn about the pixel layout of TrueColor and DirectColor visuals

    Declaration

    Swift

    @inlinable
    var bitsPerRgb: Int { get }
  • byteOrder Extension method

    Returns the byte order of this visual.

    The information returned by this function is only relevant when working with XImages, and not all backends return meaningful information for this.

    get_byte_order is deprecated: This information is not useful

    Declaration

    Swift

    @inlinable
    var byteOrder: GdkByteOrder { get }
  • colormapSize Extension method

    Returns the size of a colormap for this visual.

    You have to use platform-specific APIs to manipulate colormaps.

    get_colormap_size is deprecated: This information is not useful, since GDK does not provide APIs to operate on colormaps.

    Declaration

    Swift

    @inlinable
    var colormapSize: Int { get }
  • depth Extension method

    Returns the bit depth of this visual.

    Declaration

    Swift

    @inlinable
    var depth: Int { get }
  • screen Extension method

    Gets the screen to which this visual belongs

    Declaration

    Swift

    @inlinable
    var screen: ScreenRef! { get }
  • visualType Extension method

    Returns the type of visual this is (PseudoColor, TrueColor, etc).

    Declaration

    Swift

    @inlinable
    var visualType: GdkVisualType { get }