Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        Makefile.am edje_cc.c edje_cc.h edje_cc_out.c 
Added Files:
        edje_cc_sources.c edje_decc.c edje_decc.h 


Log Message:


edje decompiling works now! you can decompile an edje .eet back into source
files (.edc's, fonts and images) and it will even make a handy build/sh to
rebuild the .edc into the original .eet again! :)

NB: only works on .et's created with this edje_cc or newer as i needed to
incpude some extra debug info :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- Makefile.am 16 Jul 2004 23:33:41 -0000      1.12
+++ Makefile.am 29 Aug 2004 11:03:19 -0000      1.13
@@ -12,10 +12,12 @@
 bin_PROGRAMS = \
 edje \
 edje_ls \
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
 
 EXTRA_PROGRAMS = \
-edje_cc
+edje_cc \
+edje_decc
 
 edje_SOURCES = \
 edje_main.c \
@@ -38,7 +40,8 @@
 edje_cc_out.c \
 edje_cc_parse.c \
 edje_cc_mem.c \
-edje_cc_handlers.c
+edje_cc_handlers.c \
+edje_cc_sources.c
 
 edje_cc_LDADD = \
 $(top_builddir)/src/lib/libedje.la \
@@ -51,6 +54,24 @@
 edje_cc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la
 
 
+edje_decc_SOURCES = \
+edje_decc.c \
+edje_decc.h \
+edje_cc_mem.c \
+edje_cc_sources.c
+
+edje_decc_LDADD = \
+$(top_builddir)/src/lib/libedje.la \
[EMAIL PROTECTED]@
+
+edje_decc_CPPFLAGS = @edje_def@
+
+edje_decc_LDFLAGS =
+
+edje_decc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la
+
+
+
 edje_ls_SOURCES = \
 edje_ls.c
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- edje_cc.c   1 Apr 2004 09:30:45 -0000       1.13
+++ edje_cc.c   29 Aug 2004 11:03:19 -0000      1.14
@@ -90,6 +90,9 @@
    edje_file = mem_alloc(SZ(Edje_File));
    edje_file->version = EDJE_FILE_VERSION;
    
+   source_edd();
+   source_fetch();
+   
    data_setup();   
    compile();
    data_process_scripts();
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- edje_cc.h   16 Jul 2004 23:33:41 -0000      1.15
+++ edje_cc.h   29 Aug 2004 11:03:19 -0000      1.16
@@ -25,9 +25,12 @@
 /* types */
 typedef struct _New_Object_Handler    New_Object_Handler;
 typedef struct _New_Statement_Handler New_Statement_Handler;
+typedef struct _Font_List             Font_List;
 typedef struct _Font                  Font;
 typedef struct _Code                  Code;
 typedef struct _Code_Program          Code_Program;
+typedef struct _SrcFile               SrcFile;
+typedef struct _SrcFile_List          SrcFile_List;
 
 struct _New_Object_Handler
 {
@@ -41,6 +44,11 @@
    void (*func)(void);
 };
 
+struct _Font_List
+{
+   Evas_List *list;
+};
+
 struct _Font
 {
    char *file;
@@ -61,6 +69,17 @@
    char      *script;
 };
 
+struct _SrcFile
+{
+   char *name;
+   char *file;
+};
+
+struct _SrcFile_List
+{
+   Evas_List *list;
+};
+
 /* global fn calls */
 void    data_setup(void);
 void    data_write(void);
@@ -91,6 +110,13 @@
 int     object_handler_num(void);
 int     statement_handler_num(void);
 
+void    source_edd(void);
+void    source_fetch(void);
+int     source_append(Eet_File *ef);
+SrcFile_List *source_load(Eet_File *ef);
+int     source_fontmap_save(Eet_File *ef, Evas_List *fonts);
+Font_List *source_fontmap_load(Eet_File *ef);
+    
 void   *mem_alloc(size_t size);
 char   *mem_strdup(const char *s);
 #define SZ sizeof
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_out.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- edje_cc_out.c       29 Aug 2004 09:40:02 -0000      1.20
+++ edje_cc_out.c       29 Aug 2004 11:03:19 -0000      1.21
@@ -90,6 +90,8 @@
    int bytes;
    int input_bytes;
    int total_bytes;
+   int src_bytes;
+   int fmap_bytes;
    int input_raw_bytes;
    int image_num;
    int font_num;
@@ -99,6 +101,8 @@
    bytes = 0;
    input_bytes = 0;
    total_bytes = 0;
+   src_bytes = 0;
+   fmap_bytes = 0;
    input_raw_bytes = 0;
    image_num = 0;
    font_num = 0;
@@ -549,6 +553,10 @@
               }
          }
      }
+   src_bytes = source_append(ef);
+   total_bytes += src_bytes;
+   fmap_bytes = source_fontmap_save(ef, fonts);
+   total_bytes += fmap_bytes;
    eet_close(ef);
    if (verbose)
      {
@@ -562,6 +570,8 @@
               "  Wrote %i collections\n"
               "  Wrote %i images\n"
               "  Wrote %i fonts\n"
+              "  Wrote %i bytes (%iKb) of original source data\n"
+              "  Wrote %i bytes (%iKb) of original source font map\n"
               "Conservative compression summary:\n"
               "  Wrote total %i bytes (%iKb) from %i (%iKb) input data\n"
               "  Output file is %3.1f%% the size of the input data\n"
@@ -574,6 +584,8 @@
               collection_num,
               image_num,
               font_num,
+              src_bytes, (src_bytes + 512) / 1024,
+              fmap_bytes, (fmap_bytes + 512) / 1024,
               total_bytes, (total_bytes + 512) / 1024,
               input_bytes, (input_bytes + 512) / 1024,
               (100.0 * (double)total_bytes) / (double)input_bytes,




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to