Gly.Loader
Description: Reference for Gly.Loader

### Class

# GlyLoader

since: 2.0

#### Description [src]

    final class Gly.Loader : GObject.Object
    {
      /* No available fields */
    }

`GlyLoader` prepares loading an image.

The following example shows how to obtain a `Gdk.Texture`. It uses GlyGtk4 for this.

    #include <glycin-gtk4.h>

    file = g_file_new_for_path ("test.png");
    loader = gly_loader_new (file);
    image = gly_loader_load (loader, NULL);
    if (image)
      {
        frame = gly_image_next_frame (image, NULL);
        if (frame)
          {
            texture = gly_gtk_frame_get_texture (frame);
            g_print ("Image height: %d\n", gdk_texture_get_height (texture));
            image_widget = gtk_image_new_from_paintable (GDK_PAINTABLE (texture));
          }
      }

Available since: 2.0

#### Ancestors

- GObject

#### Constructors

###### gly_loader_new

Creates a new loader for a file.

since: 2.0

###### gly_loader_new_for_bytes

Creates a new loader for bytes.

since: 2.0

###### gly_loader_new_for_stream

Creates a new loader for a stream.

since: 2.0

#### Functions

###### gly_loader_get_mime_types

Returns a list of MIME types currently supported for loading images.

since: 2.0

###### gly_loader_get_mime_types_async

Async variant of `gly_loader_get_mime_types()`.

since: 2.0

###### gly_loader_get_mime_types_finish

Finishes the `gly_loader_get_mime_types_async()` call.

since: 2.0

#### Instance methods

###### gly_loader_load

Synchronously loads an image and returns an `GlyImage` when successful.

since: 2.0

###### gly_loader_load_async

Asynchronous version of `gly_loader_load()`.

since: 2.0

###### gly_loader_load_finish

Finishes the `gly_loader_load_async()` call.

since: 2.0

###### gly_loader_set_accepted_memory_formats

Sets which memory formats can be returned by the loader.

since: 2.0

###### gly_loader_set_apply_transformations

Set whether to apply transformations to texture.

since: 2.0

###### gly_loader_set_sandbox_selector

Selects which sandbox mechanism should be used. The default without calling this function is `GlySandboxSelector``.AUTO`.

since: 2.0

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Gly.Loader:apply-transformation

No description available.

###### Gly.Loader:bytes

No description available.

###### Gly.Loader:cancellable

No description available.

###### Gly.Loader:file

No description available.

###### Gly.Loader:memory-format-selection

No description available.

###### Gly.Loader:sandbox-selector

No description available.

###### Gly.Loader:stream

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GlyLoaderClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.