kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2_loaders.git/commit/?id=eb595062ef3d8763e2ea4697d382568c9c50f188

commit eb595062ef3d8763e2ea4697d382568c9c50f188
Author: Kim Woelders <[email protected]>
Date:   Sat Dec 4 06:22:22 2021 +0100

    Copy updated headers from imlib2
---
 src/modules/loaders/Makefile.am     |  2 +-
 src/modules/loaders/common.h        | 17 +++++++-----
 src/modules/loaders/debug.h         | 32 ++++++++++++++++++++++
 src/modules/loaders/image.h         | 53 +++----------------------------------
 src/modules/loaders/loader_common.h |  1 +
 5 files changed, 47 insertions(+), 58 deletions(-)

diff --git a/src/modules/loaders/Makefile.am b/src/modules/loaders/Makefile.am
index ed8e09e..2e5c392 100644
--- a/src/modules/loaders/Makefile.am
+++ b/src/modules/loaders/Makefile.am
@@ -19,7 +19,7 @@ $(ANI_L) \
 $(EET_L) \
 $(XCF_L)
 
-EXTRA_DIST = common.h image.h loader_common.h
+EXTRA_DIST = common.h debug.h image.h loader_common.h
 
 eet_la_SOURCES      = loader_eet.c
 eet_la_CPPFLAGS     = @EET_CFLAGS@
diff --git a/src/modules/loaders/common.h b/src/modules/loaders/common.h
index 0df2338..ec0ddb4 100644
--- a/src/modules/loaders/common.h
+++ b/src/modules/loaders/common.h
@@ -10,6 +10,16 @@
 #include <math.h>
 #include <time.h>
 
+#if __GNUC__
+#define __PRINTF_N__(no)  __attribute__((__format__(__printf__, (no), (no)+1)))
+#else
+#define __PRINTF_N__(no)
+#endif
+#define __PRINTF__   __PRINTF_N__(1)
+#define __PRINTF_2__ __PRINTF_N__(2)
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
 #define DATABIG unsigned long long
 #define DATA64  unsigned long long
 #define DATA32  unsigned int
@@ -45,13 +55,6 @@
 #define PIXEL_G(argb)  (((argb) >>  8) & 0xff)
 #define PIXEL_B(argb)  (((argb)      ) & 0xff)
 
-#ifdef DO_MMX_ASM
-int                 __imlib_get_cpuid(void);
-
-#define CPUID_MMX (1 << 23)
-#define CPUID_XMM (1 << 25)
-#endif
-
 #define CLIP(x, y, w, h, xx, yy, ww, hh) \
     if (x < (xx)) { w += (x - (xx)); x = (xx); } \
     if (y < (yy)) { h += (y - (yy)); y = (yy); } \
diff --git a/src/modules/loaders/debug.h b/src/modules/loaders/debug.h
new file mode 100644
index 0000000..f6bab08
--- /dev/null
+++ b/src/modules/loaders/debug.h
@@ -0,0 +1,32 @@
+#ifndef IMLIB2_DEDUG_H
+#define IMLIB2_DEDUG_H
+
+#if IMLIB2_DEBUG
+
+#define D(fmt...)     if (__imlib_debug)     __imlib_printf(DBG_PFX, fmt)
+#define DC(M, fmt...) if (__imlib_debug & M) __imlib_printf(DBG_PFX, fmt)
+
+#define DBG_FILE       0x0001
+#define DBG_LOAD       0x0002
+#define DBG_LDR        0x0004
+
+#if __LOADER_COMMON_H
+#undef D
+#define D(fmt...) DC(DBG_LDR, fmt)
+#endif
+
+__EXPORT__ extern unsigned int __imlib_debug;
+
+__EXPORT__ __PRINTF_2__ void __imlib_printf(const char *pfx,
+                                            const char *fmt, ...);
+
+unsigned int        __imlib_time_us(void);
+
+#else
+
+#define D(fmt...)
+#define DC(fmt...)
+
+#endif /* IMLIB2_DEBUG */
+
+#endif /* IMLIB2_DEDUG_H */
diff --git a/src/modules/loaders/image.h b/src/modules/loaders/image.h
index bea4f41..712269e 100644
--- a/src/modules/loaders/image.h
+++ b/src/modules/loaders/image.h
@@ -2,20 +2,10 @@
 #define __IMAGE 1
 
 #include "common.h"
-#ifdef BUILD_X11
-#include <X11/Xlib.h>
-#else
-#ifndef X_DISPLAY_MISSING
-#define X_DISPLAY_MISSING
-#endif
-#endif
 
 typedef struct _imlibimage ImlibImage;
 typedef struct _imlibldctx ImlibLdCtx;
 
-#ifdef BUILD_X11
-typedef struct _imlibimagepixmap ImlibImagePixmap;
-#endif
 typedef struct _imlibborder ImlibBorder;
 typedef struct _imlibloader ImlibLoader;
 typedef struct _imlibimagetag ImlibImageTag;
@@ -71,29 +61,9 @@ struct _imlibimage {
    ImlibImageDataMemoryFunction data_memory_func;
    ImlibLdCtx         *lc;
    FILE               *fp;
+   off_t               fsize;
 };
 
-#ifdef BUILD_X11
-struct _imlibimagepixmap {
-   int                 w, h;
-   Pixmap              pixmap, mask;
-   Display            *display;
-   Visual             *visual;
-   int                 depth;
-   int                 source_x, source_y, source_w, source_h;
-   Colormap            colormap;
-   char                antialias, hi_quality, dither_mask;
-   ImlibBorder         border;
-   ImlibImage         *image;
-   char               *file;
-   char                dirty;
-   int                 references;
-   DATABIG             modification_count;
-   ImlibImagePixmap   *next;
-};
-#endif
-
-void                __imlib_LoadAllLoaders(void);
 void                __imlib_RemoveAllLoaders(void);
 ImlibLoader       **__imlib_GetLoaderList(void);
 ImlibLoader        *__imlib_FindBestLoaderForFile(const char *file,
@@ -134,25 +104,6 @@ int                 __imlib_LoadProgress(ImlibImage * im,
 int                 __imlib_LoadProgressRows(ImlibImage * im,
                                              int row, int nrows);
 
-#ifdef BUILD_X11
-ImlibImagePixmap   *__imlib_ProduceImagePixmap(void);
-void                __imlib_ConsumeImagePixmap(ImlibImagePixmap * ip);
-ImlibImagePixmap   *__imlib_FindCachedImagePixmap(ImlibImage * im, int w, int 
h,
-                                                  Display * d, Visual * v,
-                                                  int depth, int sx, int sy,
-                                                  int sw, int sh, Colormap cm,
-                                                  char aa, char hiq, char 
dmask,
-                                                  DATABIG modification_count);
-ImlibImagePixmap   *__imlib_FindCachedImagePixmapByID(Display * d, Pixmap p);
-void                __imlib_AddImagePixmapToCache(ImlibImagePixmap * ip);
-void                __imlib_RemoveImagePixmapFromCache(ImlibImagePixmap * ip);
-void                __imlib_CleanupImagePixmapCache(void);
-
-ImlibImagePixmap   *__imlib_FindImlibImagePixmapByID(Display * d, Pixmap p);
-void                __imlib_FreePixmap(Display * d, Pixmap p);
-void                __imlib_DirtyPixmapsForImage(ImlibImage * im);
-#endif
-
 void                __imlib_AttachTag(ImlibImage * im, const char *key,
                                       int val, void *data,
                                       ImlibDataDestructorFunction destructor);
@@ -174,6 +125,8 @@ int                 __imlib_CurrentCacheSize(void);
 
 #define SET_FLAG(flags, f) ((flags) |= (f))
 #define UNSET_FLAG(flags, f) ((flags) &= (~f))
+#define UPDATE_FLAG(flags, f, set) \
+   do { if (set) SET_FLAG(flags, f); else UNSET_FLAG(flags, f); } while(0)
 
 #define LOAD_FAIL       0
 #define LOAD_SUCCESS    1
diff --git a/src/modules/loaders/loader_common.h 
b/src/modules/loaders/loader_common.h
index d1716c9..512ade8 100644
--- a/src/modules/loaders/loader_common.h
+++ b/src/modules/loaders/loader_common.h
@@ -3,6 +3,7 @@
 
 #include "config.h"
 #include "common.h"
+#include "debug.h"
 #include "image.h"
 
 __EXPORT__ char     load(ImlibImage * im, ImlibProgressFunction progress,

-- 


Reply via email to