Struct show_image::WindowHandle[][src]

pub struct WindowHandle<'a> { /* fields omitted */ }
Expand description

Handle to a window.

A WindowHandle can be used to interact with a window from within the global context thread. To interact with a window from another thread, you need a WindowProxy.

Implementations

Create a new window handle from a context handle and a window ID.

Get the window ID.

Get a proxy object for the window to interact with it from a different thread.

You should not use proxy objects from withing the global context thread. The proxy objects often wait for the global context to perform some action. Doing so from within the global context thread would cause a deadlock.

Release the window handle to get a ContextHandle.

This can be used inside a window event handler to gain access to the ContextHandle. If you do not need mutable access to the context, you can also use context_handle().

Get a reference to the context handle.

If you need mutable access to the context, use release() instead.

Destroy the window.

Any subsequent operation on the window through an existing WindowProxy will return InvalidWindowId.

Get the image info.

Returns None if no image is set for the window.

Check if the window will preserve the aspect ratio of images it displays.

Set if the window will preserve the aspect ratio of images it displays.

Get the background color of the window.

Set the background color of the window.

Make the window visible or invisible.

Get the inner size of the window in physical pixels.

This returns the size of the window contents, excluding borders, the title bar and other decorations.

Get the outer size of the window in physical pixels.

This returns the size of the entire window, including borders, the title bar and other decorations.

Set the inner size of the window in pixels.

The size is excluding borders, the title bar and other decorations.

Some window managers may ignore this property.

Set if the window should be resizable for the user.

Some window managers may ignore this property.

Set if the window should be drawn without borders.

Some window managers may ignore this property.

Check if the window is currently showing overlays.

Enable or disable the overlays for this window.

Set the image to display on the window.

Add an overlay to the window.

Overlays are drawn on top of the image. Overlays remain active until you call they are cleared.

Clear the overlays of the window.

Add an event handler to the window.

Get the image transformation.

The image transformation is applied to the image and all overlays in virtual window space.

Virtual window space goes from (0, 0) in the top left corner of the window to (1, 1) in the bottom right corner.

This transformation does not include scaling introduced by the Self::preserve_aspect_ratio() property. Use Self::effective_transform() if you need that.

Get the full effective transformation from image space to virtual window space.

This transformation maps the image coordinates to virtual window coordinates. Unlike Self::transform(), this function returns a transformation that include the scaling introduced by the Self::preserve_aspect_ratio() property. This is useful to transform between window coordinates and image coordinates.

If no image is set on the window yet, this returns the same transformation as Self::transform().

Virtual window space goes from (0, 0) in the top left corner of the window to (1, 1) in the bottom right corner.

Note that physical pixel locations must be transformed to virtual window coordinates first.

Set the image transformation to a value.

The image transformation is applied to the image and all overlays in virtual window space.

Virtual window space goes from (0, 0) in the top left corner of the window to (1, 1) in the bottom right corner.

This transformation should not include any scaling related to the Self::preserve_aspect_ratio() property.

Pre-apply a transformation to the existing image transformation.

This is equivalent to:

window.set_transform(transform * window.transform())

See Self::set_transform for more information about the image transformation.

Post-apply a transformation to the existing image transformation.

This is equivalent to:

window.set_transform(window.transform() * transform)

See Self::set_transform for more information about the image transformation.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.