app, libgimp, pdb: set all drawable selection functions as deprecated.

Also fix a bit of "Since:" annotations, some minor spacing fixing and
remove one useless test (if we test if a type is an item, we don't need
to test the children drawable type).
This commit is contained in:
Jehan 2025-11-17 01:09:30 +01:00
parent 13d5ff79e3
commit 135ed4d2b6
11 changed files with 66 additions and 40 deletions

View file

@ -418,7 +418,6 @@ gimp_pdb_dialog_new (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (g_type_is_a (contents_type, GIMP_TYPE_RESOURCE) ||
g_type_is_a (contents_type, GIMP_TYPE_DRAWABLE) ||
g_type_is_a (contents_type, GIMP_TYPE_ITEM) ||
g_type_is_a (contents_type, GIMP_TYPE_IMAGE), FALSE);
g_return_val_if_fail (object == NULL ||

View file

@ -140,13 +140,15 @@ register_drawable_select_procs (GimpPDB *pdb)
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-drawables-popup");
gimp_procedure_set_static_help (procedure,
"Invokes the drawable selection dialog.",
"Opens a dialog letting a user choose an drawable.",
"Deprecated: Use 'gimp-items-popup' instead.",
"Deprecated: Use 'gimp-items-popup' instead.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Jehan",
"Jehan",
"2023");
"",
"",
"");
gimp_procedure_set_deprecated (procedure,
"gimp-items-popup");
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("callback",
"callback",
@ -190,13 +192,15 @@ register_drawable_select_procs (GimpPDB *pdb)
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-drawables-close-popup");
gimp_procedure_set_static_help (procedure,
"Close the drawable selection dialog.",
"Closes an open drawable selection dialog.",
"Deprecated: Use 'gimp-items-close-popup' instead.",
"Deprecated: Use 'gimp-items-close-popup' instead.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Jehan",
"Jehan",
"2023");
"",
"",
"");
gimp_procedure_set_deprecated (procedure,
"gimp-items-close-popup");
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("callback",
"callback",
@ -214,13 +218,15 @@ register_drawable_select_procs (GimpPDB *pdb)
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-drawables-set-popup");
gimp_procedure_set_static_help (procedure,
"Sets the selected drawable in a drawable selection dialog.",
"Sets the selected drawable in a drawable selection dialog.",
"Deprecated: Use 'gimp-items-set-popup' instead.",
"Deprecated: Use 'gimp-items-set-popup' instead.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Jehan",
"Jehan",
"2023");
"",
"",
"");
gimp_procedure_set_deprecated (procedure,
"gimp-items-set-popup");
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("callback",
"callback",

View file

@ -44,6 +44,8 @@
* process to pop up a drawable selection dialog.
*
* Since: 3.0
*
* Deprecated: 3.2: Use GimpItemChooser.
**/
#define CELL_SIZE 40
@ -358,6 +360,8 @@ gimp_drawable_chooser_get_property (GObject *object,
* Returns: A [class@GimpUi.DrawableChooser.
*
* Since: 3.0
*
* Deprecated: 3.2: Use gimp_item_chooser_new().
*/
GtkWidget *
gimp_drawable_chooser_new (const gchar *title,
@ -394,6 +398,8 @@ gimp_drawable_chooser_new (const gchar *title,
* Returns: (transfer none): an internal copy of the drawable which must not be freed.
*
* Since: 3.0
*
* Deprecated: 3.2: Use gimp_item_chooser_get_item().
*/
GimpDrawable *
gimp_drawable_chooser_get_drawable (GimpDrawableChooser *chooser)
@ -412,6 +418,8 @@ gimp_drawable_chooser_get_drawable (GimpDrawableChooser *chooser)
* This will select the drawable in both the button and any chooser popup.
*
* Since: 3.0
*
* Deprecated: 3.2: Use gimp_item_chooser_set_item().
*/
void
gimp_drawable_chooser_set_drawable (GimpDrawableChooser *chooser,
@ -437,7 +445,10 @@ gimp_drawable_chooser_set_drawable (GimpDrawableChooser *chooser,
* Returns the label widget.
*
* Returns: (transfer none): the [class@Gtk.Widget] showing the label text.
*
* Since: 3.0
*
* Deprecated: 3.2: Use gimp_item_chooser_get_label().
*/
GtkWidget *
gimp_drawable_chooser_get_label (GimpDrawableChooser *chooser)

View file

@ -32,14 +32,20 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GimpDrawableChooser, gimp_drawable_chooser, GIMP, DRAWABLE_CHOOSER, GtkBox)
GIMP_DEPRECATED_FOR(gimp_item_chooser_new)
GtkWidget * gimp_drawable_chooser_new (const gchar *title,
const gchar *label,
GType drawable_type,
GimpDrawable *drawable);
GIMP_DEPRECATED_FOR(gimp_item_chooser_get_item)
GimpDrawable * gimp_drawable_chooser_get_drawable (GimpDrawableChooser *chooser);
GIMP_DEPRECATED_FOR(gimp_item_chooser_set_item)
void gimp_drawable_chooser_set_drawable (GimpDrawableChooser *chooser,
GimpDrawable *drawable);
GIMP_DEPRECATED_FOR(gimp_item_chooser_get_label)
GtkWidget * gimp_drawable_chooser_get_label (GimpDrawableChooser *widget);

View file

@ -44,9 +44,7 @@
* @initial_drawable: (nullable): The drawable to set as the initial choice.
* @parent_window: (nullable): An optional parent window handle for the popup to be set transient to.
*
* Invokes the drawable selection dialog.
*
* Opens a dialog letting a user choose an drawable.
* Deprecated: Use gimp_items_popup() instead.
*
* Returns: TRUE on success.
**/
@ -85,9 +83,7 @@ gimp_drawables_popup (const gchar *callback,
* gimp_drawables_close_popup:
* @callback: The name of the callback registered for this pop-up.
*
* Close the drawable selection dialog.
*
* Closes an open drawable selection dialog.
* Deprecated: Use gimp_items_close_popup() instead.
*
* Returns: TRUE on success.
**/
@ -119,9 +115,7 @@ gimp_drawables_close_popup (const gchar *callback)
* @callback: The name of the callback registered for this pop-up.
* @drawable: The drawable to set as selected.
*
* Sets the selected drawable in a drawable selection dialog.
*
* Sets the selected drawable in a drawable selection dialog.
* Deprecated: Use gimp_items_set_popup() instead.
*
* Returns: TRUE on success.
**/

View file

@ -32,12 +32,15 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
GIMP_DEPRECATED_FOR(gimp_items_popup)
gboolean gimp_drawables_popup (const gchar *callback,
const gchar *popup_title,
const gchar *drawable_type,
GimpDrawable *initial_drawable,
GBytes *parent_window);
GIMP_DEPRECATED_FOR(gimp_items_close_popup)
gboolean gimp_drawables_close_popup (const gchar *callback);
GIMP_DEPRECATED_FOR(gimp_items_set_popup)
gboolean gimp_drawables_set_popup (const gchar *callback,
GimpDrawable *drawable);

View file

@ -42,7 +42,7 @@
* The chooser contains an optional label and a button which queries the core
* process to pop up a item selection dialog.
*
* Since: 3.0
* Since: 3.2
**/
#define CELL_SIZE 40
@ -357,7 +357,7 @@ gimp_item_chooser_get_property (GObject *object,
*
* Returns: A [class@GimpUi.ItemChooser.
*
* Since: 3.0
* Since: 3.2
*/
GtkWidget *
gimp_item_chooser_new (const gchar *title,
@ -393,7 +393,7 @@ gimp_item_chooser_new (const gchar *title,
*
* Returns: (transfer none): an internal copy of the item which must not be freed.
*
* Since: 3.0
* Since: 3.2
*/
GimpItem *
gimp_item_chooser_get_item (GimpItemChooser *chooser)
@ -411,7 +411,7 @@ gimp_item_chooser_get_item (GimpItemChooser *chooser)
* Sets the currently selected item.
* This will select the item in both the button and any chooser popup.
*
* Since: 3.0
* Since: 3.2
*/
void
gimp_item_chooser_set_item (GimpItemChooser *chooser,
@ -437,7 +437,7 @@ gimp_item_chooser_set_item (GimpItemChooser *chooser,
* Returns the label widget.
*
* Returns: (transfer none): the [class@Gtk.Widget] showing the label text.
* Since: 3.0
* Since: 3.2
*/
GtkWidget *
gimp_item_chooser_get_label (GimpItemChooser *chooser)

View file

@ -216,7 +216,7 @@ gimp_prop_image_chooser_new (GObject *config,
*
* Returns: (transfer full): A new [class@GimpUi.ItemChooser].
*
* Since: 3.0
* Since: 3.2
*/
GtkWidget *
gimp_prop_item_chooser_new (GObject *config,
@ -285,6 +285,8 @@ gimp_prop_item_chooser_new (GObject *config,
* Returns: (transfer full): A new [class@GimpUi.DrawableChooser].
*
* Since: 3.0
*
* Deprecated: 3.2: Use gimp_prop_item_chooser_new().
*/
GtkWidget *
gimp_prop_drawable_chooser_new (GObject *config,

View file

@ -54,6 +54,8 @@ GtkWidget * gimp_prop_image_chooser_new (GObject *config,
GtkWidget * gimp_prop_item_chooser_new (GObject *config,
const gchar *property_name,
const gchar *chooser_title);
GIMP_DEPRECATED_FOR(gimp_prop_item_chooser_new)
GtkWidget * gimp_prop_drawable_chooser_new (GObject *config,
const gchar *property_name,
const gchar *chooser_title);

View file

@ -19,6 +19,7 @@ sub drawables_popup {
$help = 'Opens a dialog letting a user choose an drawable.';
&jehan_pdb_misc('2023');
&std_pdb_deprecated ('gimp-items-popup');
@inargs = (
{ name => 'callback', type => 'string', non_empty => 1,
@ -54,6 +55,7 @@ sub drawables_close_popup {
$help = 'Closes an open drawable selection dialog.';
&jehan_pdb_misc('2023');
&std_pdb_deprecated ('gimp-items-close-popup');
@inargs = (
{ name => 'callback', type => 'string', non_empty => 1,
@ -77,6 +79,7 @@ sub drawables_set_popup {
$help = $blurb;
&jehan_pdb_misc('2023');
&std_pdb_deprecated ('gimp-items-set-popup');
@inargs = (
{ name => 'callback', type => 'string', non_empty => 1,