## GwyPixmapLayer

GwyPixmapLayer — Base class for GwyDataView pixmap layers

## Synopsis

    #include <libgwydgets/gwydgets.h>

                        GwyPixmapLayer;
                        GwyPixmapLayerClass;
    gboolean            gwy_pixmap_layer_wants_repaint      (GwyPixmapLayer *pixmap_layer);
    GdkPixbuf*          gwy_pixmap_layer_paint              (GwyPixmapLayer *pixmap_layer);
    void                gwy_pixmap_layer_set_data_key       (GwyPixmapLayer *pixmap_layer,
                                                             const gchar *key);
    const gchar*        gwy_pixmap_layer_get_data_key       (GwyPixmapLayer *pixmap_layer);
    void                gwy_pixmap_layer_make_pixbuf        (GwyPixmapLayer *pixmap_layer,
                                                             gboolean has_alpha);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GwyDataViewLayer
                         +----GwyPixmapLayer
                               +----GwyLayerBasic
                               +----GwyLayerMask

## Properties

      "data-key"                 gchar*                : Read / Write

## Description

GwyPixmapLayer is a base class for data field displaying GwyDataViewLayer's. It is a GwyDataView component and it is not normally usable outside of it.

The layer takes the data field to display from its parent GwyDataView. The key under which the data field is found must be set with `gwy_pixmap_layer_set_data_key()`.

The other methods are only rarely needed outside GwyDataView implementation.

## Details

### GwyPixmapLayer

    typedef struct _GwyPixmapLayer GwyPixmapLayer;

### GwyPixmapLayerClass

    typedef struct {
        GwyDataViewLayerClass parent_class;

        GdkPixbuf* (*paint)(GwyPixmapLayer *layer);

        void (*reserved1)(void);
        void (*reserved2)(void);
    } GwyPixmapLayerClass;

### gwy_pixmap_layer_wants_repaint ()

    gboolean            gwy_pixmap_layer_wants_repaint      (GwyPixmapLayer *pixmap_layer);

Checks whether a pixmap layer wants repaint.

`pixmap_layer` : | A pixmap data view layer.
Returns : | `TRUE` if the the layer wants repaint itself, `FALSE` otherwise.

### gwy_pixmap_layer_paint ()

    GdkPixbuf*          gwy_pixmap_layer_paint              (GwyPixmapLayer *pixmap_layer);

Returns a pixbuf with painted pixmap layer.

This method does not enforce repaint. If the layer doesn't think it needs to repaint the pixbuf, it simply returns the current one. To enforce update, emit "data-changed" signal on corresponding data field.

`pixmap_layer` : | A pixmap data view layer.
Returns : | The pixbuf. It should not be modified or freed. If the data field to draw is not present in the container, `NULL` is returned.

### gwy_pixmap_layer_set_data_key ()

    void                gwy_pixmap_layer_set_data_key       (GwyPixmapLayer *pixmap_layer,
                                                             const gchar *key);

Sets the data field to display by a pixmap layer.

`pixmap_layer` : | A pixmap layer.
`key` : | Container string key identifying the data field to display.

### gwy_pixmap_layer_get_data_key ()

    const gchar*        gwy_pixmap_layer_get_data_key       (GwyPixmapLayer *pixmap_layer);

Gets the key identifying data field this pixmap layer displays.

`pixmap_layer` : | A pixmap layer.
Returns : | The string key, or `NULL` if it isn't set.

### gwy_pixmap_layer_make_pixbuf ()

    void                gwy_pixmap_layer_make_pixbuf        (GwyPixmapLayer *pixmap_layer,
                                                             gboolean has_alpha);

Creates or resizes pixmap layer GdkPixbuf to match its data field.

This method is intended for pixmap layer implementation.

`pixmap_layer` : | A pixmap layer.
`has_alpha` : | Whether pixbuf should have alpha channel.

## Property Details

### The `"data-key"` property

      "data-key"                 gchar*                : Read / Write

The :data-key property is the container key used to identify displayed GwyDataField in container.

Default value: NULL