GIMP Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# gimppatterns

## Name

gimppatterns --

## Synopsis

    gboolean    gimp_patterns_refresh           (void);
    gchar**     gimp_patterns_get_list          (gint *num_patterns);
    gchar*      gimp_patterns_get_pattern       (gint *width,
                                                 gint *height);
    gboolean    gimp_patterns_set_pattern       (gchar *name);
    gchar*      gimp_patterns_get_pattern_data  (gchar *name,
                                                 gint *width,
                                                 gint *height,
                                                 gint *mask_bpp,
                                                 gint *length,
                                                 guint8 **mask_data);
    gboolean    gimp_patterns_popup             (gchar *pattern_callback,
                                                 gchar *popup_title,
                                                 gchar *initial_pattern);
    gboolean    gimp_patterns_close_popup       (gchar *pattern_callback);
    gboolean    gimp_patterns_set_popup         (gchar *pattern_callback,
                                                 gchar *pattern_name);

## Description

## Details

### gimp_patterns_refresh ()

    gboolean    gimp_patterns_refresh           (void);

Refresh current patterns.

This procedure retrieves all patterns currently in the user's pattern path and updates the pattern dialogs accordingly.

Returns : | TRUE on success.

### gimp_patterns_get_list ()

    gchar**     gimp_patterns_get_list          (gint *num_patterns);

Retrieve a complete listing of the available patterns.

This procedure returns a complete listing of available GIMP patterns. Each name returned can be used as input to the 'gimp_patterns_set_pattern'.

`num_patterns` : | The number of patterns in the pattern list.
Returns : | The list of pattern names.

### gimp_patterns_get_pattern ()

    gchar*      gimp_patterns_get_pattern       (gint *width,
                                                 gint *height);

Retrieve information about the currently active pattern.

This procedure retrieves information about the currently active pattern. This includes the pattern name, and the pattern extents (width and height). All clone and bucket-fill operations with patterns will use this pattern to control the application of paint to the image.

`width` : | The pattern width.
`height` : | The pattern height.
Returns : | The pattern name.

### gimp_patterns_set_pattern ()

    gboolean    gimp_patterns_set_pattern       (gchar *name);

Set the specified pattern as the active pattern.

This procedure allows the active pattern mask to be set by specifying its name. The name is simply a string which corresponds to one of the names of the installed patterns. If there is no matching pattern found, this procedure will return an error. Otherwise, the specified pattern becomes active and will be used in all subsequent paint operations.

`name` : | The pattern name.
Returns : | TRUE on success.

### gimp_patterns_get_pattern_data ()

    gchar*      gimp_patterns_get_pattern_data  (gchar *name,
                                                 gint *width,
                                                 gint *height,
                                                 gint *mask_bpp,
                                                 gint *length,
                                                 guint8 **mask_data);

Retrieve information about the currently active pattern (including data).

This procedure retrieves information about the currently active pattern. This includes the pattern name, and the pattern extents (width and height). It also returns the pattern data.

`name` : | the pattern name (\"\" means currently active pattern).
`width` : | The pattern width.
`height` : | The pattern height.
`mask_bpp` : | Pattern bytes per pixel.
`length` : | Length of pattern mask data.
`mask_data` : | The pattern mask data.
Returns : | The pattern name.

### gimp_patterns_popup ()

    gboolean    gimp_patterns_popup             (gchar *pattern_callback,
                                                 gchar *popup_title,
                                                 gchar *initial_pattern);

Invokes the Gimp pattern selection.

This procedure popups the pattern selection dialog.

`pattern_callback` : | The callback PDB proc to call when pattern selection is made.
`popup_title` : | Title to give the pattern popup window.
`initial_pattern` : | The name of the pattern to set as the first selected.
Returns : | TRUE on success.

### gimp_patterns_close_popup ()

    gboolean    gimp_patterns_close_popup       (gchar *pattern_callback);

Popdown the Gimp pattern selection.

This procedure closes an opened pattern selection dialog.

`pattern_callback` : | The name of the callback registered for this popup.
Returns : | TRUE on success.

### gimp_patterns_set_popup ()

    gboolean    gimp_patterns_set_popup         (gchar *pattern_callback,
                                                 gchar *pattern_name);

Sets the current pattern selection in a popup.

Sets the current pattern selection in a popup.

`pattern_callback` : | The name of the callback registered for this popup.
`pattern_name` : | The name of the pattern to set as selected.
Returns : | TRUE on success.

<<< Previous Page | Home | Up | Next Page >>>
gimppalette | gimppixelrgn