2004-09-22 15:26:58 +00:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
|
|
|
* gimpcontext_pdb.c
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2004-09-22 15:26:58 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-17 22:28:01 +00:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2004-09-22 15:26:58 +00: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-17 22:28:01 +00:00
|
|
|
* License along with this library. If not, see
|
2018-07-11 23:27:07 +02:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
2004-09-22 15:26:58 +00:00
|
|
|
*/
|
|
|
|
|
2007-01-09 10:52:47 +00:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2004-09-22 15:26:58 +00:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2022-03-28 15:13:17 +02:00
|
|
|
#include "stamp-pdbgen.h"
|
|
|
|
|
2004-09-22 15:26:58 +00:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 11:43:10 +02:00
|
|
|
|
|
|
|
/**
|
2019-07-31 10:04:43 +02:00
|
|
|
* SECTION: gimpcontext
|
2010-07-07 11:43:10 +02:00
|
|
|
* @title: gimpcontext
|
|
|
|
* @short_description: Functions to manipulate a plug-in's context.
|
|
|
|
*
|
|
|
|
* Functions to manipulate a plug-in's context.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2004-09-22 15:26:58 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_push:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Pushes a context onto the top of the plug-in's context stack.
|
2004-09-22 15:26:58 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Creates a new context by copying the current context. The copy
|
|
|
|
* becomes the new current context for the calling plug-in until it is
|
|
|
|
* popped again using gimp_context_pop().
|
2004-09-22 15:26:58 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 15:26:58 +00:00
|
|
|
gboolean
|
|
|
|
gimp_context_push (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 15:26:58 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-push",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 15:26:58 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 15:26:58 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 15:26:58 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_pop:
|
|
|
|
*
|
|
|
|
* Pops the topmost context from the plug-in's context stack.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Removes the topmost context from the plug-in's context stack. The
|
|
|
|
* next context on the stack becomes the new current context of the
|
|
|
|
* plug-in, that is, the context that was active before the
|
|
|
|
* corresponding call to gimp_context_push()
|
2004-09-22 15:26:58 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 15:26:58 +00:00
|
|
|
gboolean
|
|
|
|
gimp_context_pop (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 15:26:58 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2004-09-22 15:26:58 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-pop",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 15:26:58 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-04-07 21:57:22 -04:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_defaults:
|
|
|
|
*
|
|
|
|
* Reset context settings to their default values.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Resets context settings used by various procedures to their default
|
|
|
|
* value. You should usually call this after a context push so that a
|
|
|
|
* script which calls procedures affected by context settings will not
|
|
|
|
* be affected by changes in the global context.
|
2011-04-07 21:57:22 -04:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-04-07 21:57:22 -04:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_defaults (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-04-07 21:57:22 -04:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-defaults",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-04-07 21:57:22 -04:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2011-04-07 21:57:22 -04:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 15:26:58 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2008-02-07 22:04:27 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_list_paint_methods:
|
2021-12-01 22:35:25 +01:00
|
|
|
* @paint_methods: (out) (array zero-terminated=1) (transfer full): The names of the available paint methods.
|
2008-02-07 22:04:27 +00:00
|
|
|
*
|
|
|
|
* Lists the available paint methods.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Lists the names of the available paint methods. Any of the names can
|
|
|
|
* be used for gimp_context_set_paint_method().
|
2008-02-07 22:04:27 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.4
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2008-02-07 22:04:27 +00:00
|
|
|
gboolean
|
2021-12-01 22:35:25 +01:00
|
|
|
gimp_context_list_paint_methods (gchar ***paint_methods)
|
2008-02-07 22:04:27 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2008-02-07 22:04:27 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-list-paint-methods",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2008-02-07 22:04:27 +00:00
|
|
|
|
|
|
|
*paint_methods = NULL;
|
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2008-02-07 22:04:27 +00:00
|
|
|
|
|
|
|
if (success)
|
2021-12-01 22:35:25 +01:00
|
|
|
*paint_methods = GIMP_VALUES_DUP_STRV (return_vals, 1);
|
2008-02-07 22:04:27 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2008-02-07 22:04:27 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2006-01-02 17:21:42 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_get_paint_method:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active paint method.
|
2006-01-02 17:21:42 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the name of the currently active paint method.
|
2006-01-02 17:21:42 +00:00
|
|
|
*
|
2019-07-31 22:51:35 +02:00
|
|
|
* Returns: (transfer full): The name of the active paint method.
|
2019-08-04 22:09:04 +02:00
|
|
|
* The returned value must be freed with g_free().
|
2006-01-02 17:21:42 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.4
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2006-01-02 17:21:42 +00:00
|
|
|
gchar *
|
|
|
|
gimp_context_get_paint_method (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2006-01-02 17:21:42 +00:00
|
|
|
gchar *name = NULL;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-paint-method",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2006-01-02 17:21:42 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
name = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2006-01-02 17:21:42 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2006-01-02 17:21:42 +00:00
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_paint_method:
|
|
|
|
* @name: The name of the paint method.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active paint method.
|
2006-01-02 17:21:42 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active paint method to the named paint method. The paint
|
|
|
|
* method will be used in all subsequent paint operations. The name
|
|
|
|
* should be a name of an available paint method. Returns an error if
|
|
|
|
* no matching paint method is found.
|
2006-01-02 17:21:42 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.4
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2006-01-02 17:21:42 +00:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_paint_method (const gchar *name)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2006-01-02 17:21:42 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2006-01-02 17:21:42 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-paint-method",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-09 01:46:07 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-09 01:46:07 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_stroke_method:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active stroke method.
|
2015-11-09 01:46:07 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the currently active stroke method.
|
2015-11-09 01:46:07 +01:00
|
|
|
*
|
|
|
|
* Returns: The active stroke method.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GimpStrokeMethod
|
|
|
|
gimp_context_get_stroke_method (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-09 01:46:07 +01:00
|
|
|
GimpStrokeMethod stroke_method = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-stroke-method",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-09 01:46:07 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
stroke_method = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2015-11-09 01:46:07 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-09 01:46:07 +01:00
|
|
|
|
|
|
|
return stroke_method;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_stroke_method:
|
|
|
|
* @stroke_method: The new stroke method.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active stroke method.
|
2015-11-09 01:46:07 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active stroke method. The method will be used in all
|
|
|
|
* subsequent stroke operations.
|
2015-11-09 01:46:07 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_stroke_method (GimpStrokeMethod stroke_method)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-09 01:46:07 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_STROKE_METHOD, stroke_method,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2015-11-09 01:46:07 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-stroke-method",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2006-01-02 17:21:42 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2006-01-02 17:21:42 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2004-09-22 18:43:09 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_get_foreground:
|
|
|
|
*
|
|
|
|
* Get the current GIMP foreground color.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the current GIMP foreground color. The foreground color is
|
|
|
|
* used in a variety of tools such as paint tools, blending, and bucket
|
|
|
|
* fill.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
2023-11-14 20:04:14 +01:00
|
|
|
* Returns: (transfer full): The foreground color.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2023-11-14 20:04:14 +01:00
|
|
|
GeglColor *
|
|
|
|
gimp_context_get_foreground (void)
|
2004-09-22 18:43:09 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2023-11-14 20:04:14 +01:00
|
|
|
GeglColor *foreground = NULL;
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-foreground",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2023-11-14 20:04:14 +01:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
foreground = g_value_dup_object (gimp_value_array_index (return_vals, 1));
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2023-11-14 20:04:14 +01:00
|
|
|
return foreground;
|
2004-09-22 18:43:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_foreground:
|
|
|
|
* @foreground: The foreground color.
|
|
|
|
*
|
|
|
|
* Set the current GIMP foreground color.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the current GIMP foreground color. After this is set,
|
|
|
|
* operations which use foreground such as paint tools, blending, and
|
|
|
|
* bucket fill will use the new value.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean
|
2023-11-13 23:29:20 +01:00
|
|
|
gimp_context_set_foreground (GeglColor *foreground)
|
2004-09-22 18:43:09 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2023-11-13 23:29:20 +01:00
|
|
|
GEGL_TYPE_COLOR, foreground,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-foreground",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_background:
|
|
|
|
*
|
|
|
|
* Get the current GIMP background color.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the current GIMP background color. The background color is
|
|
|
|
* used in a variety of tools such as blending, erasing (with non-alpha
|
|
|
|
* images), and image filling.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
2023-11-14 20:04:14 +01:00
|
|
|
* Returns: (transfer full): The background color.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2023-11-14 20:04:14 +01:00
|
|
|
GeglColor *
|
|
|
|
gimp_context_get_background (void)
|
2004-09-22 18:43:09 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2023-11-14 20:04:14 +01:00
|
|
|
GeglColor *background = NULL;
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-background",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2023-11-14 20:04:14 +01:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
background = g_value_dup_object (gimp_value_array_index (return_vals, 1));
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2023-11-14 20:04:14 +01:00
|
|
|
return background;
|
2004-09-22 18:43:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_background:
|
|
|
|
* @background: The background color.
|
|
|
|
*
|
|
|
|
* Set the current GIMP background color.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the current GIMP background color. After this is set,
|
|
|
|
* operations which use background such as blending, filling images,
|
|
|
|
* clearing, and erasing (in non-alpha images) will use the new value.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean
|
2023-11-13 23:29:20 +01:00
|
|
|
gimp_context_set_background (GeglColor *background)
|
2004-09-22 18:43:09 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2023-11-13 23:29:20 +01:00
|
|
|
GEGL_TYPE_COLOR, background,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-background",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_default_colors:
|
|
|
|
*
|
|
|
|
* Set the current GIMP foreground and background colors to black and
|
|
|
|
* white.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the current GIMP foreground and background colors to their
|
|
|
|
* initial default values, black and white.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_default_colors (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-default-colors",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_swap_colors:
|
|
|
|
*
|
|
|
|
* Swap the current GIMP foreground and background colors.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Swaps the current GIMP foreground and background colors, so that the
|
|
|
|
* new foreground color becomes the old background color and vice
|
|
|
|
* versa.
|
2004-09-22 18:43:09 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
2004-09-22 19:22:24 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean
|
|
|
|
gimp_context_swap_colors (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 18:43:09 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-swap-colors",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 18:43:09 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 18:43:09 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2004-09-22 19:22:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_opacity:
|
|
|
|
*
|
|
|
|
* Get the opacity.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the opacity setting. The return value is a floating point
|
|
|
|
* number between 0 and 100.
|
2004-09-22 19:22:24 +00:00
|
|
|
*
|
|
|
|
* Returns: The opacity.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 19:22:24 +00:00
|
|
|
gdouble
|
|
|
|
gimp_context_get_opacity (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2006-04-02 11:22:47 +00:00
|
|
|
gdouble opacity = 0.0;
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-opacity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
opacity = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
|
|
|
return opacity;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_opacity:
|
|
|
|
* @opacity: The opacity.
|
|
|
|
*
|
|
|
|
* Set the opacity.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the opacity setting. The value should be a floating point
|
|
|
|
* number between 0 and 100.
|
2004-09-22 19:22:24 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 19:22:24 +00:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_opacity (gdouble opacity)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 19:22:24 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, opacity,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-opacity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_paint_mode:
|
|
|
|
*
|
|
|
|
* Get the paint mode.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the paint-mode setting. The return value is an integer which
|
|
|
|
* corresponds to the values listed in the argument description.
|
2004-09-22 19:22:24 +00:00
|
|
|
*
|
|
|
|
* Returns: The paint mode.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2017-01-08 23:00:19 +01:00
|
|
|
GimpLayerMode
|
2004-09-22 19:22:24 +00:00
|
|
|
gimp_context_get_paint_mode (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2017-01-08 23:00:19 +01:00
|
|
|
GimpLayerMode paint_mode = 0;
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-paint-mode",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
paint_mode = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
|
|
|
return paint_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_paint_mode:
|
|
|
|
* @paint_mode: The paint mode.
|
|
|
|
*
|
|
|
|
* Set the paint mode.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the paint_mode setting.
|
2004-09-22 19:22:24 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 19:22:24 +00:00
|
|
|
gboolean
|
2017-01-08 23:00:19 +01:00
|
|
|
gimp_context_set_paint_mode (GimpLayerMode paint_mode)
|
2004-09-22 19:22:24 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 19:22:24 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_LAYER_MODE, paint_mode,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-paint-mode",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 19:22:24 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 19:22:24 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2015-11-11 00:47:31 +01:00
|
|
|
/**
|
|
|
|
* gimp_context_get_line_width:
|
|
|
|
*
|
|
|
|
* Get the line width setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line width setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: The line width setting.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_line_width (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gdouble line_width = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-width",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
line_width = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return line_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_width:
|
|
|
|
* @line_width: The line width setting.
|
|
|
|
*
|
|
|
|
* Set the line width setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line width setting for stroking lines.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_line_width (gdouble line_width)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, line_width,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-width",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_line_width_unit:
|
|
|
|
*
|
|
|
|
* Get the line width unit setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line width unit setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
2019-08-05 15:31:12 +02:00
|
|
|
* Returns: (transfer none): The line width unit setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-25 20:55:21 +02:00
|
|
|
GimpUnit *
|
2015-11-11 00:47:31 +01:00
|
|
|
gimp_context_get_line_width_unit (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-25 20:55:21 +02:00
|
|
|
GimpUnit *line_width_unit = NULL;
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-width-unit",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-25 20:55:21 +02:00
|
|
|
line_width_unit = GIMP_VALUES_GET_UNIT (return_vals, 1);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return line_width_unit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_width_unit:
|
|
|
|
* @line_width_unit: The line width setting unit.
|
|
|
|
*
|
|
|
|
* Set the line width unit setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line width unit setting for stroking lines.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-25 20:55:21 +02:00
|
|
|
gimp_context_set_line_width_unit (GimpUnit *line_width_unit)
|
2015-11-11 00:47:31 +01:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_UNIT, line_width_unit,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-width-unit",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_line_cap_style:
|
|
|
|
*
|
|
|
|
* Get the line cap style setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line cap style setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: The line cap style setting.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GimpCapStyle
|
|
|
|
gimp_context_get_line_cap_style (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
GimpCapStyle cap_style = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-cap-style",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
cap_style = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return cap_style;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_cap_style:
|
|
|
|
* @cap_style: The line cap style setting.
|
|
|
|
*
|
|
|
|
* Set the line cap style setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line cap style setting for stroking lines.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_line_cap_style (GimpCapStyle cap_style)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_CAP_STYLE, cap_style,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-cap-style",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_line_join_style:
|
|
|
|
*
|
|
|
|
* Get the line join style setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line join style setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: The line join style setting.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GimpJoinStyle
|
|
|
|
gimp_context_get_line_join_style (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
GimpJoinStyle join_style = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-join-style",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
join_style = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return join_style;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_join_style:
|
|
|
|
* @join_style: The line join style setting.
|
|
|
|
*
|
|
|
|
* Set the line join style setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line join style setting for stroking lines.
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_line_join_style (GimpJoinStyle join_style)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_JOIN_STYLE, join_style,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-join-style",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_line_miter_limit:
|
|
|
|
*
|
|
|
|
* Get the line miter limit setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line miter limit setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: The line miter limit setting.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_line_miter_limit (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gdouble miter_limit = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-miter-limit",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
miter_limit = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return miter_limit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_miter_limit:
|
|
|
|
* @miter_limit: The line miter limit setting.
|
|
|
|
*
|
|
|
|
* Set the line miter limit setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line miter limit setting for stroking lines.
|
2015-11-11 00:47:31 +01:00
|
|
|
* A mitered join is converted to a bevelled join if the miter would
|
|
|
|
* extend to a distance of more than (miter-limit * line-width) from
|
|
|
|
* the actual join point.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_line_miter_limit (gdouble miter_limit)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, miter_limit,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-miter-limit",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_line_dash_offset:
|
|
|
|
*
|
|
|
|
* Get the line dash offset setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line dash offset setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: The line dash offset setting.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_line_dash_offset (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gdouble dash_offset = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-dash-offset",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
dash_offset = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return dash_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_dash_offset:
|
|
|
|
* @dash_offset: The line dash offset setting.
|
|
|
|
*
|
|
|
|
* Set the line dash offset setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line dash offset setting for stroking lines.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_line_dash_offset (gdouble dash_offset)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, dash_offset,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-dash-offset",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_line_dash_pattern:
|
2019-07-31 22:51:35 +02:00
|
|
|
* @num_dashes: (out): The number of dashes in the dash_pattern array.
|
|
|
|
* @dashes: (out) (array length=num_dashes) (element-type gdouble) (transfer full): The line dash pattern setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Get the line dash pattern setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the line dash pattern setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-10-25 02:10:57 +02:00
|
|
|
gimp_context_get_line_dash_pattern (gsize *num_dashes,
|
2015-11-11 00:47:31 +01:00
|
|
|
gdouble **dashes)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-line-dash-pattern",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
*num_dashes = 0;
|
|
|
|
*dashes = NULL;
|
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
app, libgimp*, pdb, plug-ins: rename various public API name s/float/double/.
Several types functions were using the wording "float" historically to
mean double-precision, e.g. the float array type (which was in fact a
double array). Or the scanner function gimp_scanner_parse_float() was in
fact returning a double value. What if we wanted someday to actually add
float (usually this naming means in C the single-precision IEEE 754
floating point representation) support? How would we name this?
Now technically it's not entirely wrong (a double is still a floating
point). So I've been wondering if that is because maybe we never planned
to have float and double precision may be good enough for all usage in a
plug-in API (which doesn't have to be as generic so the higher precision
is enough)? But how can we be sure? Also we already had some functions
using the wording double (e.g. gimp_procedure_add_double_argument()), so
let's just go the safe route and use the accurate wording.
The additional change in PDB is internal, but there too, I was also
finding very confusing that we were naming double-precision float as
'float' type. So I took the opportunity to update this. It doesn't
change any signature.
In fact the whole commit doesn't change any type or code logic, only
naming, except for one bug fix in the middle which I encountered while
renaming: in gimp_scanner_parse_deprecated_color(), I discovered a
hidden bug in scanning (color-hsv*) values, which was mistakenly using a
double type for an array of float.
2024-11-02 14:03:37 +01:00
|
|
|
*dashes = GIMP_VALUES_DUP_DOUBLE_ARRAY (return_vals, 1, num_dashes);
|
2015-11-11 00:47:31 +01:00
|
|
|
}
|
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_line_dash_pattern:
|
|
|
|
* @num_dashes: The number of dashes in the dash_pattern array.
|
2019-07-31 22:51:35 +02:00
|
|
|
* @dashes: (array length=num_dashes) (element-type gdouble): The line dash pattern setting.
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Set the line dash pattern setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the line dash pattern setting for stroking lines.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2015-11-11 00:47:31 +01:00
|
|
|
* The unit of the dash pattern segments is the actual line width used
|
2016-06-25 22:54:10 +02:00
|
|
|
* for the stroke operation, in other words a segment length of 1.0
|
2015-11-11 00:47:31 +01:00
|
|
|
* results in a square segment shape (or gap shape).
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* This setting affects the following procedures:
|
2019-07-24 01:57:43 +02:00
|
|
|
* gimp_drawable_edit_stroke_selection(),
|
2018-04-15 14:57:25 +02:00
|
|
|
* gimp_drawable_edit_stroke_item().
|
2015-11-11 00:47:31 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-10-25 02:10:57 +02:00
|
|
|
gimp_context_set_line_dash_pattern (gsize num_dashes,
|
2015-11-11 00:47:31 +01:00
|
|
|
const gdouble *dashes)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2015-11-11 00:47:31 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
app, libgimp*, pdb, plug-ins: rename various public API name s/float/double/.
Several types functions were using the wording "float" historically to
mean double-precision, e.g. the float array type (which was in fact a
double array). Or the scanner function gimp_scanner_parse_float() was in
fact returning a double value. What if we wanted someday to actually add
float (usually this naming means in C the single-precision IEEE 754
floating point representation) support? How would we name this?
Now technically it's not entirely wrong (a double is still a floating
point). So I've been wondering if that is because maybe we never planned
to have float and double precision may be good enough for all usage in a
plug-in API (which doesn't have to be as generic so the higher precision
is enough)? But how can we be sure? Also we already had some functions
using the wording double (e.g. gimp_procedure_add_double_argument()), so
let's just go the safe route and use the accurate wording.
The additional change in PDB is internal, but there too, I was also
finding very confusing that we were naming double-precision float as
'float' type. So I took the opportunity to update this. It doesn't
change any signature.
In fact the whole commit doesn't change any type or code logic, only
naming, except for one bug fix in the middle which I encountered while
renaming: in gimp_scanner_parse_deprecated_color(), I discovered a
hidden bug in scanning (color-hsv*) values, which was mistakenly using a
double type for an array of float.
2024-11-02 14:03:37 +01:00
|
|
|
GIMP_TYPE_DOUBLE_ARRAY, NULL,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
app, libgimp*, pdb, plug-ins: rename various public API name s/float/double/.
Several types functions were using the wording "float" historically to
mean double-precision, e.g. the float array type (which was in fact a
double array). Or the scanner function gimp_scanner_parse_float() was in
fact returning a double value. What if we wanted someday to actually add
float (usually this naming means in C the single-precision IEEE 754
floating point representation) support? How would we name this?
Now technically it's not entirely wrong (a double is still a floating
point). So I've been wondering if that is because maybe we never planned
to have float and double precision may be good enough for all usage in a
plug-in API (which doesn't have to be as generic so the higher precision
is enough)? But how can we be sure? Also we already had some functions
using the wording double (e.g. gimp_procedure_add_double_argument()), so
let's just go the safe route and use the accurate wording.
The additional change in PDB is internal, but there too, I was also
finding very confusing that we were naming double-precision float as
'float' type. So I took the opportunity to update this. It doesn't
change any signature.
In fact the whole commit doesn't change any type or code logic, only
naming, except for one bug fix in the middle which I encountered while
renaming: in gimp_scanner_parse_deprecated_color(), I discovered a
hidden bug in scanning (color-hsv*) values, which was mistakenly using a
double type for an array of float.
2024-11-02 14:03:37 +01:00
|
|
|
gimp_value_set_double_array (gimp_value_array_index (args, 0), dashes, num_dashes);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-line-dash-pattern",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2015-11-11 00:47:31 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2015-11-11 00:47:31 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2004-09-22 23:00:51 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_get_brush:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active brush.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the currently active brush. All paint and stroke operations
|
|
|
|
* use this brush.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2023-07-11 16:13:36 +02:00
|
|
|
* Returns: (transfer none): The active brush.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpBrush *
|
2004-09-22 23:00:51 +00:00
|
|
|
gimp_context_get_brush (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpBrush *brush = NULL;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2022-09-05 19:28:35 -04:00
|
|
|
brush = GIMP_VALUES_GET_BRUSH (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2022-09-05 19:28:35 -04:00
|
|
|
return brush;
|
2004-09-22 23:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @brush: The brush.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active brush.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active brush in the current context. The brush will be used
|
|
|
|
* in subsequent paint and stroke operations. Returns an error when the
|
|
|
|
* brush data was uninstalled since the brush object was created.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean
|
2022-09-05 19:28:35 -04:00
|
|
|
gimp_context_set_brush (GimpBrush *brush)
|
2004-09-22 23:00:51 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2022-09-05 19:28:35 -04:00
|
|
|
GIMP_TYPE_BRUSH, brush,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2012-03-01 12:58:26 +01:00
|
|
|
/**
|
|
|
|
* gimp_context_get_brush_size:
|
|
|
|
*
|
|
|
|
* Get brush size in pixels.
|
|
|
|
*
|
|
|
|
* Get the brush size in pixels for brush based paint tools.
|
|
|
|
*
|
2014-11-17 23:18:22 +01:00
|
|
|
* Returns: Brush size in pixels.
|
2012-03-01 12:58:26 +01:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
2012-07-26 16:26:14 +02:00
|
|
|
gdouble
|
|
|
|
gimp_context_get_brush_size (void)
|
2012-03-01 12:58:26 +01:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-07-26 16:26:14 +02:00
|
|
|
gdouble size = 0.0;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush-size",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
size = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2012-07-26 16:26:14 +02:00
|
|
|
return size;
|
2012-03-01 12:58:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_size:
|
2014-11-17 23:18:22 +01:00
|
|
|
* @size: Brush size in pixels.
|
2012-03-01 12:58:26 +01:00
|
|
|
*
|
|
|
|
* Set brush size in pixels.
|
|
|
|
*
|
|
|
|
* Set the brush size in pixels for brush based paint tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_size (gdouble size)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, size,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-size",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_default_size:
|
|
|
|
*
|
|
|
|
* Set brush size to its default.
|
|
|
|
*
|
|
|
|
* Set the brush size to the default (max of width and height) for
|
|
|
|
* paintbrush, airbrush, or pencil tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_default_size (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-default-size",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_brush_aspect_ratio:
|
|
|
|
*
|
|
|
|
* Get brush aspect ratio.
|
|
|
|
*
|
|
|
|
* Set the aspect ratio for brush based paint tools.
|
|
|
|
*
|
2014-11-17 23:18:22 +01:00
|
|
|
* Returns: Aspect ratio.
|
2012-03-01 12:58:26 +01:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
2012-07-26 16:26:14 +02:00
|
|
|
gdouble
|
|
|
|
gimp_context_get_brush_aspect_ratio (void)
|
2012-03-01 12:58:26 +01:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-07-26 16:26:14 +02:00
|
|
|
gdouble aspect = 0.0;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush-aspect-ratio",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
aspect = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2012-07-26 16:26:14 +02:00
|
|
|
return aspect;
|
2012-03-01 12:58:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_aspect_ratio:
|
2014-11-17 23:18:22 +01:00
|
|
|
* @aspect: Aspect ratio.
|
2012-03-01 12:58:26 +01:00
|
|
|
*
|
|
|
|
* Set brush aspect ratio.
|
|
|
|
*
|
|
|
|
* Set the aspect ratio for brush based paint tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_aspect_ratio (gdouble aspect)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, aspect,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-aspect-ratio",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_brush_angle:
|
|
|
|
*
|
|
|
|
* Get brush angle in degrees.
|
|
|
|
*
|
|
|
|
* Set the angle in degrees for brush based paint tools.
|
|
|
|
*
|
2014-11-17 23:18:22 +01:00
|
|
|
* Returns: Angle in degrees.
|
2012-03-01 12:58:26 +01:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
2012-07-26 16:26:14 +02:00
|
|
|
gdouble
|
|
|
|
gimp_context_get_brush_angle (void)
|
2012-03-01 12:58:26 +01:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-07-26 16:26:14 +02:00
|
|
|
gdouble angle = 0.0;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush-angle",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
angle = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2012-07-26 16:26:14 +02:00
|
|
|
return angle;
|
2012-03-01 12:58:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_angle:
|
2014-11-17 23:18:22 +01:00
|
|
|
* @angle: Angle in degrees.
|
2012-03-01 12:58:26 +01:00
|
|
|
*
|
|
|
|
* Set brush angle in degrees.
|
|
|
|
*
|
|
|
|
* Set the angle in degrees for brush based paint tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_angle (gdouble angle)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, angle,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-angle",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2014-11-13 14:47:32 +02:00
|
|
|
/**
|
|
|
|
* gimp_context_get_brush_spacing:
|
|
|
|
*
|
|
|
|
* Get brush spacing as percent of size.
|
|
|
|
*
|
|
|
|
* Get the brush spacing as percent of size for brush based paint
|
|
|
|
* tools.
|
|
|
|
*
|
2014-11-17 23:56:16 +01:00
|
|
|
* Returns: Brush spacing as fraction of size.
|
2014-11-13 14:47:32 +02:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-13 14:47:32 +02:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_brush_spacing (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-13 14:47:32 +02:00
|
|
|
gdouble spacing = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush-spacing",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
spacing = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
|
|
|
return spacing;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_spacing:
|
2014-11-17 23:56:16 +01:00
|
|
|
* @spacing: Brush spacing as fraction of size.
|
2014-11-13 14:47:32 +02:00
|
|
|
*
|
|
|
|
* Set brush spacing as percent of size.
|
|
|
|
*
|
|
|
|
* Set the brush spacing as percent of size for brush based paint
|
|
|
|
* tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-13 14:47:32 +02:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_spacing (gdouble spacing)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-13 14:47:32 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, spacing,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-spacing",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_default_spacing:
|
|
|
|
*
|
|
|
|
* Set brush spacing to its default.
|
|
|
|
*
|
|
|
|
* Set the brush spacing to the default for paintbrush, airbrush, or
|
|
|
|
* pencil tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-13 14:47:32 +02:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_default_spacing (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-13 14:47:32 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-default-spacing",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2014-11-13 14:47:32 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-13 14:47:32 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2014-11-17 15:22:39 +02:00
|
|
|
/**
|
|
|
|
* gimp_context_get_brush_hardness:
|
|
|
|
*
|
|
|
|
* Get brush hardness in paint options.
|
|
|
|
*
|
|
|
|
* Get the brush hardness for brush based paint tools.
|
|
|
|
*
|
2014-11-17 23:18:22 +01:00
|
|
|
* Returns: Brush hardness.
|
2014-11-17 15:22:39 +02:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-17 15:22:39 +02:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_brush_hardness (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-17 15:22:39 +02:00
|
|
|
gdouble hardness = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush-hardness",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
hardness = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
|
|
|
return hardness;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_hardness:
|
2014-11-17 23:18:22 +01:00
|
|
|
* @hardness: Brush hardness.
|
2014-11-17 15:22:39 +02:00
|
|
|
*
|
|
|
|
* Set brush hardness.
|
|
|
|
*
|
|
|
|
* Set the brush hardness for brush based paint tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-17 15:22:39 +02:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_hardness (gdouble hardness)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-17 15:22:39 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, hardness,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-hardness",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_default_hardness:
|
|
|
|
*
|
|
|
|
* Set brush spacing to its default.
|
|
|
|
*
|
|
|
|
* Set the brush spacing to the default for paintbrush, airbrush, or
|
|
|
|
* pencil tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-17 15:22:39 +02:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_default_hardness (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-17 15:22:39 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-default-hardness",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_brush_force:
|
|
|
|
*
|
|
|
|
* Get brush force in paint options.
|
|
|
|
*
|
|
|
|
* Get the brush application force for brush based paint tools.
|
|
|
|
*
|
2014-11-17 23:18:22 +01:00
|
|
|
* Returns: Brush application force.
|
2014-11-17 15:22:39 +02:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-17 15:22:39 +02:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_brush_force (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-17 15:22:39 +02:00
|
|
|
gdouble force = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-brush-force",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
force = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
|
|
|
return force;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_brush_force:
|
2014-11-17 23:18:22 +01:00
|
|
|
* @force: Brush application force.
|
2014-11-17 15:22:39 +02:00
|
|
|
*
|
|
|
|
* Set brush application force.
|
|
|
|
*
|
|
|
|
* Set the brush application force for brush based paint tools.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.10
|
2014-11-17 15:22:39 +02:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_brush_force (gdouble force)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2014-11-17 15:22:39 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, force,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-brush-force",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2014-11-17 15:22:39 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2014-11-17 15:22:39 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2011-10-31 21:07:08 +01:00
|
|
|
/**
|
2024-11-03 17:00:21 +01:00
|
|
|
* gimp_context_get_dynamics_name:
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active paint dynamics.
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the name of the currently active paint dynamics. If enabled,
|
|
|
|
* all paint operations and stroke operations use this paint dynamics
|
|
|
|
* to control the application of paint to the image. If disabled, the
|
|
|
|
* dynamics will be ignored during paint actions.
|
2022-02-04 13:54:59 +01:00
|
|
|
* See gimp_context_are_dynamics_enabled() to enquire whether dynamics
|
|
|
|
* are used or ignored.
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
2019-07-31 22:51:35 +02:00
|
|
|
* Returns: (transfer full): The name of the active paint dynamics.
|
2019-08-04 22:09:04 +02:00
|
|
|
* The returned value must be freed with g_free().
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-10-31 21:07:08 +01:00
|
|
|
**/
|
|
|
|
gchar *
|
2024-11-03 17:00:21 +01:00
|
|
|
gimp_context_get_dynamics_name (void)
|
2011-10-31 21:07:08 +01:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-10-31 21:07:08 +01:00
|
|
|
gchar *name = NULL;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2011-10-31 21:07:08 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
2024-11-03 17:00:21 +01:00
|
|
|
"gimp-context-get-dynamics-name",
|
2023-10-16 22:07:55 +02:00
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-10-31 21:07:08 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
name = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-10-31 21:07:08 +01:00
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-11-03 17:00:21 +01:00
|
|
|
* gimp_context_set_dynamics_name:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @name: A name of a paint dynamics.
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active paint dynamics.
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active paint dynamics. The paint dynamics will be used in
|
|
|
|
* all subsequent paint operations when dynamics are enabled. The name
|
|
|
|
* should be a name of an installed paint dynamics. Returns an error if
|
|
|
|
* no matching paint dynamics is found.
|
2011-10-31 21:07:08 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-10-31 21:07:08 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
2024-11-03 17:00:21 +01:00
|
|
|
gimp_context_set_dynamics_name (const gchar *name)
|
2011-10-31 21:07:08 +01:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-10-31 21:07:08 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
2024-11-03 17:00:21 +01:00
|
|
|
"gimp-context-set-dynamics-name",
|
2023-10-16 22:07:55 +02:00
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-10-31 21:07:08 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2011-10-31 21:07:08 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-10-31 21:07:08 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2022-02-04 13:54:59 +01:00
|
|
|
/**
|
|
|
|
* gimp_context_are_dynamics_enabled:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Whether the currently active paint dynamics will be applied to
|
|
|
|
* painting.
|
2022-02-04 13:54:59 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns whether the currently active paint dynamics (as returned by
|
|
|
|
* gimp_context_get_dynamics()) is enabled.
|
2022-02-04 13:54:59 +01:00
|
|
|
*
|
|
|
|
* Returns: Whether dynamics enabled or disabled.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_are_dynamics_enabled (void)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean enabled = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-are-dynamics-enabled",
|
|
|
|
args);
|
2022-02-04 13:54:59 +01:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
enabled = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_enable_dynamics:
|
|
|
|
* @enable: Whether to enable or disable dynamics.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Enables paint dynamics using the active paint dynamics.
|
2022-02-04 13:54:59 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Enables the active paint dynamics to be used in all subsequent paint
|
|
|
|
* operations.
|
2022-02-04 13:54:59 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_enable_dynamics (gboolean enable)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, enable,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-enable-dynamics",
|
|
|
|
args);
|
2022-02-04 13:54:59 +01:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2024-10-19 07:01:13 -04:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_emulate_brush_dynamics:
|
|
|
|
*
|
|
|
|
* Retrieve the currently active stroke option's emulate brush dynamics
|
|
|
|
* setting.
|
|
|
|
*
|
|
|
|
* This procedure returns the emulate brush dynamics property of the
|
|
|
|
* currently active stroke options.
|
|
|
|
*
|
|
|
|
* Returns: The emulate brush dynamics setting.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_get_emulate_brush_dynamics (void)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean emulate_dynamics = FALSE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-emulate-brush-dynamics",
|
|
|
|
args);
|
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
emulate_dynamics = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return emulate_dynamics;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_emulate_brush_dynamics:
|
|
|
|
* @emulate_dynamics: The new emulate brush dynamics setting.
|
|
|
|
*
|
|
|
|
* Set the stroke option's emulate brush dynamics setting.
|
|
|
|
*
|
|
|
|
* This procedure sets the specified emulate brush dynamics setting.
|
|
|
|
* The new method will be used in all subsequent stroke operations.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_emulate_brush_dynamics (gboolean emulate_dynamics)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
gboolean success = TRUE;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, emulate_dynamics,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-emulate-brush-dynamics",
|
|
|
|
args);
|
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2022-02-04 13:54:59 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2016-01-02 13:40:38 +01:00
|
|
|
/**
|
|
|
|
* gimp_context_get_mypaint_brush:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active MyPaint brush.
|
2016-01-02 13:40:38 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the name of the currently active MyPaint brush.
|
2016-01-02 13:40:38 +01:00
|
|
|
*
|
2019-07-31 22:51:35 +02:00
|
|
|
* Returns: (transfer full): The name of the active MyPaint brush.
|
2019-08-04 22:09:04 +02:00
|
|
|
* The returned value must be freed with g_free().
|
2016-01-02 13:40:38 +01:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gchar *
|
|
|
|
gimp_context_get_mypaint_brush (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2016-01-02 13:40:38 +01:00
|
|
|
gchar *name = NULL;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2016-01-02 13:40:38 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-mypaint-brush",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2016-01-02 13:40:38 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
name = GIMP_VALUES_DUP_STRING (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2016-01-02 13:40:38 +01:00
|
|
|
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_mypaint_brush:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @name: A name of a MyPaint brush.
|
2016-01-02 13:40:38 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set a MyPaint brush as the active MyPaint brush.
|
2016-01-02 13:40:38 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active MyPaint brush to the named MyPaint brush. The brush
|
|
|
|
* will be used in all subsequent MyPaint paint operations. The name
|
|
|
|
* should be a name of an installed MyPaint brush. Returns an error if
|
|
|
|
* no matching MyPaint brush is found.
|
2016-01-02 13:40:38 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_mypaint_brush (const gchar *name)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2016-01-02 13:40:38 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, name,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-mypaint-brush",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2016-01-02 13:40:38 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2016-01-02 13:40:38 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2016-01-02 13:40:38 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2004-09-22 23:00:51 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_get_pattern:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active pattern.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the active pattern in the current context. All clone and
|
|
|
|
* bucket-fill operations with patterns will use this pattern to
|
|
|
|
* control the application of paint to the image.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2023-07-11 16:13:36 +02:00
|
|
|
* Returns: (transfer none): The active pattern.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpPattern *
|
2004-09-22 23:00:51 +00:00
|
|
|
gimp_context_get_pattern (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpPattern *pattern = NULL;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-pattern",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2022-09-05 19:28:35 -04:00
|
|
|
pattern = GIMP_VALUES_GET_PATTERN (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2022-09-05 19:28:35 -04:00
|
|
|
return pattern;
|
2004-09-22 23:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_pattern:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @pattern: The pattern.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active pattern.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active pattern in the current context. The pattern will be
|
|
|
|
* used in subsequent fill operations using a pattern. Returns an error
|
|
|
|
* when the pattern data was uninstalled since the pattern object was
|
|
|
|
* created.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean
|
2022-09-05 19:28:35 -04:00
|
|
|
gimp_context_set_pattern (GimpPattern *pattern)
|
2004-09-22 23:00:51 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2022-09-05 19:28:35 -04:00
|
|
|
GIMP_TYPE_PATTERN, pattern,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-pattern",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_gradient:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active gradient.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the currently active gradient.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2023-07-11 16:13:36 +02:00
|
|
|
* Returns: (transfer none): The active gradient.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpGradient *
|
2004-09-22 23:00:51 +00:00
|
|
|
gimp_context_get_gradient (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpGradient *gradient = NULL;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-gradient",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2022-09-05 19:28:35 -04:00
|
|
|
gradient = GIMP_VALUES_GET_GRADIENT (return_vals, 1);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2022-09-05 19:28:35 -04:00
|
|
|
return gradient;
|
2004-09-22 23:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @gradient: The gradient.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active gradient.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active gradient in the current context. The gradient will
|
|
|
|
* be used in subsequent gradient operations. Returns an error when the
|
|
|
|
* gradient data was uninstalled since the gradient object was created.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean
|
2022-09-05 19:28:35 -04:00
|
|
|
gimp_context_set_gradient (GimpGradient *gradient)
|
2004-09-22 23:00:51 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2022-09-05 19:28:35 -04:00
|
|
|
GIMP_TYPE_GRADIENT, gradient,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2018-04-16 11:42:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_fg_bg_rgb:
|
|
|
|
*
|
|
|
|
* Sets the built-in FG-BG RGB gradient as the active gradient.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the built-in FG-BG RGB gradient as the active gradient. The
|
|
|
|
* gradient will be used for subsequent gradient operations.
|
2018-04-16 11:42:46 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_fg_bg_rgb (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-16 11:42:46 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-fg-bg-rgb",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_fg_bg_hsv_cw:
|
|
|
|
*
|
|
|
|
* Sets the built-in FG-BG HSV (cw) gradient as the active gradient.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the built-in FG-BG HSV (cw) gradient as the active gradient.
|
|
|
|
* The gradient will be used for subsequent gradient operations.
|
2018-04-16 11:42:46 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_fg_bg_hsv_cw (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-16 11:42:46 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-fg-bg-hsv-cw",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_fg_bg_hsv_ccw:
|
|
|
|
*
|
|
|
|
* Sets the built-in FG-BG HSV (ccw) gradient as the active gradient.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the built-in FG-BG HSV (ccw) gradient as the active gradient.
|
|
|
|
* The gradient will be used for subsequent gradient operations.
|
2018-04-16 11:42:46 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_fg_bg_hsv_ccw (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-16 11:42:46 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-fg-bg-hsv-ccw",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_fg_transparent:
|
|
|
|
*
|
|
|
|
* Sets the built-in FG-Transparent gradient as the active gradient.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the built-in FG-Transparent gradient as the active gradient.
|
|
|
|
* The gradient will be used for subsequent gradient operations.
|
2018-04-16 11:42:46 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_fg_transparent (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-16 11:42:46 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-fg-transparent",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-16 11:42:46 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2018-04-15 14:57:25 +02:00
|
|
|
/**
|
|
|
|
* gimp_context_get_gradient_blend_color_space:
|
|
|
|
*
|
|
|
|
* Get the gradient blend color space.
|
|
|
|
*
|
|
|
|
* Get the gradient blend color space for paint tools and the gradient
|
|
|
|
* tool.
|
|
|
|
*
|
|
|
|
* Returns: Color blend space.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GimpGradientBlendColorSpace
|
|
|
|
gimp_context_get_gradient_blend_color_space (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
GimpGradientBlendColorSpace blend_color_space = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-gradient-blend-color-space",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
blend_color_space = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return blend_color_space;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_blend_color_space:
|
|
|
|
* @blend_color_space: Blend color space.
|
|
|
|
*
|
|
|
|
* Set the gradient blend color space.
|
|
|
|
*
|
|
|
|
* Set the gradient blend color space for paint tools and the gradient
|
|
|
|
* tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_blend_color_space (GimpGradientBlendColorSpace blend_color_space)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_GRADIENT_BLEND_COLOR_SPACE, blend_color_space,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-blend-color-space",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_gradient_repeat_mode:
|
|
|
|
*
|
|
|
|
* Get the gradient repeat mode.
|
|
|
|
*
|
|
|
|
* Get the gradient repeat mode for paint tools and the gradient tool.
|
|
|
|
*
|
|
|
|
* Returns: Repeat mode.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GimpRepeatMode
|
|
|
|
gimp_context_get_gradient_repeat_mode (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
GimpRepeatMode repeat_mode = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-gradient-repeat-mode",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
repeat_mode = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return repeat_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_repeat_mode:
|
|
|
|
* @repeat_mode: Repeat mode.
|
|
|
|
*
|
|
|
|
* Set the gradient repeat mode.
|
|
|
|
*
|
|
|
|
* Set the gradient repeat mode for paint tools and the gradient tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_repeat_mode (GimpRepeatMode repeat_mode)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_REPEAT_MODE, repeat_mode,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-repeat-mode",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_gradient_reverse:
|
|
|
|
*
|
|
|
|
* Get the gradient reverse setting.
|
|
|
|
*
|
|
|
|
* Get the gradient reverse setting for paint tools and the gradient
|
|
|
|
* tool.
|
|
|
|
*
|
|
|
|
* Returns: Reverse.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_get_gradient_reverse (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
gboolean reverse = FALSE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-gradient-reverse",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
reverse = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return reverse;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_gradient_reverse:
|
|
|
|
* @reverse: Reverse.
|
|
|
|
*
|
|
|
|
* Set the gradient reverse setting.
|
|
|
|
*
|
|
|
|
* Set the gradient reverse setting for paint tools and the gradient
|
|
|
|
* tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_gradient_reverse (gboolean reverse)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, reverse,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-gradient-reverse",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2004-09-22 23:00:51 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_get_palette:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active palette.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the currently active palette.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2023-07-11 16:13:36 +02:00
|
|
|
* Returns: (transfer none): The active palette.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpPalette *
|
2004-09-22 23:00:51 +00:00
|
|
|
gimp_context_get_palette (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpPalette *palette = NULL;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-palette",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2022-09-05 19:28:35 -04:00
|
|
|
palette = GIMP_VALUES_GET_PALETTE (return_vals, 1);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2022-09-05 19:28:35 -04:00
|
|
|
return palette;
|
2004-09-22 23:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_palette:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @palette: The palette.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active palette.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active palette in the current context. The palette will be
|
|
|
|
* used in subsequent paint operations. Returns an error when the
|
|
|
|
* palette data was uninstalled since the palette object was created.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean
|
2022-09-05 19:28:35 -04:00
|
|
|
gimp_context_set_palette (GimpPalette *palette)
|
2004-09-22 23:00:51 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2022-09-05 19:28:35 -04:00
|
|
|
GIMP_TYPE_PALETTE, palette,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-palette",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_font:
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Get the currently active font.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the currently active font.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2023-07-11 16:13:36 +02:00
|
|
|
* Returns: (transfer none): The active font.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpFont *
|
2004-09-22 23:00:51 +00:00
|
|
|
gimp_context_get_font (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2022-09-05 19:28:35 -04:00
|
|
|
GimpFont *font = NULL;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-font",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2022-09-05 19:28:35 -04:00
|
|
|
font = GIMP_VALUES_GET_FONT (return_vals, 1);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2022-09-05 19:28:35 -04:00
|
|
|
return font;
|
2004-09-22 23:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_font:
|
2022-09-05 19:28:35 -04:00
|
|
|
* @font: The font.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Set the active font.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Sets the active font in the current context. The font will be used
|
|
|
|
* in subsequent text operations. Returns an error when the font data
|
|
|
|
* was uninstalled since the font object was created.
|
2004-09-22 23:00:51 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.2
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean
|
2022-09-05 19:28:35 -04:00
|
|
|
gimp_context_set_font (GimpFont *font)
|
2004-09-22 23:00:51 +00:00
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2004-09-22 23:00:51 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2022-09-05 19:28:35 -04:00
|
|
|
GIMP_TYPE_FONT, font,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-font",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2004-09-22 23:00:51 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-09-22 23:00:51 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_antialias:
|
|
|
|
*
|
|
|
|
* Get the antialias setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the antialias setting.
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Returns: The antialias setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_get_antialias (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean antialias = FALSE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-antialias",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
antialias = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
return antialias;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_antialias:
|
|
|
|
* @antialias: The antialias setting.
|
|
|
|
*
|
|
|
|
* Set the antialias setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the antialias setting. If antialiasing is turned on, the
|
|
|
|
* edges of selected region will contain intermediate values which give
|
|
|
|
* the appearance of a sharper, less pixelized edge. This should be set
|
|
|
|
* as TRUE most of the time unless a binary-only selection is wanted.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2015-11-11 00:47:31 +01:00
|
|
|
* This setting affects the following procedures:
|
2011-02-13 17:11:20 +01:00
|
|
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_image_select_round_rectangle(), gimp_image_select_ellipse(),
|
2018-04-17 13:17:13 +02:00
|
|
|
* gimp_image_select_polygon(), gimp_image_select_item(),
|
2019-07-04 13:35:27 +02:00
|
|
|
* gimp_drawable_edit_bucket_fill(), gimp_drawable_edit_stroke_item(),
|
|
|
|
* gimp_drawable_edit_stroke_selection().
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_antialias (gboolean antialias)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, antialias,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-antialias",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_feather:
|
|
|
|
*
|
|
|
|
* Get the feather setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the feather setting.
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Returns: The feather setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_get_feather (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean feather = FALSE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-feather",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
feather = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
return feather;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_feather:
|
|
|
|
* @feather: The feather setting.
|
|
|
|
*
|
|
|
|
* Set the feather setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the feather setting. If the feather option is enabled,
|
|
|
|
* selections will be blurred before combining. The blur is a gaussian
|
|
|
|
* blur; its radii can be controlled using
|
2013-09-14 13:12:26 +12:00
|
|
|
* gimp_context_set_feather_radius().
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_image_select_rectangle(), gimp_image_select_round_rectangle(),
|
|
|
|
* gimp_image_select_ellipse(), gimp_image_select_polygon(),
|
|
|
|
* gimp_image_select_item().
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_feather (gboolean feather)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, feather,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-feather",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_feather_radius:
|
2019-07-31 22:51:35 +02:00
|
|
|
* @feather_radius_x: (out): The horizontal feather radius.
|
|
|
|
* @feather_radius_y: (out): The vertical feather radius.
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Get the feather radius setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the feather radius setting.
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_get_feather_radius (gdouble *feather_radius_x,
|
|
|
|
gdouble *feather_radius_y)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-feather-radius",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
*feather_radius_x = 0.0;
|
|
|
|
*feather_radius_y = 0.0;
|
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2019-09-04 02:49:33 +02:00
|
|
|
*feather_radius_x = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
|
|
|
*feather_radius_y = GIMP_VALUES_GET_DOUBLE (return_vals, 2);
|
2010-09-05 23:13:42 +02:00
|
|
|
}
|
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_feather_radius:
|
|
|
|
* @feather_radius_x: The horizontal feather radius.
|
|
|
|
* @feather_radius_y: The vertical feather radius.
|
|
|
|
*
|
|
|
|
* Set the feather radius setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the feather radius setting.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects all procedures that are affected by
|
2011-02-12 15:20:46 +01:00
|
|
|
* gimp_context_set_feather().
|
2010-09-05 23:13:42 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_feather_radius (gdouble feather_radius_x,
|
|
|
|
gdouble feather_radius_y)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-05 23:13:42 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, feather_radius_x,
|
|
|
|
G_TYPE_DOUBLE, feather_radius_y,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-feather-radius",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2011-01-27 19:37:13 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-01-27 19:37:13 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_sample_merged:
|
|
|
|
*
|
|
|
|
* Get the sample merged setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the sample merged setting.
|
2011-01-27 19:37:13 +01:00
|
|
|
*
|
|
|
|
* Returns: The sample merged setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-01-27 19:37:13 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_get_sample_merged (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-01-27 19:37:13 +01:00
|
|
|
gboolean sample_merged = FALSE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-sample-merged",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-01-27 19:37:13 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
sample_merged = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2011-01-27 19:37:13 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-01-27 19:37:13 +01:00
|
|
|
|
|
|
|
return sample_merged;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_sample_merged:
|
|
|
|
* @sample_merged: The sample merged setting.
|
|
|
|
*
|
|
|
|
* Set the sample merged setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the sample merged setting. If an operation depends on the
|
|
|
|
* colors of the pixels present in a drawable, like when doing a seed
|
|
|
|
* fill, this setting controls whether the pixel data from the given
|
|
|
|
* drawable is used ('sample-merged' is FALSE), or the pixel data from
|
|
|
|
* the composite image ('sample-merged' is TRUE. This is equivalent to
|
|
|
|
* sampling for colors after merging all visible layers).
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects the following procedures:
|
2018-04-17 13:17:13 +02:00
|
|
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_drawable_edit_bucket_fill().
|
2011-01-27 19:37:13 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-01-27 19:37:13 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_sample_merged (gboolean sample_merged)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-01-27 19:37:13 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, sample_merged,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2011-01-27 19:37:13 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-sample-merged",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-01-27 20:01:28 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-01-27 20:01:28 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_sample_criterion:
|
|
|
|
*
|
|
|
|
* Get the sample criterion setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the sample criterion setting.
|
2011-01-27 20:01:28 +01:00
|
|
|
*
|
|
|
|
* Returns: The sample criterion setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-01-27 20:01:28 +01:00
|
|
|
**/
|
|
|
|
GimpSelectCriterion
|
|
|
|
gimp_context_get_sample_criterion (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-01-27 20:01:28 +01:00
|
|
|
GimpSelectCriterion sample_criterion = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-sample-criterion",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-01-27 20:01:28 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
sample_criterion = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2011-01-27 20:01:28 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-01-27 20:01:28 +01:00
|
|
|
|
|
|
|
return sample_criterion;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_sample_criterion:
|
|
|
|
* @sample_criterion: The sample criterion setting.
|
|
|
|
*
|
2011-02-04 15:36:56 +01:00
|
|
|
* Set the sample criterion setting.
|
2011-01-27 20:01:28 +01:00
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the sample criterion setting. If an operation depends on
|
|
|
|
* the colors of the pixels present in a drawable, like when doing a
|
|
|
|
* seed fill, this setting controls how color similarity is determined.
|
|
|
|
* SELECT_CRITERION_COMPOSITE is the default value.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects the following procedures:
|
2018-04-17 13:17:13 +02:00
|
|
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_drawable_edit_bucket_fill().
|
2011-01-27 20:01:28 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-01-27 20:01:28 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_sample_criterion (GimpSelectCriterion sample_criterion)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-01-27 20:01:28 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_SELECT_CRITERION, sample_criterion,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2011-01-27 20:01:28 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-sample-criterion",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_sample_threshold:
|
|
|
|
*
|
|
|
|
* Get the sample threshold setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the sample threshold setting.
|
2011-02-04 15:36:56 +01:00
|
|
|
*
|
|
|
|
* Returns: The sample threshold setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-02-04 15:36:56 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_sample_threshold (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-02-04 15:36:56 +01:00
|
|
|
gdouble sample_threshold = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-sample-threshold",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
sample_threshold = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
|
|
|
return sample_threshold;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_sample_threshold:
|
|
|
|
* @sample_threshold: The sample threshold setting.
|
|
|
|
*
|
|
|
|
* Set the sample threshold setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the sample threshold setting. If an operation depends on
|
|
|
|
* the colors of the pixels present in a drawable, like when doing a
|
|
|
|
* seed fill, this setting controls what is \"sufficiently close\" to
|
|
|
|
* be considered a similar color. If the sample threshold has not been
|
|
|
|
* set explicitly, the default threshold set in gimprc will be used.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects the following procedures:
|
2018-04-17 13:17:13 +02:00
|
|
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_drawable_edit_bucket_fill().
|
2011-02-04 15:36:56 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-02-04 15:36:56 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_sample_threshold (gdouble sample_threshold)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-02-04 15:36:56 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, sample_threshold,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-sample-threshold",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_sample_threshold_int:
|
|
|
|
*
|
|
|
|
* Get the sample threshold setting as an integer value.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the sample threshold setting as an integer value. See
|
|
|
|
* gimp_context_get_sample_threshold().
|
2011-02-04 15:36:56 +01:00
|
|
|
*
|
|
|
|
* Returns: The sample threshold setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-02-04 15:36:56 +01:00
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gimp_context_get_sample_threshold_int (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-02-04 15:36:56 +01:00
|
|
|
gint sample_threshold = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-sample-threshold-int",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
sample_threshold = GIMP_VALUES_GET_INT (return_vals, 1);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
|
|
|
return sample_threshold;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_sample_threshold_int:
|
|
|
|
* @sample_threshold: The sample threshold setting.
|
|
|
|
*
|
|
|
|
* Set the sample threshold setting as an integer value.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the sample threshold setting as an integer value. See
|
|
|
|
* gimp_context_set_sample_threshold().
|
2011-02-04 15:36:56 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-02-04 15:36:56 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_sample_threshold_int (gint sample_threshold)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-02-04 15:36:56 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
2019-08-15 14:04:56 +02:00
|
|
|
G_TYPE_INT, sample_threshold,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-sample-threshold-int",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 15:36:56 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2011-02-04 18:32:32 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-04 18:32:32 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_sample_transparent:
|
|
|
|
*
|
|
|
|
* Get the sample transparent setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the sample transparent setting.
|
2011-02-04 18:32:32 +01:00
|
|
|
*
|
|
|
|
* Returns: The sample transparent setting.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-02-04 18:32:32 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_get_sample_transparent (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-02-04 18:32:32 +01:00
|
|
|
gboolean sample_transparent = FALSE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2011-02-04 18:32:32 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-sample-transparent",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 18:32:32 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
sample_transparent = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2011-02-04 18:32:32 +01:00
|
|
|
|
|
|
|
return sample_transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_sample_transparent:
|
|
|
|
* @sample_transparent: The sample transparent setting.
|
|
|
|
*
|
|
|
|
* Set the sample transparent setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the sample transparent setting. If an operation depends on
|
|
|
|
* the colors of the pixels present in a drawable, like when doing a
|
|
|
|
* seed fill, this setting controls whether transparency is considered
|
|
|
|
* to be a unique selectable color. When this setting is TRUE,
|
|
|
|
* transparent areas can be selected or filled.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2011-02-04 18:32:32 +01:00
|
|
|
* This setting affects the following procedures:
|
2018-04-17 13:17:13 +02:00
|
|
|
* gimp_image_select_color(), gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_drawable_edit_bucket_fill().
|
2011-02-04 18:32:32 +01:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2011-02-04 18:32:32 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_sample_transparent (gboolean sample_transparent)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2011-02-04 18:32:32 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, sample_transparent,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-sample-transparent",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2011-02-04 18:32:32 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2010-09-05 23:13:42 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-05 23:13:42 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2016-01-11 10:41:23 +00:00
|
|
|
/**
|
|
|
|
* gimp_context_get_diagonal_neighbors:
|
|
|
|
*
|
|
|
|
* Get the diagonal neighbors setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the diagonal neighbors setting.
|
2016-01-11 10:41:23 +00:00
|
|
|
*
|
|
|
|
* Returns: The diagonal neighbors setting.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_get_diagonal_neighbors (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2016-01-11 10:41:23 +00:00
|
|
|
gboolean diagonal_neighbors = FALSE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2016-01-11 10:41:23 +00:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-diagonal-neighbors",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2016-01-11 10:41:23 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
diagonal_neighbors = GIMP_VALUES_GET_BOOLEAN (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2016-01-11 10:41:23 +00:00
|
|
|
|
|
|
|
return diagonal_neighbors;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_diagonal_neighbors:
|
|
|
|
* @diagonal_neighbors: The diagonal neighbors setting.
|
|
|
|
*
|
|
|
|
* Set the diagonal neighbors setting.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the diagonal neighbors setting. If the affected region of
|
|
|
|
* an operation is based on a seed point, like when doing a seed fill,
|
|
|
|
* then, when this setting is TRUE, all eight neighbors of each pixel
|
|
|
|
* are considered when calculating the affected region; in contrast,
|
|
|
|
* when this setting is FALSE, only the four orthogonal neighbors of
|
|
|
|
* each pixel are considered.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2016-01-11 10:44:21 +00:00
|
|
|
* This setting affects the following procedures:
|
2018-04-17 01:16:54 +02:00
|
|
|
* gimp_image_select_contiguous_color(),
|
|
|
|
* gimp_drawable_edit_bucket_fill().
|
2016-01-11 10:41:23 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_diagonal_neighbors (gboolean diagonal_neighbors)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2016-01-11 10:41:23 +00:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_BOOLEAN, diagonal_neighbors,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-diagonal-neighbors",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2016-01-11 10:41:23 +00:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2016-01-11 10:41:23 +00:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2016-01-11 10:41:23 +00:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2018-04-15 14:57:25 +02:00
|
|
|
/**
|
|
|
|
* gimp_context_get_distance_metric:
|
|
|
|
*
|
|
|
|
* Get the distance metric used in some computations.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the distance metric in the current context. See
|
|
|
|
* gimp_context_set_distance_metric() to know more about its usage.
|
2018-04-15 14:57:25 +02:00
|
|
|
*
|
|
|
|
* Returns: The distance metric.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GeglDistanceMetric
|
|
|
|
gimp_context_get_distance_metric (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
GeglDistanceMetric metric = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-distance-metric",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
metric = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return metric;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_distance_metric:
|
|
|
|
* @metric: The distance metric.
|
|
|
|
*
|
|
|
|
* Set the distance metric used in some computations.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the distance metric used in some computations, such as
|
|
|
|
* gimp_drawable_edit_gradient_fill(). In particular, it does not
|
|
|
|
* change the metric used in generic distance computation on canvas, as
|
|
|
|
* in the Measure tool.
|
2018-04-15 14:57:25 +02:00
|
|
|
*
|
2018-04-17 13:17:13 +02:00
|
|
|
* This setting affects the following procedures:
|
|
|
|
* gimp_drawable_edit_gradient_fill().
|
|
|
|
*
|
2018-04-15 14:57:25 +02:00
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_distance_metric (GeglDistanceMetric metric)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2018-04-15 14:57:25 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GEGL_TYPE_DISTANCE_METRIC, metric,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-distance-metric",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2018-04-15 14:57:25 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2018-04-15 14:57:25 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2010-09-07 02:33:13 +02:00
|
|
|
/**
|
|
|
|
* gimp_context_get_interpolation:
|
|
|
|
*
|
|
|
|
* Get the interpolation type.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the interpolation setting. The return value is an integer
|
|
|
|
* which corresponds to the values listed in the argument description.
|
|
|
|
* If the interpolation has not been set explicitly by
|
2010-10-05 21:11:10 +02:00
|
|
|
* gimp_context_set_interpolation(), the default interpolation set in
|
|
|
|
* gimprc will be used.
|
2010-09-07 02:33:13 +02:00
|
|
|
*
|
|
|
|
* Returns: The interpolation type.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-07 02:33:13 +02:00
|
|
|
GimpInterpolationType
|
|
|
|
gimp_context_get_interpolation (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-07 02:33:13 +02:00
|
|
|
GimpInterpolationType interpolation = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-interpolation",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
interpolation = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
|
|
|
return interpolation;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_interpolation:
|
|
|
|
* @interpolation: The interpolation type.
|
|
|
|
*
|
|
|
|
* Set the interpolation type.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the interpolation setting.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects affects the following procedures:
|
2011-02-12 15:20:46 +01:00
|
|
|
* gimp_item_transform_flip(), gimp_item_transform_perspective(),
|
|
|
|
* gimp_item_transform_rotate(), gimp_item_transform_scale(),
|
|
|
|
* gimp_item_transform_shear(), gimp_item_transform_2d(),
|
|
|
|
* gimp_item_transform_matrix(), gimp_image_scale(),
|
|
|
|
* gimp_layer_scale().
|
2010-09-07 02:33:13 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-07 02:33:13 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_interpolation (GimpInterpolationType interpolation)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-07 02:33:13 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_INTERPOLATION_TYPE, interpolation,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-interpolation",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_transform_direction:
|
|
|
|
*
|
|
|
|
* Get the transform direction.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the transform direction. The return value is an integer
|
|
|
|
* which corresponds to the values listed in the argument description.
|
2010-09-07 02:33:13 +02:00
|
|
|
*
|
|
|
|
* Returns: The transform direction.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-07 02:33:13 +02:00
|
|
|
GimpTransformDirection
|
|
|
|
gimp_context_get_transform_direction (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-07 02:33:13 +02:00
|
|
|
GimpTransformDirection transform_direction = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-transform-direction",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
transform_direction = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
|
|
|
return transform_direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_transform_direction:
|
|
|
|
* @transform_direction: The transform direction.
|
|
|
|
*
|
|
|
|
* Set the transform direction.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the transform direction setting.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects affects the following procedures:
|
2011-02-12 15:20:46 +01:00
|
|
|
* gimp_item_transform_flip(), gimp_item_transform_perspective(),
|
|
|
|
* gimp_item_transform_rotate(), gimp_item_transform_scale(),
|
|
|
|
* gimp_item_transform_shear(), gimp_item_transform_2d(),
|
|
|
|
* gimp_item_transform_matrix().
|
2010-09-07 02:33:13 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-07 02:33:13 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_transform_direction (GimpTransformDirection transform_direction)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-07 02:33:13 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_TRANSFORM_DIRECTION, transform_direction,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-transform-direction",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_transform_resize:
|
|
|
|
*
|
|
|
|
* Get the transform resize type.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Returns the transform resize setting. The return value is an integer
|
|
|
|
* which corresponds to the values listed in the argument description.
|
2010-09-07 02:33:13 +02:00
|
|
|
*
|
|
|
|
* Returns: The transform resize type.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-07 02:33:13 +02:00
|
|
|
GimpTransformResize
|
|
|
|
gimp_context_get_transform_resize (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-07 02:33:13 +02:00
|
|
|
GimpTransformResize transform_resize = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-transform-resize",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
transform_resize = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
|
|
|
return transform_resize;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_transform_resize:
|
|
|
|
* @transform_resize: The transform resize type.
|
|
|
|
*
|
|
|
|
* Set the transform resize type.
|
|
|
|
*
|
2022-09-05 19:28:35 -04:00
|
|
|
* Modifies the transform resize setting. When transforming pixels, if
|
|
|
|
* the result of a transform operation has a different size than the
|
|
|
|
* original area, this setting determines how the resulting area is
|
|
|
|
* sized.
|
2018-04-17 13:17:13 +02:00
|
|
|
*
|
2013-09-14 13:12:26 +12:00
|
|
|
* This setting affects affects the following procedures:
|
|
|
|
* gimp_item_transform_flip(), gimp_item_transform_flip_simple(),
|
2011-02-12 15:20:46 +01:00
|
|
|
* gimp_item_transform_perspective(), gimp_item_transform_rotate(),
|
|
|
|
* gimp_item_transform_rotate_simple(), gimp_item_transform_scale(),
|
|
|
|
* gimp_item_transform_shear(), gimp_item_transform_2d(),
|
|
|
|
* gimp_item_transform_matrix().
|
2010-09-07 02:33:13 +02:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2010-09-15 22:07:36 +02:00
|
|
|
**/
|
2010-09-07 02:33:13 +02:00
|
|
|
gboolean
|
|
|
|
gimp_context_set_transform_resize (GimpTransformResize transform_resize)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2010-09-07 02:33:13 +02:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_TRANSFORM_RESIZE, transform_resize,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-transform-resize",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2010-09-07 02:33:13 +02:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2012-03-01 12:58:26 +01:00
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_size:
|
|
|
|
*
|
|
|
|
* Get ink blob size in pixels.
|
|
|
|
*
|
|
|
|
* Get the ink blob size in pixels for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink blob size in pixels.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_size (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble size = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-size",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
size = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_size:
|
|
|
|
* @size: ink blob size in pixels.
|
|
|
|
*
|
|
|
|
* Set ink blob size in pixels.
|
|
|
|
*
|
|
|
|
* Set the ink blob size in pixels for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_size (gdouble size)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, size,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-size",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_angle:
|
|
|
|
*
|
|
|
|
* Get ink angle in degrees.
|
|
|
|
*
|
|
|
|
* Get the ink angle in degrees for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink angle in degrees.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_angle (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble angle = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-angle",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
angle = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_angle:
|
|
|
|
* @angle: ink angle in degrees.
|
|
|
|
*
|
|
|
|
* Set ink angle in degrees.
|
|
|
|
*
|
|
|
|
* Set the ink angle in degrees for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_angle (gdouble angle)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, angle,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-angle",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_size_sensitivity:
|
|
|
|
*
|
|
|
|
* Get ink size sensitivity.
|
|
|
|
*
|
|
|
|
* Get the ink size sensitivity for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink size sensitivity.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_size_sensitivity (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble size = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-size-sensitivity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
size = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_size_sensitivity:
|
|
|
|
* @size: ink size sensitivity.
|
|
|
|
*
|
|
|
|
* Set ink size sensitivity.
|
|
|
|
*
|
|
|
|
* Set the ink size sensitivity for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_size_sensitivity (gdouble size)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, size,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-size-sensitivity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_tilt_sensitivity:
|
|
|
|
*
|
|
|
|
* Get ink tilt sensitivity.
|
|
|
|
*
|
|
|
|
* Get the ink tilt sensitivity for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink tilt sensitivity.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_tilt_sensitivity (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble tilt = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-tilt-sensitivity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
tilt = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return tilt;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_tilt_sensitivity:
|
|
|
|
* @tilt: ink tilt sensitivity.
|
|
|
|
*
|
|
|
|
* Set ink tilt sensitivity.
|
|
|
|
*
|
|
|
|
* Set the ink tilt sensitivity for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_tilt_sensitivity (gdouble tilt)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, tilt,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-tilt-sensitivity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_speed_sensitivity:
|
|
|
|
*
|
|
|
|
* Get ink speed sensitivity.
|
|
|
|
*
|
|
|
|
* Get the ink speed sensitivity for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink speed sensitivity.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_speed_sensitivity (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble speed = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-speed-sensitivity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
speed = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return speed;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_speed_sensitivity:
|
|
|
|
* @speed: ink speed sensitivity.
|
|
|
|
*
|
|
|
|
* Set ink speed sensitivity.
|
|
|
|
*
|
|
|
|
* Set the ink speed sensitivity for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_speed_sensitivity (gdouble speed)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, speed,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-speed-sensitivity",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_blob_type:
|
|
|
|
*
|
|
|
|
* Get ink blob type.
|
|
|
|
*
|
|
|
|
* Get the ink blob type for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: Ink blob type.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
GimpInkBlobType
|
|
|
|
gimp_context_get_ink_blob_type (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
GimpInkBlobType type = 0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-blob-type",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
type = GIMP_VALUES_GET_ENUM (return_vals, 1);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_blob_type:
|
|
|
|
* @type: Ink blob type.
|
|
|
|
*
|
|
|
|
* Set ink blob type.
|
|
|
|
*
|
|
|
|
* Set the ink blob type for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_blob_type (GimpInkBlobType type)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
GIMP_TYPE_INK_BLOB_TYPE, type,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-blob-type",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_blob_aspect_ratio:
|
|
|
|
*
|
|
|
|
* Get ink blob aspect ratio.
|
|
|
|
*
|
|
|
|
* Get the ink blob aspect ratio for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink blob aspect ratio.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_blob_aspect_ratio (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble aspect = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-blob-aspect-ratio",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
aspect = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return aspect;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_blob_aspect_ratio:
|
|
|
|
* @aspect: ink blob aspect ratio.
|
|
|
|
*
|
|
|
|
* Set ink blob aspect ratio.
|
|
|
|
*
|
|
|
|
* Set the ink blob aspect ratio for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_blob_aspect_ratio (gdouble aspect)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, aspect,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-blob-aspect-ratio",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2019-07-30 10:51:16 +02:00
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_get_ink_blob_angle:
|
|
|
|
*
|
|
|
|
* Get ink blob angle in degrees.
|
|
|
|
*
|
|
|
|
* Get the ink blob angle in degrees for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: ink blob angle in degrees.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gdouble
|
|
|
|
gimp_context_get_ink_blob_angle (void)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gdouble angle = 0.0;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_NONE);
|
2019-07-30 10:51:16 +02:00
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-ink-blob-angle",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
2019-09-04 02:49:33 +02:00
|
|
|
angle = GIMP_VALUES_GET_DOUBLE (return_vals, 1);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return angle;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_context_set_ink_blob_angle:
|
|
|
|
* @angle: ink blob angle in degrees.
|
|
|
|
*
|
|
|
|
* Set ink blob angle in degrees.
|
|
|
|
*
|
|
|
|
* Set the ink blob angle in degrees for ink tool.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*
|
2015-05-31 21:18:09 +02:00
|
|
|
* Since: 2.8
|
2012-03-01 12:58:26 +01:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_context_set_ink_blob_angle (gdouble angle)
|
|
|
|
{
|
2019-07-30 10:51:16 +02:00
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
2012-03-01 12:58:26 +01:00
|
|
|
gboolean success = TRUE;
|
|
|
|
|
2019-08-08 13:01:50 +02:00
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_DOUBLE, angle,
|
2019-07-30 10:51:16 +02:00
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-set-ink-blob-angle",
|
|
|
|
args);
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (args);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-09-04 01:49:35 +02:00
|
|
|
success = GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS;
|
2012-03-01 12:58:26 +01:00
|
|
|
|
2019-07-30 10:51:16 +02:00
|
|
|
gimp_value_array_unref (return_vals);
|
2012-03-01 12:58:26 +01:00
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2023-07-19 16:07:54 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* _gimp_context_get_resource:
|
|
|
|
* @type_name: The name of the resource type.
|
|
|
|
*
|
|
|
|
* Get the currently active resource for a type.
|
|
|
|
*
|
|
|
|
* Returns the currently active resource for the given type name.
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): The active resource.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GimpResource *
|
|
|
|
_gimp_context_get_resource (const gchar *type_name)
|
|
|
|
{
|
|
|
|
GimpValueArray *args;
|
|
|
|
GimpValueArray *return_vals;
|
|
|
|
GimpResource *resource = NULL;
|
|
|
|
|
|
|
|
args = gimp_value_array_new_from_types (NULL,
|
|
|
|
G_TYPE_STRING, type_name,
|
|
|
|
G_TYPE_NONE);
|
|
|
|
|
2023-10-16 22:07:55 +02:00
|
|
|
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
|
|
|
"gimp-context-get-resource",
|
|
|
|
args);
|
2023-07-19 16:07:54 +02:00
|
|
|
gimp_value_array_unref (args);
|
|
|
|
|
|
|
|
if (GIMP_VALUES_GET_ENUM (return_vals, 0) == GIMP_PDB_SUCCESS)
|
|
|
|
resource = GIMP_VALUES_GET_RESOURCE (return_vals, 1);
|
|
|
|
|
|
|
|
gimp_value_array_unref (return_vals);
|
|
|
|
|
|
|
|
return resource;
|
|
|
|
}
|