2000-06-01 05:16:11 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-06-01 05:16:11 +08:00
|
|
|
*
|
|
|
|
* gimppatternselect_pdb.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-06-01 05:16:11 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-06-01 05:16:11 +08:00
|
|
|
*
|
|
|
|
* 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
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2000-06-01 05:16:11 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
2019-07-31 02:52:56 +08:00
|
|
|
* SECTION: gimppatternselect_pdb
|
2010-07-07 17:43:10 +08:00
|
|
|
* @title: gimppatternselect
|
|
|
|
* @short_description: Functions providing a pattern selection dialog.
|
|
|
|
*
|
|
|
|
* Functions providing a pattern selection dialog.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_patterns_popup:
|
|
|
|
* @pattern_callback: The callback PDB proc to call when pattern selection is made.
|
2007-01-09 18:52:47 +08:00
|
|
|
* @popup_title: Title of the pattern selection dialog.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @initial_pattern: The name of the pattern to set as the first selected.
|
|
|
|
*
|
|
|
|
* Invokes the Gimp pattern selection.
|
|
|
|
*
|
2007-01-09 18:52:47 +08:00
|
|
|
* This procedure opens the pattern selection dialog.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_patterns_popup (const gchar *pattern_callback,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *popup_title,
|
|
|
|
const gchar *initial_pattern)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 0), pattern_callback);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), popup_title);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 2), initial_pattern);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
return_vals = gimp_run_procedure_with_array ("gimp-patterns-popup",
|
|
|
|
args);
|
|
|
|
gimp_value_array_unref (args);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_patterns_close_popup:
|
2007-01-09 18:52:47 +08:00
|
|
|
* @pattern_callback: The name of the callback registered for this pop-up.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2007-01-09 18:52:47 +08:00
|
|
|
* Close the pattern selection dialog.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* This procedure closes an opened pattern selection dialog.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_patterns_close_popup (const gchar *pattern_callback)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 0), pattern_callback);
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure_with_array ("gimp-patterns-close-popup",
|
|
|
|
args);
|
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_patterns_set_popup:
|
2007-01-09 18:52:47 +08:00
|
|
|
* @pattern_callback: The name of the callback registered for this pop-up.
|
2000-08-25 07:06:53 +08:00
|
|
|
* @pattern_name: The name of the pattern to set as selected.
|
|
|
|
*
|
2007-01-09 18:52:47 +08:00
|
|
|
* Sets the current pattern in a pattern selection dialog.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
2007-01-09 18:52:47 +08:00
|
|
|
* Sets the current pattern in a pattern selection dialog.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2010-09-16 04:07:36 +08:00
|
|
|
**/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_patterns_set_popup (const gchar *pattern_callback,
|
2006-04-12 18:27:31 +08:00
|
|
|
const gchar *pattern_name)
|
2000-06-01 05:16:11 +08:00
|
|
|
{
|
2019-07-30 16:51:16 +08:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
args = gimp_value_array_new_from_types (G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 0), pattern_callback);
|
|
|
|
g_value_set_string (gimp_value_array_index (args, 1), pattern_name);
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure_with_array ("gimp-patterns-set-popup",
|
|
|
|
args);
|
|
|
|
gimp_value_array_unref (args);
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
success = g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS;
|
2000-08-23 09:44:59 +08:00
|
|
|
|
2019-07-30 16:51:16 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-01 05:16:11 +08:00
|
|
|
}
|