Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        Makefile.am edje_cc.c 


Log Message:


parsing much nicer.. in fact starting to actually compile! :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 9 Jun 2003 11:31:32 -0000       1.2
+++ Makefile.am 11 Jun 2003 09:30:26 -0000      1.3
@@ -9,7 +9,8 @@
 -I$(top_srcdir)/lib \
 -I$(top_builddir)/lib \
 -I/usr/local/include \
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
 
 bin_PROGRAMS = edje edje_cc
 
@@ -17,7 +18,10 @@
 edje_main.c
 
 edje_LDADD = \
-$(top_builddir)/src/lib/libedje.la
+$(top_builddir)/src/lib/libedje.la \
[EMAIL PROTECTED]@
+
+edje_LDFLAGS =
 
 edje_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la
 
@@ -25,6 +29,10 @@
 edje_cc.c
 
 edje_cc_LDADD = \
-$(top_builddir)/src/lib/libedje.la
+$(top_builddir)/src/lib/libedje.la \
[EMAIL PROTECTED]@
+
+edje_cc_LDFLAGS =
+
 
 edje_cc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- edje_cc.c   9 Jun 2003 13:51:39 -0000       1.2
+++ edje_cc.c   11 Jun 2003 09:30:28 -0000      1.3
@@ -1,4 +1,8 @@
 #include "edje.h"
+/* Imlib2 stuff for loading up input images */
+#define X_DISPLAY_MISSING
+#include <Imlib2.h>
+/* done Imlib2 stuff */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -211,10 +215,48 @@
        img = l->data;  
        if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
          {
-            if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT)
-              printf("FIXME: should inline image %s lossless, compression: %i\n", 
img->entry, img->source_param);
+            Imlib_Image im;
+            Evas_List *l;
+
+            im = NULL;
+            for (l = img_dirs; l; l = l->next)
+              {
+                 char buf[4096];
+                 
+                 snprintf(buf, sizeof(buf), "%s/%s", l->data, img->entry);
+                 im = imlib_load_image(buf);
+                 if (im) break;
+              }
+            if (!im) im = imlib_load_image(img->entry);
+            if (im)
+              {
+                 DATA32 *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();
+                 im_alpha = imlib_image_has_alpha();
+                 im_data = imlib_image_get_data_for_reading_only();
+                 snprintf(buf, sizeof(buf), "/images/%i", img->id);
+                 if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT)
+                   eet_data_image_write(ef, buf, 
+                                        im_data, im_w, im_h, im_alpha, 
+                                        img->source_param, 0, 0);
+                 else
+                   eet_data_image_write(ef, buf, 
+                                        im_data, im_w, im_h, im_alpha, 
+                                        0, img->source_param, 1);
+                 imlib_image_put_back_data(im_data);
+                 imlib_free_image();
+              }
             else
-              printf("FIXME: should inline image %s lossy, quality: %i%%\n", 
img->entry, img->source_param);
+              {
+                 fprintf(stderr, "%s: Warning. unable to open image %s for inclusion 
in output\n",
+                         progname, img->entry);                          
+              }
          }
      }
    eet_close(ef);
@@ -469,17 +511,28 @@
               }
             else if (!strcmp(token, ";"))
               {
-                 
-                 do_params = 0;
-                 new_statement();
-                 /* clear out params */
-                 while (params)
+                 if (do_params)
+                   {
+                      do_params = 0;
+                      new_statement();
+                      /* clear out params */
+                      while (params)
+                        {
+                           free(params->data);
+                           params = evas_list_remove(params, params->data);
+                        }
+                      /* remove top from stack */
+                      stack_chop_top();
+                   }
+              }
+            else if (!strcmp(token, "{"))
+              {
+                 if (do_params)
                    {
-                      free(params->data);
-                      params = evas_list_remove(params, params->data);
+                      fprintf(stderr, "%s: Error. parse error %s:%i. { marker before 
; marker\n",
+                              progname, file_in, line);
+                      exit(-1);                       
                    }
-                 /* remove top from stack */
-                 stack_chop_top();
               }
             free(token);
          }




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to