[EGIT] [core/enlightenment] master 01/01: efm - do same mime lookup method as efm in recents menu

2022-01-27 Thread Carsten Haitzler
raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=18a86f2f6417b8080137f0a18e9e8a18cc5aa0db

commit 18a86f2f6417b8080137f0a18e9e8a18cc5aa0db
Author: Carsten Haitzler 
Date:   Thu Jan 27 17:13:36 2022 +

efm - do same mime lookup method as efm in recents menu

@fix
---
 src/modules/fileman/e_mod_menu.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/modules/fileman/e_mod_menu.c b/src/modules/fileman/e_mod_menu.c
index 6b2af064a..fedbab8e4 100644
--- a/src/modules/fileman/e_mod_menu.c
+++ b/src/modules/fileman/e_mod_menu.c
@@ -406,7 +406,10 @@ _e_mod_menu_recent_cb(void   *data EINA_UNUSED,
 
if (file)
  {
-const char *mime = efreet_mime_type_get(file);
+const char *mime = efreet_mime_special_type_get(file);
+
+if (!mime) mime = efreet_mime_globs_type_get(file);
+if (!mime) mime = efreet_mime_fallback_type_get(file);
 
 if (mime)
   {
@@ -459,7 +462,10 @@ _e_mod_menu_populate_recent_cb(void  *data EINA_UNUSED,
 fname = ecore_file_file_get(fl->file);
 if (fname)
   {
- const char *mime = efreet_mime_type_get(fl->file);
+ const char *mime = efreet_mime_special_type_get(fl->file);
+
+ if (!mime) mime = efreet_mime_globs_type_get(fl->file);
+ if (!mime) mime = efreet_mime_fallback_type_get(fl->file);
 
  mi2 = e_menu_item_new(subm);
  e_menu_item_label_set(mi2, fname);

-- 




[EGIT] [legacy/imlib2] master 01/04: autofoo: Sort loaders

2022-01-27 Thread Kim Woelders
kwo pushed a commit to branch master.

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

commit f9aca8ff43aec5c91aeb755728d715dc8f82bd8c
Author: Kim Woelders 
Date:   Wed Jan 26 22:52:52 2022 +0100

autofoo: Sort loaders
---
 configure.ac|  4 ++--
 src/modules/loaders/Makefile.am | 18 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2636189..79f07da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -194,12 +194,12 @@ loader_check_gif() {
 }
 
 EC_LOADER_CHECK(GIF,  auto, , loader_check_gif)
+EC_LOADER_CHECK(HEIF, auto, libheif)
 EC_LOADER_CHECK(JPEG, auto, libjpeg)
 EC_LOADER_CHECK(PNG,  auto, libpng)
 EC_LOADER_CHECK(SVG,  auto, librsvg-2.0)
 EC_LOADER_CHECK(TIFF, auto, libtiff-4)
 EC_LOADER_CHECK(WEBP, auto, libwebpdemux)
-EC_LOADER_CHECK(HEIF, auto, libheif)
 
 loader_check_bz2() {
   AC_CHECK_LIB(bz2, BZ2_bzRead, bz2_ok=yes, bz2_ok=no)
@@ -274,12 +274,12 @@ echo
 echo "Image loaders:"
 echo " Regular image loaders"
 echo "  GIF.: $gif_ok"
+echo "  HEIF: $heif_ok"
 echo "  JPEG: $jpeg_ok"
 echo "  PNG.: $png_ok"
 echo "  SVG.: $svg_ok"
 echo "  TIFF: $tiff_ok"
 echo "  WEBP: $webp_ok"
-echo "  HEIF: $heif_ok"
 echo " Decompressors"
 echo "  BZIP2...: $bz2_ok"
 echo "  LZMA(XZ): $lzma_ok"
diff --git a/src/modules/loaders/Makefile.am b/src/modules/loaders/Makefile.am
index 6f314ec..8c10efb 100644
--- a/src/modules/loaders/Makefile.am
+++ b/src/modules/loaders/Makefile.am
@@ -17,6 +17,9 @@ xpm.la
 if BUILD_GIF_LOADER
 pkg_LTLIBRARIES += gif.la
 endif
+if BUILD_HEIF_LOADER
+pkg_LTLIBRARIES += heif.la
+endif
 if BUILD_JPEG_LOADER
 pkg_LTLIBRARIES += jpeg.la
 endif
@@ -32,9 +35,6 @@ endif
 if BUILD_WEBP_LOADER
 pkg_LTLIBRARIES += webp.la
 endif
-if BUILD_HEIF_LOADER
-pkg_LTLIBRARIES += heif.la
-endif
 
 if BUILD_BZ2_LOADER
 pkg_LTLIBRARIES += bz2.la
@@ -72,6 +72,12 @@ gif_la_LDFLAGS   = -module -avoid-version
 gif_la_LIBADD= $(GIF_LIBS) $(top_builddir)/src/lib/libImlib2.la
 gif_la_LIBTOOLFLAGS  = --tag=disable-static
 
+heif_la_SOURCES  = loader_heif.c
+heif_la_CPPFLAGS = $(HEIF_CFLAGS) $(AM_CPPFLAGS)
+heif_la_LDFLAGS  = -module -avoid-version
+heif_la_LIBADD   = $(HEIF_LIBS) $(top_builddir)/src/lib/libImlib2.la
+heif_la_LIBTOOLFLAGS = --tag=disable-static
+
 ico_la_SOURCES   = loader_ico.c
 ico_la_LDFLAGS   = -module -avoid-version
 ico_la_LIBADD= $(top_builddir)/src/lib/libImlib2.la
@@ -122,12 +128,6 @@ webp_la_LDFLAGS  = -module -avoid-version
 webp_la_LIBADD   = $(WEBP_LIBS) $(top_builddir)/src/lib/libImlib2.la
 webp_la_LIBTOOLFLAGS = --tag=disable-static
 
-heif_la_SOURCES  = loader_heif.c
-heif_la_CPPFLAGS = $(HEIF_CFLAGS) $(AM_CPPFLAGS)
-heif_la_LDFLAGS  = -module -avoid-version
-heif_la_LIBADD   = $(HEIF_LIBS) $(top_builddir)/src/lib/libImlib2.la
-heif_la_LIBTOOLFLAGS = --tag=disable-static
-
 xbm_la_SOURCES   = loader_xbm.c
 xbm_la_LDFLAGS   = -module -avoid-version
 xbm_la_LIBADD= $(top_builddir)/src/lib/libImlib2.la

-- 




[EGIT] [legacy/imlib2] master 04/04: Mark obsolete TTF encoding functions as deprecated

2022-01-27 Thread Kim Woelders
kwo pushed a commit to branch master.

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

commit c74cb9f1a929838f1e802107c579ff5c9fa1193f
Author: Kim Woelders 
Date:   Thu Jan 27 12:07:07 2022 +0100

Mark obsolete TTF encoding functions as deprecated

and move them to separate file.

Haven't done anything useful for ~20 years.
---
 src/lib/Imlib2.h.in| 42 +++---
 src/lib/Makefile.am|  2 +-
 src/lib/api.c  | 14 --
 src/lib/api_obsolete.c | 16 
 4 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/src/lib/Imlib2.h.in b/src/lib/Imlib2.h.in
index 5b71fbf..aa498fd 100644
--- a/src/lib/Imlib2.h.in
+++ b/src/lib/Imlib2.h.in
@@ -29,6 +29,12 @@
 #endif
 #endif
 
+#ifdef __GNUC__
+#define IMLIB2_DEPRECATED __attribute__((deprecated))
+#else
+#define IMLIB2_DEPRECATED
+#endif
+
 #ifndef X_DISPLAY_MISSING
 #include 
 #endif
@@ -87,15 +93,6 @@ typedef enum {
IMLIB_LOAD_ERROR_IMAGE_FRAME
 } Imlib_Load_Error;
 
-/* Encodings known to Imlib2 (so far) */
-typedef enum {
-   IMLIB_TTF_ENCODING_ISO_8859_1,
-   IMLIB_TTF_ENCODING_ISO_8859_2,
-   IMLIB_TTF_ENCODING_ISO_8859_3,
-   IMLIB_TTF_ENCODING_ISO_8859_4,
-   IMLIB_TTF_ENCODING_ISO_8859_5
-} Imlib_TTF_Encoding;
-
 typedef struct {
int left, right, top, bottom;
 } Imlib_Border;
@@ -165,7 +162,6 @@ EAPI void   
imlib_context_set_progress_granularity(char

progress_granularity);
 EAPI void   imlib_context_set_image(Imlib_Image image);
 EAPI void   imlib_context_set_cliprect(int x, int y, int w, int h);
-EAPI void   imlib_context_set_TTF_encoding(Imlib_TTF_Encoding 
encoding);
 
 /* context getting */
 #ifndef X_DISPLAY_MISSING
@@ -201,7 +197,6 @@ EAPI Imlib_Progress_Function 
imlib_context_get_progress_function(void);
 EAPI char   imlib_context_get_progress_granularity(void);
 EAPI Imlib_Imageimlib_context_get_image(void);
 EAPI void   imlib_context_get_cliprect(int *x, int *y, int *w, int *h);
-EAPI Imlib_TTF_Encoding imlib_context_get_TTF_encoding(void);
 
 EAPI intimlib_get_cache_used(void);
 EAPI intimlib_get_cache_size(void);
@@ -620,6 +615,31 @@ typedef struct {
 EAPI Imlib_Imageimlib_load_image_frame(const char *file, int frame);
 EAPI void   imlib_image_get_frame_info(Imlib_Frame_Info * info);
 
+/*
+ * Deprecated functionality
+ */
+
+/* Encodings known to Imlib2 (so far) */
+typedef enum {
+   IMLIB_TTF_ENCODING_ISO_8859_1,
+   IMLIB_TTF_ENCODING_ISO_8859_2,
+   IMLIB_TTF_ENCODING_ISO_8859_3,
+   IMLIB_TTF_ENCODING_ISO_8859_4,
+   IMLIB_TTF_ENCODING_ISO_8859_5
+} Imlib_TTF_Encoding;
+
+/**
+ * Deprecated function. Hasn't done anything useful in ~20 years.
+ */
+IMLIB2_DEPRECATED
+EAPI void   imlib_context_set_TTF_encoding(Imlib_TTF_Encoding 
encoding);
+
+/**
+ * Deprecated function. Hasn't done anything useful in ~20 years.
+ */
+IMLIB2_DEPRECATED
+EAPI Imlib_TTF_Encoding imlib_context_get_TTF_encoding(void);
+
 /* *INDENT-OFF* */
 #ifdef __cplusplus
 }
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 8fb468c..3f632da 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -11,7 +11,7 @@ AM_CCASFLAGS = -I$(top_builddir)
 lib_LTLIBRARIES  = libImlib2.la
 include_HEADERS  = Imlib2.h
 libImlib2_la_SOURCES = \
-api.c \
+api.c  api_obsolete.c  \
 asm.h \
 asm_c.casm_c.h \
 blend.cblend.h \
diff --git a/src/lib/api.c b/src/lib/api.c
index b2f77c4..9b76fae 100644
--- a/src/lib/api.c
+++ b/src/lib/api.c
@@ -94,7 +94,6 @@ typedef struct {
int mask_alpha_threshold;
Imlib_Filterfilter;
Imlib_Rectangle cliprect;
-   Imlib_TTF_Encoding  encoding;
 
int references;
chardirty;
@@ -118,7 +117,6 @@ typedef struct _ImlibContextItem {
.color.blue = 255,  \
.pixel = 0x,\
.mask_alpha_threshold = 128,\
-   .encoding = IMLIB_TTF_ENCODING_ISO_8859_1,  \
 }
 
 /* A default context, only used for initialization */
@@ -1053,18 +1051,6 @@ imlib_context_get_image(void)
return ctx->image;
 }
 
-EAPI void
-imlib_context_set_TTF_encoding(Imlib_TTF_Encoding encoding)
-{
-   ctx->encoding = encoding;
-}
-
-EAPIImlib_TTF_Encoding
-imlib_context_get_TTF_encoding(void)
-{
-   return ctx->encoding;
-}
-
 /* imlib api */
 
 /**
diff --git a/src/lib/api_obsolete.c b/src/lib/api_obsolete.c
new file mode 100644
index 000..a205a25
--- /dev/null
+++ b/src/lib/api_obsolete.c
@@ -0,0 +1,16 @@
+/*
+ * Obsolete, useless code
+ */
+#include "Imlib2.h"
+
+
+EAPI void
+imlib_context_set_TTF_encoding(Imlib_TTF_Encoding encoding)
+{
+}
+
+EAPIImlib_TTF_Encoding
+imlib_context_get_TTF_

[EGIT] [legacy/imlib2] master 03/04: HEIF loader: Avoid memory leak when module is loaded more than once

2022-01-27 Thread Kim Woelders
kwo pushed a commit to branch master.

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

commit 3157181bc33c7c5c8f3f434f8021cbcc7538d924
Author: Kim Woelders 
Date:   Fri Jan 28 06:57:50 2022 +0100

HEIF loader: Avoid memory leak when module is loaded more than once

Memory leak can be reproduced by running valgrind on test_load (which
calls imlib_flush_loaders()).
---
 src/modules/loaders/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/loaders/Makefile.am b/src/modules/loaders/Makefile.am
index 8c10efb..291beb4 100644
--- a/src/modules/loaders/Makefile.am
+++ b/src/modules/loaders/Makefile.am
@@ -74,7 +74,7 @@ gif_la_LIBTOOLFLAGS  = --tag=disable-static
 
 heif_la_SOURCES  = loader_heif.c
 heif_la_CPPFLAGS = $(HEIF_CFLAGS) $(AM_CPPFLAGS)
-heif_la_LDFLAGS  = -module -avoid-version
+heif_la_LDFLAGS  = -module -avoid-version -Wl,-z,nodelete
 heif_la_LIBADD   = $(HEIF_LIBS) $(top_builddir)/src/lib/libImlib2.la
 heif_la_LIBTOOLFLAGS = --tag=disable-static
 

-- 




[EGIT] [legacy/imlib2] master 02/04: SVG loader: Fix memory leak on error

2022-01-27 Thread Kim Woelders
kwo pushed a commit to branch master.

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

commit 91a2ab9b14f0eee93f39a4b0a8d82b74dce19ca2
Author: Kim Woelders 
Date:   Thu Jan 27 20:16:21 2022 +0100

SVG loader: Fix memory leak on error
---
 src/modules/loaders/loader_svg.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/src/modules/loaders/loader_svg.c b/src/modules/loaders/loader_svg.c
index 78ddd73..afae530 100644
--- a/src/modules/loaders/loader_svg.c
+++ b/src/modules/loaders/loader_svg.c
@@ -32,6 +32,13 @@ u2pix(double x, int unit)
  }
 }
 
+static void
+_handle_error(GError * error)
+{
+   D("librsvg2: %s\n", error->message);
+   g_error_free(error);
+}
+
 int
 load2(ImlibImage * im, int load_data)
 {
@@ -179,6 +186,8 @@ load2(ImlibImage * im, int load_data)
rc = LOAD_SUCCESS;
 
  quit:
+   if (error)
+  _handle_error(error);
if (surface)
   cairo_surface_destroy(surface);
if (cr)

--