Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        edje.h edje_cc.h edje_cc_handlers.c edje_cc_out.c 
        edje_cc_parse.c edje_main.c 


Log Message:


work has been done while i've been away. i just need to put this in cvs. many
fixem's have been fixed. text parts work fully now, ALONG with all their
respective effect modes, fits, alignments and "chopping". a few more api
calls have been added and cleaned up. you'll need to update eet too for this
to work.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- edje.h      22 Jun 2003 05:16:12 -0000      1.5
+++ edje.h      7 Jul 2003 07:55:18 -0000       1.6
@@ -3,6 +3,7 @@
 
 #include <Evas.h>
 #include <Ecore.h>
+#include <Ecore_X.h>
 #include <Ecore_Evas.h>
 /* ... only for testing */
 #include <Eet.h>
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- edje_cc.h   16 Jun 2003 13:55:12 -0000      1.5
+++ edje_cc.h   7 Jul 2003 07:55:18 -0000       1.6
@@ -49,7 +49,7 @@
 int     parse_int(int n);
 int     parse_int_range(int n, int f, int t);
 double  parse_float(int n);
-double  parse_float_range(int n, int f, int t);    
+double  parse_float_range(int n, double f, double t);
 
 int     object_handler_num(void);
 int     statement_handler_num(void);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_handlers.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- edje_cc_handlers.c  28 Jun 2003 04:20:41 -0000      1.15
+++ edje_cc_handlers.c  7 Jul 2003 07:55:18 -0000       1.16
@@ -15,6 +15,7 @@
 static void ob_collections_group_parts_part(void);
 static void st_collections_group_parts_part_name(void);
 static void st_collections_group_parts_part_type(void);
+static void st_collections_group_parts_part_effect(void);
 static void st_collections_group_parts_part_mouse_events(void);
 static void st_collections_group_parts_part_clip_to_id(void);
 static void st_collections_group_parts_part_color_class(void);
@@ -51,7 +52,6 @@
 static void st_collections_group_parts_part_description_text_text(void);
 static void st_collections_group_parts_part_description_text_font(void);
 static void st_collections_group_parts_part_description_text_size(void);
-static void st_collections_group_parts_part_description_text_effect(void);
 static void st_collections_group_parts_part_description_text_fit(void);
 static void st_collections_group_parts_part_description_text_min(void);
 static void st_collections_group_parts_part_description_text_align(void);
@@ -76,6 +76,7 @@
      {"collections.group.name", st_collections_group_name},
      {"collections.group.parts.part.name", st_collections_group_parts_part_name},
      {"collections.group.parts.part.type", st_collections_group_parts_part_type},
+     {"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
      {"collections.group.parts.part.mouse_events", 
st_collections_group_parts_part_mouse_events},
      {"collections.group.parts.part.clip_to", 
st_collections_group_parts_part_clip_to_id},
      {"collections.group.parts.part.color_class", 
st_collections_group_parts_part_color_class},
@@ -110,7 +111,6 @@
      {"collections.group.parts.part.description.text.text", 
st_collections_group_parts_part_description_text_text},
      {"collections.group.parts.part.description.text.font", 
st_collections_group_parts_part_description_text_font},
      {"collections.group.parts.part.description.text.size", 
st_collections_group_parts_part_description_text_size},
-     {"collections.group.parts.part.description.text.effect", 
st_collections_group_parts_part_description_text_effect},
      {"collections.group.parts.part.description.text.fit", 
st_collections_group_parts_part_description_text_fit},
      {"collections.group.parts.part.description.text.min", 
st_collections_group_parts_part_description_text_min},
      {"collections.group.parts.part.description.text.align", 
st_collections_group_parts_part_description_text_align},
@@ -135,6 +135,7 @@
      {"collections.group.parts.part", ob_collections_group_parts_part},
      {"collections.group.parts.part.name", NULL},
      {"collections.group.parts.part.type", NULL},
+     {"collections.group.parts.part.effect", NULL},
      {"collections.group.parts.part.mouse_events", NULL},
      {"collections.group.parts.part.clip_to", NULL},
      {"collections.group.parts.part.color_class", NULL},
@@ -178,7 +179,6 @@
      {"collections.group.parts.part.description.text.text", NULL},
      {"collections.group.parts.part.description.text.font", NULL},
      {"collections.group.parts.part.description.text.size", NULL},
-     {"collections.group.parts.part.description.text.effect", NULL},
      {"collections.group.parts.part.description.text.fit", NULL},
      {"collections.group.parts.part.description.text.min", NULL},
      {"collections.group.parts.part.description.text.align", NULL},
@@ -445,6 +445,8 @@
    ed->color3.g = 0;
    ed->color3.b = 0;
    ed->color3.a = 128;
+   ed->text.align.x = 0.5;
+   ed->text.align.y = 0.5;
 }
 
 static void
@@ -614,8 +616,8 @@
    ep = evas_list_data(evas_list_last(pc->parts));
    ed = ep->default_desc;
    if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
-   ed->rel1.relative_x = parse_float_range(0, 0.0, 1.0);
-   ed->rel1.relative_y = parse_float_range(1, 0.0, 1.0);
+   ed->rel1.relative_x = parse_float(0);
+   ed->rel1.relative_y = parse_float(1);
 }
 
 static void
@@ -664,8 +666,8 @@
    ep = evas_list_data(evas_list_last(pc->parts));
    ed = ep->default_desc;
    if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
-   ed->rel2.relative_x = parse_float_range(0, 0.0, 1.0);
-   ed->rel2.relative_y = parse_float_range(1, 0.0, 1.0);
+   ed->rel2.relative_x = parse_float(0);
+   ed->rel2.relative_y = parse_float(1);
 }
 
 static void
@@ -931,7 +933,7 @@
 }
 
 static void
-st_collections_group_parts_part_description_text_effect(void)
+st_collections_group_parts_part_effect(void)
 {
    Edje_Part_Collection *pc;
    Edje_Part *ep;
@@ -939,15 +941,16 @@
 
    pc = evas_list_data(evas_list_last(edje_collections));
    ep = evas_list_data(evas_list_last(pc->parts));
-   ed = ep->default_desc;
-   if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
-   ed->text.effect = parse_enum(0, 
-                               "NONE", EDJE_TEXT_EFFECT_NONE,
-                               "PLAIN", EDJE_TEXT_EFFECT_PLAIN,
-                               "OUTLINE", EDJE_TEXT_EFFECT_OUTLINE,
-                               "SHADOW", EDJE_TEXT_EFFECT_SHADOW,
-                               "SHADOW_OUTLINE", EDJE_TEXT_EFFECT_OUTLINE_SHADOW,
-                               NULL);
+   ep->effect = parse_enum(0, 
+                          "NONE", EDJE_TEXT_EFFECT_NONE,
+                          "PLAIN", EDJE_TEXT_EFFECT_PLAIN,
+                          "OUTLINE", EDJE_TEXT_EFFECT_OUTLINE,
+                          "SOFT_OUTLINE", EDJE_TEXT_EFFECT_SOFT_OUTLINE,
+                          "SHADOW", EDJE_TEXT_EFFECT_SHADOW,
+                          "SOFT_SHADOW", EDJE_TEXT_EFFECT_SOFT_SHADOW,
+                          "OUTLINE_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SHADOW,
+                          "OUTLINE_SOFT_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW,
+                          NULL);
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_out.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- edje_cc_out.c       17 Jun 2003 08:15:06 -0000      1.5
+++ edje_cc_out.c       7 Jul 2003 07:55:18 -0000       1.6
@@ -137,8 +137,15 @@
                    }
                  if (verbose)
                    {
-                      printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry 
\"%s\"\n",
-                             progname, bytes, (bytes + 512) / 1024, buf, img->entry);
+                      struct stat st;
+                      
+                      if (stat(imlib_image_get_filename(), &st) != 0)
+                        st.st_size = 0;
+                      printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry 
\"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]\n",
+                             progname, bytes, (bytes + 512) / 1024, buf, img->entry,
+                             100 - (100 * (double)bytes) / ((double)(im_w * im_h * 
4)),
+                             100 - (100 * (double)bytes) / ((double)(st.st_size))
+                             );
                    }
                  imlib_image_put_back_data(im_data);
                  imlib_free_image();
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_parse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- edje_cc_parse.c     19 Jun 2003 23:56:26 -0000      1.7
+++ edje_cc_parse.c     7 Jul 2003 07:55:18 -0000       1.8
@@ -476,7 +476,7 @@
 }
 
 double
-parse_float_range(int n, int f, int t)
+parse_float_range(int n, double f, double t)
 {
    char *str;
    double i;
@@ -491,7 +491,7 @@
    i = atof(str);
    if ((i < f) || (i > t))
      {
-       fprintf(stderr, "%s: Error. %s:%i integer %i out of range of %3.3f to %3.3f 
inclusive\n",
+       fprintf(stderr, "%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f 
inclusive\n",
                progname, file_in, line, i, f, t);
        exit(-1);
      }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_main.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- edje_main.c 22 Jun 2003 07:58:54 -0000      1.10
+++ edje_main.c 7 Jul 2003 07:55:18 -0000       1.11
@@ -6,11 +6,33 @@
 static int  main_signal_exit(void *data, int ev_type, void *ev);
 static void main_delete_request(Ecore_Evas *ee);
 
-void bg_setup(void);
-void bg_resize(double w, double h);
+void        bg_setup(void);
+void        bg_resize(double w, double h);
+static void bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info);
 
-void test_setup(char *file, char *name);
-void test_reize(double w, double h);
+void        test_setup(char *file, char *name);
+void        test_reize(double w, double h);
+typedef struct _Demo_Edje Demo_Edje;
+
+struct _Demo_Edje
+{
+   Evas_Object *edje;
+   Evas_Object *left;
+   Evas_Object *right;
+   Evas_Object *top;
+   Evas_Object *bottom;
+   Evas_Object *title;
+   Evas_Object *title_clip;
+   Evas_Object *image;
+   int          down_top : 1;
+   int          down_bottom : 1;
+   int          hdir;
+   int          vdir;
+};
+
+static Evas_List   *edjes = NULL;
+static Evas_Object *o_bg = NULL;
+static Evas_Object *o_shadow = NULL;
     
 double       start_time = 0.0;
 Ecore_Evas  *ecore_evas = NULL;
@@ -49,10 +71,8 @@
    ecore_evas_name_class_set(ecore_evas, "edje", "main");
    ecore_evas_show(ecore_evas);
    evas = ecore_evas_get(ecore_evas);
-//   evas_image_cache_set(evas, 1024 * 1024);
-//   evas_font_cache_set(evas, 256 * 1024);
-   evas_image_cache_set(evas, 0);
-   evas_font_cache_set(evas, 0);
+   evas_image_cache_set(evas, 8 * 1024 * 1024);
+   evas_font_cache_set(evas, 1 * 1024 * 1024);
    evas_font_path_append(evas, DAT"data/test/fonts");
    return 1;
 }
@@ -87,9 +107,6 @@
    ecore_main_loop_quit();
 }
 
-static Evas_Object *o_bg = NULL;
-static Evas_Object *o_shadow = NULL;
-
 void
 bg_setup(void)
 {
@@ -104,6 +121,8 @@
    evas_object_image_fill_set(o, 0, 0, 128, 128);
    evas_object_pass_events_set(o, 1);
    evas_object_show(o);   
+   evas_object_focus_set(o, 1);
+   evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_DOWN, bg_key_down, NULL);
    o_bg = o;
 
    o = evas_object_image_add(evas);
@@ -126,25 +145,27 @@
    evas_object_image_fill_set(o_shadow, 0, 0, w, h);
 }
 
-typedef struct _Demo_Edje Demo_Edje;
-
-struct _Demo_Edje
+static void
+bg_key_down(void *data, Evas * e, Evas_Object * obj, void *event_info)
 {
-   Evas_Object *edje;
-   Evas_Object *left;
-   Evas_Object *right;
-   Evas_Object *top;
-   Evas_Object *bottom;
-   Evas_Object *title;
-   Evas_Object *title_clip;
-   Evas_Object *image;
-   int          down_top : 1;
-   int          down_bottom : 1;
-   int          hdir;
-   int          vdir;
-};
-
-static Evas_List *edjes = NULL;
+   Evas_Event_Key_Down *ev;
+   
+   ev = (Evas_Event_Key_Down *)event_info;
+     {
+       Evas_List *l;
+       
+       for (l = edjes; l; l = l->next)
+         {
+            Demo_Edje *de;
+            
+            de = l->data;
+            if (!strcmp(ev->keyname, "p"))      edje_play_set(de->edje, 1);
+            else if (!strcmp(ev->keyname, "o")) edje_play_set(de->edje, 0);
+            else if (!strcmp(ev->keyname, "a")) edje_animation_set(de->edje, 1);
+            else if (!strcmp(ev->keyname, "s")) edje_animation_set(de->edje, 0);
+         }
+     }
+}
 
 static void cb (void *data, Evas_Object *o, const char *sig, const char *src);
 




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to