gimpdynamics_pdb.c 3.27 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* LIBGIMP - The GIMP Library
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
 *
 * gimpdynamics_pdb.c
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see
18
 * <https://www.gnu.org/licenses/>.
19 20 21 22 23 24 25 26 27 28
 */

/* NOTE: This file is auto-generated by pdbgen.pl */

#include "config.h"

#include "gimp.h"


/**
29
 * SECTION: gimpdynamics
30
 * @title: gimpdynamics
31
 * @short_description: Operations related to paint dynamics.
32
 *
33
 * Operations related to paint dynamics.
34 35 36 37 38 39 40 41 42 43 44 45 46 47
 **/


/**
 * gimp_dynamics_refresh:
 *
 * Refresh current paint dynamics. This function always succeeds.
 *
 * This procedure retrieves all paint dynamics currently in the user's
 * paint dynamics path and updates the paint dynamics dialogs
 * accordingly.
 *
 * Returns: TRUE on success.
 *
48
 * Since: 2.8
49 50 51 52
 **/
gboolean
gimp_dynamics_refresh (void)
{
53 54
  GimpValueArray *args;
  GimpValueArray *return_vals;
55 56
  gboolean success = TRUE;

57 58
  args = gimp_value_array_new_from_types (NULL,
                                          G_TYPE_NONE);
59

60 61 62
  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
                                              "gimp-dynamics-refresh",
                                              args);
63
  gimp_value_array_unref (args);
64

65
  success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
66 67

  gimp_value_array_unref (return_vals);
68 69 70 71 72 73 74

  return success;
}

/**
 * gimp_dynamics_get_list:
 * @filter: An optional regular expression used to filter the list.
75
 * @num_dynamics: (out): The number of available paint dynamics.
76 77 78 79 80 81
 *
 * Retrieve the list of loaded paint dynamics.
 *
 * This procedure returns a list of the paint dynamics that are
 * currently available.
 *
82 83 84
 * Returns: (array length=num_dynamics) (element-type gchar*) (transfer full):
 *          The list of paint dynamics names.
 *          The returned value must be freed with g_strfreev().
85
 *
86
 * Since: 2.8
87 88 89 90 91
 **/
gchar **
gimp_dynamics_get_list (const gchar *filter,
                        gint        *num_dynamics)
{
92 93
  GimpValueArray *args;
  GimpValueArray *return_vals;
94 95
  gchar **dynamics_list = NULL;

96 97
  args = gimp_value_array_new_from_types (NULL,
                                          G_TYPE_STRING, filter,
98 99
                                          G_TYPE_NONE);

100 101 102
  return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
                                              "gimp-dynamics-get-list",
                                              args);
103
  gimp_value_array_unref (args);
104 105 106

  *num_dynamics = 0;

107
  if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
108
    {
109 110
      *num_dynamics = GIMP_VALUES_GET_INT (return_vals, 1);
      dynamics_list = GIMP_VALUES_DUP_STRING_ARRAY (return_vals, 2);
111 112
    }

113
  gimp_value_array_unref (return_vals);
114 115 116

  return dynamics_list;
}