kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=bc9867379cf6689fc8861e07148fd9010a0e5262

commit bc9867379cf6689fc8861e07148fd9010a0e5262
Author: Kim Woelders <[email protected]>
Date:   Fri Mar 18 20:04:16 2022 +0100

    Deprecate imlib_load/save_image_with_error_return()
---
 src/lib/Imlib2.h.in  | 107 +++++++++++++++++++++++++++------------------------
 test/test_load.cpp   |   1 +
 test/test_load_2.cpp |   1 +
 test/test_save.cpp   |   1 +
 4 files changed, 59 insertions(+), 51 deletions(-)

diff --git a/src/lib/Imlib2.h.in b/src/lib/Imlib2.h.in
index b4b26ca..a83f169 100644
--- a/src/lib/Imlib2.h.in
+++ b/src/lib/Imlib2.h.in
@@ -30,11 +30,13 @@
 #endif
 #endif
 
+#ifndef IMLIB2_DEPRECATED
 #ifdef __GNUC__
 #define IMLIB2_DEPRECATED __attribute__((deprecated))
 #else
 #define IMLIB2_DEPRECATED
 #endif
+#endif
 
 #include <stddef.h>
 #ifndef X_DISPLAY_MISSING
@@ -75,26 +77,6 @@ typedef enum {
    IMLIB_TEXT_TO_ANGLE = 4
 } Imlib_Text_Direction;
 
-typedef enum {
-   IMLIB_LOAD_ERROR_NONE,
-   IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST,
-   IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY,
-   IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ,
-   IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT,
-   IMLIB_LOAD_ERROR_PATH_TOO_LONG,
-   IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT,
-   IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY,
-   IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE,
-   IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS,
-   IMLIB_LOAD_ERROR_OUT_OF_MEMORY,
-   IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS,
-   IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE,
-   IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE,
-   IMLIB_LOAD_ERROR_UNKNOWN,
-   IMLIB_LOAD_ERROR_IMAGE_READ,
-   IMLIB_LOAD_ERROR_IMAGE_FRAME
-} Imlib_Load_Error;
-
 #define IMLIB_ERR_INTERNAL      -1      /* Internal error (should not happen) 
*/
 #define IMLIB_ERR_NO_LOADER     -2      /* No loader for file format */
 #define IMLIB_ERR_NO_SAVER      -3      /* No saver for file format */
@@ -800,22 +782,6 @@ EAPI Imlib_Image    imlib_load_image_without_cache(const 
char *file);
 EAPI Imlib_Image    imlib_load_image_immediately_without_cache(const char
                                                                *file);
 
-/**
- * Load an image from file with error return
- *
- * The image is loaded without deferred image data decoding.
- *
- * On error @p error_return is set to the detail of the error.
- *
- * @param file          File name
- * @param error_return  The returned error
- *
- * @return Image handle (NULL on failure)
- */
-EAPI Imlib_Image    imlib_load_image_with_error_return(const char *file,
-                                                       Imlib_Load_Error *
-                                                       error_return);
-
 /**
  * Load an image from file with error return
  *
@@ -1314,7 +1280,8 @@ EAPI Imlib_Image    imlib_create_image_using_data(int 
width, int height,
  * @return Image handle (NULL on failure)
  */
 EAPI Imlib_Image    imlib_create_image_using_data_and_memory_function
-   (int width, int height, DATA32 * data, Imlib_Image_Data_Memory_Function 
func);
+   (int width, int height, DATA32 * data,
+    Imlib_Image_Data_Memory_Function func);
 
 /**
  * Create a new image using given pixel data
@@ -2558,19 +2525,6 @@ EAPI void           
imlib_image_remove_and_free_attached_data_value(const char
  */
 EAPI void           imlib_save_image(const char *filename);
 
-/**
- * Save image to file with error return
- *
- * Works the same way imlib_save_image() works, but will set the
- * @p error_return to an error value if the save fails.
- *
- * @param filename      The file name
- * @param error_return  The returned error
- */
-EAPI void           imlib_save_image_with_error_return(const char *filename,
-                                                       Imlib_Load_Error *
-                                                       error_return);
-
 /**
  * Save image to file with error return
  *
@@ -2874,6 +2828,58 @@ EAPI const char    *imlib_strerror(int err);
 /*--------------------------------
  * Deprecated functionality
  */
+/* *INDENT-OFF* */
+
+typedef enum {
+   IMLIB_LOAD_ERROR_NONE,
+   IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST,
+   IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY,
+   IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ,
+   IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT,
+   IMLIB_LOAD_ERROR_PATH_TOO_LONG,
+   IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT,
+   IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY,
+   IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE,
+   IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS,
+   IMLIB_LOAD_ERROR_OUT_OF_MEMORY,
+   IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS,
+   IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE,
+   IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE,
+   IMLIB_LOAD_ERROR_UNKNOWN,
+   IMLIB_LOAD_ERROR_IMAGE_READ,
+   IMLIB_LOAD_ERROR_IMAGE_FRAME
+} Imlib_Load_Error;
+
+/**
+ * Load an image from file with error return
+ *
+ * The image is loaded without deferred image data decoding.
+ *
+ * On error @p error_return is set to the detail of the error.
+ *
+ * @param file          File name
+ * @param error_return  The returned error
+ *
+ * @return Image handle (NULL on failure)
+ */
+IMLIB2_DEPRECATED
+EAPI Imlib_Image    imlib_load_image_with_error_return(const char *file,
+                                                       Imlib_Load_Error *
+                                                       error_return);
+
+/**
+ * Save image to file with error return
+ *
+ * Works the same way imlib_save_image() works, but will set the
+ * @p error_return to an error value if the save fails.
+ *
+ * @param filename      The file name
+ * @param error_return  The returned error
+ */
+IMLIB2_DEPRECATED
+EAPI void           imlib_save_image_with_error_return(const char *filename,
+                                                       Imlib_Load_Error *
+                                                       error_return);
 
 /** Deprecated function - hasn't done anything useful ever */
 IMLIB2_DEPRECATED
@@ -2900,7 +2906,6 @@ EAPI void           
imlib_context_set_TTF_encoding(Imlib_TTF_Encoding encoding);
 IMLIB2_DEPRECATED
 EAPI Imlib_TTF_Encoding imlib_context_get_TTF_encoding(void);
 
-/* *INDENT-OFF* */
 #ifdef __cplusplus
 }
 #endif
diff --git a/test/test_load.cpp b/test/test_load.cpp
index d86e75b..89f68f3 100644
--- a/test/test_load.cpp
+++ b/test/test_load.cpp
@@ -1,6 +1,7 @@
 #include <gtest/gtest.h>
 
 #include "config.h"
+#define IMLIB2_DEPRECATED       // Suppress deprecation warnings
 #include <Imlib2.h>
 
 #include <errno.h>
diff --git a/test/test_load_2.cpp b/test/test_load_2.cpp
index ca73147..129916d 100644
--- a/test/test_load_2.cpp
+++ b/test/test_load_2.cpp
@@ -1,6 +1,7 @@
 #include <gtest/gtest.h>
 
 #include "config.h"
+#define IMLIB2_DEPRECATED       // Suppress deprecation warnings
 #include <Imlib2.h>
 
 #include <fcntl.h>
diff --git a/test/test_save.cpp b/test/test_save.cpp
index 0c80ac3..a8d97e9 100644
--- a/test/test_save.cpp
+++ b/test/test_save.cpp
@@ -1,6 +1,7 @@
 #include <gtest/gtest.h>
 
 #include "config.h"
+#define IMLIB2_DEPRECATED       // Suppress deprecation warnings
 #include <Imlib2.h>
 
 #include "test.h"

-- 


Reply via email to