From 1d9245b3f6dfff9c92bc1caf5678e96147e46f16 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Fri, 11 Nov 2005 06:49:57 +0000 Subject: [PATCH] edje no longer needs imlib2. SVN revision: 18425 --- legacy/edje/README | 3 +- legacy/edje/configure.in | 16 --- legacy/edje/debian/control | 2 +- legacy/edje/edje-native.oe | 3 +- legacy/edje/edje.bb | 3 +- legacy/edje/edje.c.in | 13 --- legacy/edje/edje.oe | 3 +- legacy/edje/edje.pc.in | 2 +- legacy/edje/edje.spec.in | 4 +- legacy/edje/edjeXnative.bb | 3 +- legacy/edje/src/bin/Makefile.am | 10 +- legacy/edje/src/bin/edje_cc.c | 27 ----- legacy/edje/src/bin/edje_cc.h | 7 -- legacy/edje/src/bin/edje_cc_out.c | 163 +++++++++--------------------- legacy/edje/src/bin/edje_decc.c | 69 +++++-------- legacy/edje/src/bin/edje_decc.h | 4 - legacy/edje/src/bin/edje_thumb.c | 66 +++++------- legacy/edje/src/bin/edje_thumb.h | 4 - 18 files changed, 115 insertions(+), 287 deletions(-) diff --git a/legacy/edje/README b/legacy/edje/README index a3e3c5011f..60e9f40c25 100644 --- a/legacy/edje/README +++ b/legacy/edje/README @@ -48,8 +48,7 @@ Quick start-up guide: sudo make install cd -5. You need imlib2 installed. any release from 1.0.0 on will do. -6. You already have Edje. now build it: +5. You already have Edje. now build it: ./autogen.sh make diff --git a/legacy/edje/configure.in b/legacy/edje/configure.in index fbb48b737b..ec70a9881b 100644 --- a/legacy/edje/configure.in +++ b/legacy/edje/configure.in @@ -142,14 +142,6 @@ AC_PATH_GENERIC(embryo, 0.9.1, EMBRYO_PREFIX=`$EMBRYO_CONFIG --prefix` AC_DEFINE_UNQUOTED(EMBRYO_PREFIX, "${EMBRYO_PREFIX}", [Embryo prefix]) -if test "x$have_edje_cc" = "xyes"; then - AC_PATH_GENERIC(imlib2, 1.0.0, - [ have_imlib2="yes"], - [ have_imlib2="no" ], - ) - AC_DEFINE(HAVE_IMLIB, 1, [Imlib2 is installed]) -fi - AC_MSG_CHECKING([for location of Vim data files]) install_vim="yes"; AC_ARG_WITH(vim, @@ -229,11 +221,3 @@ debian/changelog ],[ chmod +x edje-config ]) - -if test "x$have_edje_cc" = "xyes"; then - if test "x$have_imlib2" = "xno"; then - echo - echo "WARNING: Building edje_cc without Imlib2 support!" - echo - fi -fi diff --git a/legacy/edje/debian/control b/legacy/edje/debian/control index 13f15ec44b..6fb3ea5c24 100644 --- a/legacy/edje/debian/control +++ b/legacy/edje/debian/control @@ -2,7 +2,7 @@ Source: edje Section: libs Priority: optional Maintainer: Sytse Wielinga -Build-Depends: libimlib2-dev, libeet-dev, libecore-dev, libevas-dev, libembryo-dev, debhelper (>> 4.0.0), automake-1.7 | automaken, libtool +Build-Depends: libeet-dev, libecore-dev, libevas-dev, libembryo-dev, debhelper (>> 4.0.0), automake-1.7 | automaken, libtool Standards-Version: 3.6.1.0 Package: edje0-bin diff --git a/legacy/edje/edje-native.oe b/legacy/edje/edje-native.oe index a58b2cd08e..a9cf988b41 100644 --- a/legacy/edje/edje-native.oe +++ b/legacy/edje/edje-native.oe @@ -6,7 +6,7 @@ SECTION = "e/libs" PRIORITY = "optional" include edje.oe inherit native -DEPENDS = "evas-native ecore-native embryo-native eet-native imlib2-native" +DEPENDS = "evas-native ecore-native embryo-native eet-native" EXTRA_OECONF = "--enable-fb-only" @@ -16,7 +16,6 @@ export FREETYPE_CONFIG = "${STAGING_BINDIR}/freetype-config-native" export EVAS_CONFIG = "${STAGING_BINDIR}/evas-config-native" export ECORE_CONFIG = "${STAGING_BINDIR}/ecore-config-native" export EMBRYO_CONFIG = "${STAGING_BINDIR}/embryo-config-native" -export IMLIB2_CONFIG = "${STAGING_BINDIR}/imlib2-config-native" do_stage() { for i in edje edje_ls edje_cc; do diff --git a/legacy/edje/edje.bb b/legacy/edje/edje.bb index 94ce7cbb2f..3b1b00693f 100644 --- a/legacy/edje/edje.bb +++ b/legacy/edje/edje.bb @@ -4,7 +4,7 @@ HOMEPAGE = "http://www.enlightenment.org" MAINTAINER = "Carsten Haitzler (Rasterman) " SECTION = "e/libs" PRIORITY = "optional" -DEPENDS = "evas ecore embryo eet imlib2" +DEPENDS = "evas ecore embryo eet" PV = "0.5.0" PR = "1" @@ -22,7 +22,6 @@ export EET_CONFIG = "${STAGING_BINDIR}/eet-config" export EVAS_CONFIG = "${STAGING_BINDIR}/evas-config" export ECORE_CONFIG = "${STAGING_BINDIR}/ecore-config" export EMBRYO_CONFIG = "${STAGING_BINDIR}/embryo-config" -export IMLIB2_CONFIG = "${STAGING_BINDIR}/imlib2-config" LEAD_SONAME = "libedje.so" diff --git a/legacy/edje/edje.c.in b/legacy/edje/edje.c.in index 4885620025..45a8182214 100644 --- a/legacy/edje/edje.c.in +++ b/legacy/edje/edje.c.in @@ -80,10 +80,6 @@ you need: - Ecore (library) - Eet (library) -To fully build Edje and run the Edje builder (edje_cc) you also need: - - - Imlib2 (library) - Evas needs to be build with the PNG and EET image loaders enabled at a minimum. Edje uses X for the test program, so you will need the SOFTWARE_X11 engine built into Evas as well. A suggested configure list is below in the @@ -95,12 +91,6 @@ definitely optional. Eet has no options so just build and install it. -Imlib2 has options, but it will probably select the right ones when you build -and install it. You really want as many image loaders enabled as you can -manage. It's suggested at a minimum to have the PNG and JPEG loaders, but -include whatever loaders correspond to the image formats you want supported -for loading up and including into an Edje compiled file. - It is suggested right now that you get the latest CVS versions of the required libraries. You also need to build them in the right order and make sure the right options are enabled in the required libraries. Here is a @@ -147,9 +137,6 @@ quick "cheat sheet" on how to get started. sudo make install cd - -5. You need Imlib2 installed. Any release from 1.0.0 and up will do. - @endverbatim diff --git a/legacy/edje/edje.oe b/legacy/edje/edje.oe index 79ed2f3734..2439bb8ca9 100644 --- a/legacy/edje/edje.oe +++ b/legacy/edje/edje.oe @@ -4,7 +4,7 @@ HOMEPAGE = "http://www.enlightenment.org" MAINTAINER = "Carsten Haitzler (Rasterman) " SECTION = "e/libs" PRIORITY = "optional" -DEPENDS = "evas ecore embryo eet imlib2" +DEPENDS = "evas ecore embryo eet" PV = "0.5.0" PR = "1" @@ -22,7 +22,6 @@ export EET_CONFIG = "${STAGING_BINDIR}/eet-config" export EVAS_CONFIG = "${STAGING_BINDIR}/evas-config" export ECORE_CONFIG = "${STAGING_BINDIR}/ecore-config" export EMBRYO_CONFIG = "${STAGING_BINDIR}/embryo-config" -export IMLIB2_CONFIG = "${STAGING_BINDIR}/imlib2-config" LEAD_SONAME = "libedje.so" diff --git a/legacy/edje/edje.pc.in b/legacy/edje/edje.pc.in index b322415b8e..f8949fbac7 100644 --- a/legacy/edje/edje.pc.in +++ b/legacy/edje/edje.pc.in @@ -6,7 +6,7 @@ datadir=@datadir@/edje Name: edje Description: Enlightened graphical design and layout engine. -Requires: ecore evas eet imlib2 +Requires: ecore evas eet Version: @VERSION@ Libs: -L${libdir} -ledje Cflags: -I${includedir} diff --git a/legacy/edje/edje.spec.in b/legacy/edje/edje.spec.in index 781af086d6..936c2dc36c 100644 --- a/legacy/edje/edje.spec.in +++ b/legacy/edje/edje.spec.in @@ -13,7 +13,7 @@ Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:The Enlightenment Project Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} #BuildSuggests: xorg-x11-devel vim-enhanced BuildRequires: libjpeg-devel zlib-devel eet-devel XFree86-devel -BuildRequires: embryo-devel imlib2-devel >= 1.2.0 evas-devel ecore-devel +BuildRequires: embryo-devel evas-devel ecore-devel BuildRoot: %{_tmppath}/%{name}-%{version}-root %description @@ -37,7 +37,7 @@ Summary: Edje headers, static libraries, documentation and test programs Group: System Environment/Libraries Requires: %{name} = %{version} Requires: libjpeg-devel zlib-devel eet-devel XFree86-devel -Requires: embryo-devel imlib2-devel >= 1.2.0 evas-devel ecore-devel +Requires: embryo-devel evas-devel ecore-devel %description devel Headers, static libraries, test programs and documentation for Edje diff --git a/legacy/edje/edjeXnative.bb b/legacy/edje/edjeXnative.bb index a58b2cd08e..a9cf988b41 100644 --- a/legacy/edje/edjeXnative.bb +++ b/legacy/edje/edjeXnative.bb @@ -6,7 +6,7 @@ SECTION = "e/libs" PRIORITY = "optional" include edje.oe inherit native -DEPENDS = "evas-native ecore-native embryo-native eet-native imlib2-native" +DEPENDS = "evas-native ecore-native embryo-native eet-native" EXTRA_OECONF = "--enable-fb-only" @@ -16,7 +16,6 @@ export FREETYPE_CONFIG = "${STAGING_BINDIR}/freetype-config-native" export EVAS_CONFIG = "${STAGING_BINDIR}/evas-config-native" export ECORE_CONFIG = "${STAGING_BINDIR}/ecore-config-native" export EMBRYO_CONFIG = "${STAGING_BINDIR}/embryo-config-native" -export IMLIB2_CONFIG = "${STAGING_BINDIR}/imlib2-config-native" do_stage() { for i in edje edje_ls edje_cc; do diff --git a/legacy/edje/src/bin/Makefile.am b/legacy/edje/src/bin/Makefile.am index 2fbebcf641..5f9e881d0c 100644 --- a/legacy/edje/src/bin/Makefile.am +++ b/legacy/edje/src/bin/Makefile.am @@ -7,7 +7,6 @@ INCLUDES = \ @EET_CFLAGS@ \ @EVAS_CFLAGS@ \ @ECORE_CFLAGS@ \ -@IMLIB2_CFLAGS@ \ @EMBRYO_CFLAGS@ bin_SCRIPTS = \ @@ -49,8 +48,7 @@ edje_cc_handlers.c \ edje_cc_sources.c edje_cc_LDADD = \ -$(top_builddir)/src/lib/libedje.la \ -@IMLIB2_LIBS@ +$(top_builddir)/src/lib/libedje.la edje_cc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la @@ -62,8 +60,7 @@ edje_cc_mem.c \ edje_cc_sources.c edje_decc_LDADD = \ -$(top_builddir)/src/lib/libedje.la \ -@IMLIB2_LIBS@ +$(top_builddir)/src/lib/libedje.la edje_decc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la @@ -73,8 +70,7 @@ edje_thumb.c \ edje_thumb.h edje_thumb_LDADD = \ -$(top_builddir)/src/lib/libedje.la \ -@IMLIB2_LIBS@ +$(top_builddir)/src/lib/libedje.la edje_thumb_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la diff --git a/legacy/edje/src/bin/edje_cc.c b/legacy/edje/src/bin/edje_cc.c index 6c658290cc..0abb83aa90 100644 --- a/legacy/edje/src/bin/edje_cc.c +++ b/legacy/edje/src/bin/edje_cc.c @@ -19,9 +19,6 @@ int no_comp = 0; int no_raw = 0; int min_quality = 0; int max_quality = 100; -int scale_lossy = 100; -int scale_comp = 100; -int scale_raw = 100; static void main_help(void) @@ -40,9 +37,6 @@ main_help(void) "-no-raw Do NOT allow images to be stored with zero compression (raw)\n" "-min-quality VAL Do NOT allow lossy images with quality < VAL (0-100)\n" "-max-quality VAL Do NOT allow lossy images with quality > VAL (0-100)\n" - "-scale-lossy VAL Scale lossy image pixels by this percentage factor (0 - 100)\n" - "-scale-comp VAL Scale lossless compressed image pixels by this percentage factor (0 - 100)\n" - "-scale-raw VAL Scale uncompressed (raw) image pixels by this percentage factor (0 - 100)\n" "-Ddefine_val=to CPP style define to define input macro definitions to the .edc source\n" ,progname); } @@ -104,27 +98,6 @@ main(int argc, char **argv) if (max_quality < 0) max_quality = 0; if (max_quality > 100) max_quality = 100; } - else if ((!strcmp(argv[i], "-scale-lossy")) && (i < (argc - 1))) - { - i++; - scale_lossy = atoi(argv[i]); - if (scale_lossy < 0) scale_lossy = 0; - if (scale_lossy > 100) scale_lossy = 100; - } - else if ((!strcmp(argv[i], "-scale-comp")) && (i < (argc - 1))) - { - i++; - scale_comp = atoi(argv[i]); - if (scale_comp < 0) scale_comp = 0; - if (scale_comp > 100) scale_comp = 100; - } - else if ((!strcmp(argv[i], "-scale-raw")) && (i < (argc - 1))) - { - i++; - scale_raw = atoi(argv[i]); - if (scale_raw < 0) scale_raw = 0; - if (scale_raw > 100) scale_raw = 100; - } else if (!strncmp(argv[i], "-D", 2)) { defines = evas_list_append(defines, mem_strdup(argv[i])); diff --git a/legacy/edje/src/bin/edje_cc.h b/legacy/edje/src/bin/edje_cc.h index 06b8277f2c..d489f76315 100644 --- a/legacy/edje/src/bin/edje_cc.h +++ b/legacy/edje/src/bin/edje_cc.h @@ -2,10 +2,6 @@ #define EDJE_CC_H #include "edje_main.h" -/* Imlib2 stuff for loading up input images */ -#define X_DISPLAY_MISSING -#include -/* done Imlib2 stuff */ #include #include @@ -136,9 +132,6 @@ extern int no_comp; extern int no_raw; extern int min_quality; extern int max_quality; -extern int scale_lossy; -extern int scale_comp; -extern int scale_raw; extern int line; extern Evas_List *stack; extern Evas_List *params; diff --git a/legacy/edje/src/bin/edje_cc_out.c b/legacy/edje/src/bin/edje_cc_out.c index ac97cec697..21e874e03c 100644 --- a/legacy/edje/src/bin/edje_cc_out.c +++ b/legacy/edje/src/bin/edje_cc_out.c @@ -308,9 +308,15 @@ data_write(void) free(fdata); } } -#ifdef HAVE_IMLIB if ((edje_file) && (edje_file->image_dir)) { + Ecore_Evas *ee; + Evas *evas; + + ecore_init(); + ecore_evas_init(); + ee = ecore_evas_buffer_new(1, 1); + evas = ecore_evas_get(ee); for (l = edje_file->image_dir->entries; l; l = l->next) { Edje_Image_Directory_Entry *img; @@ -318,70 +324,53 @@ data_write(void) img = l->data; if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) { - Imlib_Image im; - Evas_List *l; + Evas_Object *im; + Evas_List *ll; im = NULL; - imlib_set_cache_size(0); - for (l = img_dirs; l; l = l->next) + for (ll = img_dirs; ll; ll = ll->next) { char buf[4096]; snprintf(buf, sizeof(buf), "%s/%s", - (char *)(l->data), img->entry); - im = imlib_load_image(buf); - if (im) break; + (char *)(ll->data), img->entry); + im = evas_object_image_add(evas); + if (im) + { + evas_object_image_file_set(im, buf, NULL); + if (evas_object_image_load_error_get(im) == + EVAS_LOAD_ERROR_NONE) + { + break; + } + evas_object_del(im); + im = NULL; + } + } + if (!im) + { + im = evas_object_image_add(evas); + if (im) + { + evas_object_image_file_set(im, img->entry, NULL); + if (evas_object_image_load_error_get(im) != + EVAS_LOAD_ERROR_NONE) + { + evas_object_del(im); + im = NULL; + } + } } - if (!im) im = imlib_load_image(img->entry); if (im) { - DATA32 *im_data; + void *im_data; int im_w, im_h; int im_alpha; char buf[256]; - imlib_context_set_image(im); - im_w = imlib_image_get_width(); - im_h = imlib_image_get_height(); - if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) && - (img->source_param == 0) && - (scale_raw != 100)) - { - im = imlib_create_cropped_scaled_image(0, 0, - im_w, im_h, - (im_w * scale_raw) / 100, - (im_h * scale_raw) / 100); - imlib_free_image(); - imlib_context_set_image(im); - im_w = imlib_image_get_width(); - im_h = imlib_image_get_height(); - } - else if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) && - (img->source_param == 1) && - (scale_comp != 100)) - { - im = imlib_create_cropped_scaled_image(0, 0, - im_w, im_h, - (im_w * scale_comp) / 100, - (im_h * scale_comp) / 100); - imlib_free_image(); - imlib_context_set_image(im); - im_w = imlib_image_get_width(); - im_h = imlib_image_get_height(); - } - else if (scale_lossy != 100) - { - im = imlib_create_cropped_scaled_image(0, 0, - im_w, im_h, - (im_w * scale_lossy) / 100, - (im_h * scale_lossy) / 100); - imlib_free_image(); - imlib_context_set_image(im); - im_w = imlib_image_get_width(); - im_h = imlib_image_get_height(); - } - im_alpha = imlib_image_has_alpha(); - im_data = imlib_image_get_data_for_reading_only(); + evas_object_image_size_get(im, &im_w, &im_h); + im_alpha = evas_object_image_alpha_get(im); + im_data = evas_object_image_data_get(im, 0); if ((im_data) && (im_w > 0) && (im_h > 0)) { int mode, qual; @@ -454,8 +443,10 @@ data_write(void) if (verbose) { struct stat st; + char *file = NULL; - if (stat(imlib_image_get_filename(), &st) != 0) + evas_object_image_file_get(im, &file, NULL); + if ((file) && (stat(file, &st) != 0)) st.st_size = 0; input_bytes += st.st_size; input_raw_bytes += im_w * im_h * 4; @@ -465,8 +456,7 @@ data_write(void) 100 - (100 * (double)bytes) / ((double)(st.st_size)) ); } - if (im_data) imlib_image_put_back_data(im_data); - imlib_free_image(); + evas_object_del(im); } else { @@ -476,8 +466,10 @@ data_write(void) } } } + ecore_evas_free(ee); + ecore_evas_shutdown(); + ecore_shutdown(); } -#endif /* sanity checks for parts and programs */ for (l = edje_collections; l; l = l->next) @@ -487,64 +479,9 @@ data_write(void) pc = l->data; for (ll = pc->parts; ll; ll = ll->next) - { - check_part (pc, ll->data, ef); - -/* - Edje_Part *ep = ll->data; - Edje_Part_Description *epd = ep->default_desc; - - if (epd->text.font) - { - Evas_List *lll; - - for (lll = fonts; lll; lll = lll->next) - { - Font *fn; - - fn = lll->data; - if (!strcmp(fn->name, epd->text.font)) - { - char *s; - - s = malloc(strlen(epd->text.font) + strlen("fonts/") + 1); - strcpy(s, "fonts/"); - strcat(s, epd->text.font); - free(epd->text.font); - epd->text.font = s; - } - } - } - for (l3 = ep->other_desc; l3; l3 = l3->next) - { - epd = l3->data; - if (epd->text.font) - { - Evas_List *lll; - - for (lll = fonts; lll; lll = lll->next) - { - Font *fn; - - fn = lll->data; - if (!strcmp(fn->name, epd->text.font)) - { - char *s; - - s = malloc(strlen(epd->text.font) + strlen("fonts/") + 1); - strcpy(s, "fonts/"); - strcat(s, epd->text.font); - free(epd->text.font); - epd->text.font = s; - } - } - } - } - */ - } - + check_part (pc, ll->data, ef); for (ll = pc->programs; ll; ll = ll->next) - check_program (pc, ll->data, ef); + check_program (pc, ll->data, ef); } for (l = edje_collections; l; l = l->next) { diff --git a/legacy/edje/src/bin/edje_decc.c b/legacy/edje/src/bin/edje_decc.c index 7c366ad952..d91e90e1e1 100644 --- a/legacy/edje/src/bin/edje_decc.c +++ b/legacy/edje/src/bin/edje_decc.c @@ -132,7 +132,6 @@ output(void) ef = eet_open(file_in, EET_FILE_MODE_READ); -#ifdef HAVE_IMLIB if (edje_file->image_dir) { for (l = edje_file->image_dir->entries; l; l = l->next) @@ -142,56 +141,40 @@ output(void) ei = l->data; if ((ei->source_type) && (ei->entry)) { - DATA32 *pix; - int w, h, alpha, comp, qual, lossy; + Ecore_Evas *ee; + Evas *evas; + Evas_Object *im; char buf[4096]; + char out[4096]; + char *pp; + ecore_init(); + ecore_evas_init(); + ee = ecore_evas_buffer_new(1, 1); + evas = ecore_evas_get(ee); + im = evas_object_image_add(evas); snprintf(buf, sizeof(buf), "images/%i", ei->id); - pix = eet_data_image_read(ef, buf, &w, &h, &alpha, &comp, &qual, &lossy); - if (pix) + evas_object_image_file_set(im, file_in, buf); + snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry); + printf("Output Image: %s\n", out); + pp = strdup(out); + p = strrchr(pp, '/'); + *p = 0; + if (strstr(pp, "../")) { - Imlib_Image im; - char out[4096]; - char *pp; - - snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry); - printf("Output Image: %s\n", out); - pp = strdup(out); - p = strrchr(pp, '/'); - *p = 0; - if (strstr(pp, "../")) - { - printf("ERROR: potential security violation. attempt to write in parent dir.\n"); - exit (-1); - } - e_file_mkpath(pp); - free(pp); - im = imlib_create_image_using_data(w, h, pix); - imlib_context_set_image(im); - if (alpha) - imlib_image_set_has_alpha(1); - if ((lossy) && (!alpha)) - { - imlib_image_set_format("jpg"); - imlib_image_attach_data_value("quality", NULL, qual, NULL); - } - else - { - imlib_image_set_format("png"); - } - if (strstr(out, "../")) - { - printf("ERROR: potential security violation. attempt to write in parent dir.\n"); - exit (-1); - } - imlib_save_image(out); - imlib_free_image(); - free(pix); + printf("ERROR: potential security violation. attempt to write in parent dir.\n"); + exit (-1); } + e_file_mkpath(pp); + free(pp); + evas_object_image_save(im, out, NULL, "quality=100 compress=9"); + evas_object_del(im); + ecore_evas_free(ee); + ecore_evas_shutdown(); + ecore_shutdown(); } } } -#endif for (l = srcfiles->list; l; l = l->next) { diff --git a/legacy/edje/src/bin/edje_decc.h b/legacy/edje/src/bin/edje_decc.h index 52e6f1b174..faf5393168 100644 --- a/legacy/edje/src/bin/edje_decc.h +++ b/legacy/edje/src/bin/edje_decc.h @@ -2,10 +2,6 @@ #define EDJE_DECC_H #include "edje_main.h" -/* Imlib2 stuff for loading up input images */ -#define X_DISPLAY_MISSING -#include -/* done Imlib2 stuff */ #include #include diff --git a/legacy/edje/src/bin/edje_thumb.c b/legacy/edje/src/bin/edje_thumb.c index 55d4ce39ba..b333c3afaa 100644 --- a/legacy/edje/src/bin/edje_thumb.c +++ b/legacy/edje/src/bin/edje_thumb.c @@ -1,14 +1,13 @@ #include "edje_thumb.h" -static void save_pixels(const int *pixels, int w, int h, char *out); static void args_parse(void); static void help_show(void); static int signal_exit(void *data, int ev_type, void *ev); static int frame_grab(void *data); -Ecore_Evas *ee = NULL; -Evas *evas = NULL; -Evas_Object *edje = NULL; +Ecore_Evas *ee = NULL, *ee_im = NULL, *ee_im2 = NULL; +Evas *evas = NULL, *evas_im = NULL, *evas_im2 = NULL; +Evas_Object *edje = NULL, *im = NULL, *im2 = NULL; char *file = NULL; char *group = NULL; char *outfile = NULL; @@ -31,15 +30,28 @@ main(int argc, char **argv) args_parse(); - ee = ecore_evas_buffer_new(w, h); - if (!ee) - { - printf("Cannot create buffer canvas! ERROR!\n"); - exit(-1); - } + ee = ecore_evas_buffer_new(outw, outh); evas = ecore_evas_get(ee); - edje = edje_object_add(evas); + im = ecore_evas_object_image_new(ee); + evas_object_move(im, 0, 0); + evas_object_resize(im, outw, outh); + evas_object_image_fill_set(im, 0, 0, outw, outh); + evas_object_show(im); + evas_object_image_size_set(im, outw, outh); + ee_im = evas_object_data_get(im, "Ecore_Evas"); + evas_im = ecore_evas_get(ee_im); + + im2 = ecore_evas_object_image_new(ee_im); + evas_object_move(im2, 0, 0); + evas_object_resize(im2, outw, outh); + evas_object_image_fill_set(im2, 0, 0, outw, outh); + evas_object_show(im2); + evas_object_image_size_set(im2, w, h); + ee_im2 = evas_object_data_get(im2, "Ecore_Evas"); + evas_im2 = ecore_evas_get(ee_im2); + + edje = edje_object_add(evas_im2); if (!edje_object_file_set(edje, file, group)) { printf("Cannot load file %s, group %s\n", file, group); @@ -58,10 +70,8 @@ main(int argc, char **argv) } else { - const int *pixels; - - pixels = ecore_evas_buffer_pixels_get(ee); - save_pixels(pixels, w, h, outfile); + ecore_evas_buffer_pixels_get(ee); + evas_object_image_save(im, outfile, NULL, "quality=100 compress=9"); } evas_object_del(edje); @@ -72,27 +82,6 @@ main(int argc, char **argv) return 0; } -static void -save_pixels(const int *pixels, int w, int h, char *out) -{ - Imlib_Image im; - - im = imlib_create_image_using_data(w, h, (DATA32 *) pixels); - imlib_context_set_image(im); - imlib_image_set_irrelevant_alpha(0); - imlib_image_set_has_alpha(1); - if ((w != outw) || (h != outh)) - { - Imlib_Image im2; - - im2 = imlib_create_cropped_scaled_image(0, 0, w, h, outw, outh); - imlib_free_image(); - imlib_context_set_image(im2); - } - imlib_save_image(out); - imlib_free_image(); -} - static void args_parse(void) { @@ -202,11 +191,10 @@ static int frame_grab(void *data) { char buf[4096]; - const int *pixels; - pixels = ecore_evas_buffer_pixels_get(ee); snprintf(buf, sizeof(buf), outfile, frnum); - save_pixels(pixels, w, h, buf); + ecore_evas_buffer_pixels_get(ee); + evas_object_image_save(im, buf, NULL, "quality=100 compress=9"); frnum++; if (frnum == frames) { diff --git a/legacy/edje/src/bin/edje_thumb.h b/legacy/edje/src/bin/edje_thumb.h index b285e06c07..49db7ec0ee 100644 --- a/legacy/edje/src/bin/edje_thumb.h +++ b/legacy/edje/src/bin/edje_thumb.h @@ -14,9 +14,5 @@ #include #include #include "Edje.h" -#define X_DISPLAY_MISSING -#include - - #endif