[gimp] libgimp: remove more deprecated API



commit 9e771d8cd5338b00f5a7ff7eb615d8147640596b
Author: Michael Natterer <mitch gimp org>
Date:   Tue Sep 3 11:10:43 2019 +0200

    libgimp: remove more deprecated API

 libgimp/gimp.def           |  2 --
 libgimp/gimpdrawable.c     | 16 ----------
 libgimp/gimpdrawable.h     |  3 --
 libgimp/gimpitem.c         | 24 ---------------
 libgimp/gimpitem.h         | 45 +++++++++++----------------
 libgimp/gimpitemcombobox.c | 76 ++--------------------------------------------
 libgimp/gimpitemcombobox.h | 19 ------------
 libgimp/gimpui.def         |  1 -
 8 files changed, 19 insertions(+), 167 deletions(-)
---
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 3e85ee6959..e00b977ae6 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -209,7 +209,6 @@ EXPORTS
        gimp_drawable_get_buffer_deprecated
        gimp_drawable_get_by_id
        gimp_drawable_get_format
-       gimp_drawable_get_format_deprecated
        gimp_drawable_get_pixel
        gimp_drawable_get_shadow_buffer
        gimp_drawable_get_shadow_buffer_deprecated
@@ -495,7 +494,6 @@ EXPORTS
        gimp_item_detach_parasite
        gimp_item_get_by_id
        gimp_item_get_children
-       gimp_item_get_children_deprecated
        gimp_item_get_color_tag
        gimp_item_get_expanded
        gimp_item_get_id
diff --git a/libgimp/gimpdrawable.c b/libgimp/gimpdrawable.c
index d5b803a210..dff2381fd5 100644
--- a/libgimp/gimpdrawable.c
+++ b/libgimp/gimpdrawable.c
@@ -485,19 +485,3 @@ gimp_drawable_get_shadow_buffer_deprecated (gint32 drawable_ID)
 {
   return gimp_drawable_get_shadow_buffer (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)));
 }
-
-/**
- * gimp_drawable_get_format_deprecated: (skip)
- * @drawable_ID: the ID of the #GimpDrawable to get the format for.
- *
- * Returns the #Babl format of the drawable.
- *
- * Returns: The #Babl format.
- *
- * Since: 2.10
- */
-const Babl *
-gimp_drawable_get_format_deprecated (gint32 drawable_ID)
-{
-  return gimp_drawable_get_format (GIMP_DRAWABLE (gimp_item_get_by_id (drawable_ID)));
-}
diff --git a/libgimp/gimpdrawable.h b/libgimp/gimpdrawable.h
index 2041fb1c5d..22c80a660b 100644
--- a/libgimp/gimpdrawable.h
+++ b/libgimp/gimpdrawable.h
@@ -109,7 +109,6 @@ GdkPixbuf    * gimp_drawable_get_sub_thumbnail      (GimpDrawable  *drawable,
 
 #define gimp_drawable_get_buffer             gimp_drawable_get_buffer_deprecated
 #define gimp_drawable_get_shadow_buffer      gimp_drawable_get_shadow_buffer_deprecated
-#define gimp_drawable_get_format             gimp_drawable_get_format_deprecated
 
 #endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
 
@@ -117,8 +116,6 @@ GdkPixbuf    * gimp_drawable_get_sub_thumbnail      (GimpDrawable  *drawable,
 GeglBuffer * gimp_drawable_get_buffer_deprecated             (gint32         drawable_ID);
 GeglBuffer * gimp_drawable_get_shadow_buffer_deprecated      (gint32         drawable_ID);
 
-const Babl * gimp_drawable_get_format_deprecated             (gint32         drawable_ID);
-
 
 G_END_DECLS
 
diff --git a/libgimp/gimpitem.c b/libgimp/gimpitem.c
index acdc8cb2ca..e88e1c6a14 100644
--- a/libgimp/gimpitem.c
+++ b/libgimp/gimpitem.c
@@ -422,27 +422,3 @@ gimp_item_list_children (GimpItem *item)
 
   return g_list_reverse (children);
 }
-
-/**
- * gimp_item_get_children_deprecated: (skip)
- * @item_id: The item.
- * @num_children: (out): The item's number of children.
- *
- * Returns the item's list of children.
- *
- * This procedure returns the list of items which are children of the
- * specified item. The order is topmost to bottommost.
- *
- * Returns: (array length=num_children) (element-type gint32) (transfer full):
- *          The item's list of children.
- *          The returned value must be freed with g_free().
- *
- * Since: 2.8
- **/
-gint *
-gimp_item_get_children_deprecated (gint32    item_id,
-                                   gint     *num_children)
-{
-  return _gimp_item_get_children (gimp_item_get_by_id (item_id),
-                                  num_children);
-}
diff --git a/libgimp/gimpitem.h b/libgimp/gimpitem.h
index c7ebd67519..8aa76586ba 100644
--- a/libgimp/gimpitem.h
+++ b/libgimp/gimpitem.h
@@ -65,34 +65,23 @@ struct _GimpItemClass
 };
 
 
-GType         gimp_item_get_type      (void) G_GNUC_CONST;
-
-gint32        gimp_item_get_id        (GimpItem     *item);
-GimpItem    * gimp_item_get_by_id     (gint32        item_id);
-
-gboolean      gimp_item_is_valid      (GimpItem     *item);
-gboolean      gimp_item_is_drawable   (GimpItem     *item);
-gboolean      gimp_item_is_layer      (GimpItem     *item);
-gboolean      gimp_item_is_text_layer (GimpItem     *item);
-gboolean      gimp_item_is_channel    (GimpItem     *item);
-gboolean      gimp_item_is_layer_mask (GimpItem     *item);
-gboolean      gimp_item_is_selection  (GimpItem     *item);
-gboolean      gimp_item_is_vectors    (GimpItem     *item);
-
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
-GimpItem   ** gimp_item_get_children  (GimpItem     *item,
-                                       gint         *num_children);
-GList       * gimp_item_list_children (GimpItem     *item);
-
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define gimp_item_get_children gimp_item_get_children_deprecated
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-gint        * gimp_item_get_children_deprecated (gint32  item_id,
-                                                 gint   *num_children);
+GType       gimp_item_get_type      (void) G_GNUC_CONST;
+
+gint32      gimp_item_get_id        (GimpItem *item);
+GimpItem  * gimp_item_get_by_id     (gint32    item_id);
+
+gboolean    gimp_item_is_valid      (GimpItem *item);
+gboolean    gimp_item_is_drawable   (GimpItem *item);
+gboolean    gimp_item_is_layer      (GimpItem *item);
+gboolean    gimp_item_is_text_layer (GimpItem *item);
+gboolean    gimp_item_is_channel    (GimpItem *item);
+gboolean    gimp_item_is_layer_mask (GimpItem *item);
+gboolean    gimp_item_is_selection  (GimpItem *item);
+gboolean    gimp_item_is_vectors    (GimpItem *item);
+
+GimpItem ** gimp_item_get_children  (GimpItem *item,
+                                     gint     *num_children);
+GList     * gimp_item_list_children (GimpItem *item);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpitemcombobox.c b/libgimp/gimpitemcombobox.c
index d7b8a80a66..3931a18ff2 100644
--- a/libgimp/gimpitemcombobox.c
+++ b/libgimp/gimpitemcombobox.c
@@ -60,8 +60,6 @@ struct _GimpItemComboBoxPrivate
 {
   GimpItemConstraintFunc  constraint;
   gpointer                data;
-
-  GimpItemConstraintDeprecatedFunc  constraint_d;
 };
 
 typedef struct _GimpDrawableComboBoxClass GimpDrawableComboBoxClass;
@@ -462,9 +460,8 @@ gimp_item_combo_box_model_add (GimpIntComboBox *combo_box,
       GimpItem *item    = list->data;
       gint32    item_id = gimp_item_get_id (item);
 
-      if ((! private->constraint && ! private->constraint_d)                                ||
-          (private->constraint && (* private->constraint) (image, item, private->data)) ||
-          (private->constraint_d && (* private->constraint_d) (gimp_image_get_id (image), item_id, 
private->data)))
+      if (! private->constraint ||
+          private->constraint (image, item, private->data))
         {
           gchar     *image_name = gimp_image_get_name (image);
           gchar     *item_name  = gimp_item_get_name (item);
@@ -599,72 +596,3 @@ gimp_item_combo_box_changed (GimpIntComboBox *combo_box)
         }
     }
 }
-
-
-/* Deprecated API. */
-
-
-static GtkWidget * gimp_item_combo_box_new_deprecated (GType                            type,
-                                                       GimpItemConstraintDeprecatedFunc constraint,
-                                                       gpointer                         data,
-                                                       GDestroyNotify                   data_destroy);
-
-/**
- * gimp_drawable_combo_box_new_deprecated: (skip)
- * @constraint:   a #GimpItemConstraintDeprecatedFunc or %NULL
- * @data  :       a pointer that is passed to @constraint
- * @data_destroy: Destroy function for @data
- *
- * Creates a new #GimpIntComboBox filled with all currently opened
- * drawables. If a @constraint function is specified, it is called for
- * each drawable and only if the function returns %TRUE, the drawable
- * is added to the combobox.
- *
- * You should use gimp_int_combo_box_connect() to initialize and connect
- * the combo.  Use gimp_int_combo_box_set_active() to get the active
- * drawable ID and gimp_int_combo_box_get_active() to retrieve the ID
- * of the selected drawable.
- *
- * Returns: a new #GimpIntComboBox.
- *
- * Since: 2.2
- **/
-GtkWidget *
-gimp_drawable_combo_box_new_deprecated (GimpItemConstraintDeprecatedFunc constraint,
-                                        gpointer                         data,
-                                        GDestroyNotify                   data_destroy)
-{
-  return gimp_item_combo_box_new_deprecated (GIMP_TYPE_DRAWABLE_COMBO_BOX,
-                                             constraint, data, data_destroy);
-}
-
-static GtkWidget *
-gimp_item_combo_box_new_deprecated (GType                            type,
-                                    GimpItemConstraintDeprecatedFunc constraint,
-                                    gpointer                         data,
-                                    GDestroyNotify                   data_destroy)
-{
-  GimpIntComboBox         *combo_box;
-  GimpItemComboBoxPrivate *private;
-
-  combo_box = g_object_new (type,
-                            "width-request", WIDTH_REQUEST,
-                            "ellipsize",     PANGO_ELLIPSIZE_MIDDLE,
-                            NULL);
-
-  private = GET_PRIVATE (combo_box);
-
-  private->constraint_d = constraint;
-  private->data         = data;
-
-  if (data_destroy)
-    g_object_weak_ref (G_OBJECT (combo_box), (GWeakNotify) data_destroy, data);
-
-  gimp_item_combo_box_populate (combo_box);
-
-  g_signal_connect (combo_box, "changed",
-                    G_CALLBACK (gimp_item_combo_box_changed),
-                    NULL);
-
-  return GTK_WIDGET (combo_box);
-}
diff --git a/libgimp/gimpitemcombobox.h b/libgimp/gimpitemcombobox.h
index 83e9685fd5..2f44609082 100644
--- a/libgimp/gimpitemcombobox.h
+++ b/libgimp/gimpitemcombobox.h
@@ -55,8 +55,6 @@ GType       gimp_layer_combo_box_get_type    (void) G_GNUC_CONST;
 GType       gimp_vectors_combo_box_get_type  (void) G_GNUC_CONST;
 
 
-#ifndef GIMP_DEPRECATED_REPLACE_NEW_API
-
 typedef gboolean (* GimpItemConstraintFunc) (GimpImage *image,
                                              GimpItem  *item,
                                              gpointer   data);
@@ -74,23 +72,6 @@ GtkWidget * gimp_vectors_combo_box_new  (GimpItemConstraintFunc constraint,
                                          gpointer               data,
                                          GDestroyNotify         data_destroy);
 
-#else /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-#define GimpItemConstraintFunc      GimpItemConstraintDeprecatedFunc
-#define gimp_drawable_combo_box_new gimp_drawable_combo_box_new_deprecated
-
-#endif /* GIMP_DEPRECATED_REPLACE_NEW_API */
-
-
-typedef gboolean (* GimpItemConstraintDeprecatedFunc) (gint     image_id,
-                                                       gint32   item_id,
-                                                       gpointer data);
-
-
-GtkWidget * gimp_drawable_combo_box_new_deprecated (GimpItemConstraintDeprecatedFunc constraint,
-                                                    gpointer                         data,
-                                                    GDestroyNotify                   data_destroy);
-
 
 G_END_DECLS
 
diff --git a/libgimp/gimpui.def b/libgimp/gimpui.def
index 56e4654116..3d97311b5a 100644
--- a/libgimp/gimpui.def
+++ b/libgimp/gimpui.def
@@ -9,7 +9,6 @@ EXPORTS
        gimp_channel_combo_box_new
        gimp_drawable_combo_box_get_type
        gimp_drawable_combo_box_new
-       gimp_drawable_combo_box_new_deprecated
        gimp_drawable_preview_get_drawable
        gimp_drawable_preview_get_type
        gimp_drawable_preview_new_from_drawable


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]