Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_embryo.c edje_message_queue.c 


Log Message:


testing the edje message queue.. revealed.... problems... and.. now....
FIXES! :)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_embryo.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- edje_embryo.c       25 Nov 2004 16:30:46 -0000      1.41
+++ edje_embryo.c       9 Dec 2004 05:49:34 -0000       1.42
@@ -1210,6 +1210,7 @@
    Edje *ed;
    Edje_Message_Type type;
    int id, i, n;
+   Embryo_Cell *ptr;
    
    if (params[0] < (sizeof(Embryo_Cell) * (2))) return 0;
    ed = embryo_program_data_get(ep);
@@ -1247,17 +1248,19 @@
             Edje_Message_Int *emsg;
             
             emsg = alloca(sizeof(Edje_Message_Int));
-            emsg->val = (int)params[3];
+            ptr = embryo_data_address_get(ep, params[3]);
+            emsg->val = (int)*ptr;
             _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
          }
        break;
       case EDJE_MESSAGE_FLOAT:
          {
-            Edje_Message_Int *emsg;
+            Edje_Message_Float *emsg;
             float f;
             
-            emsg = alloca(sizeof(Edje_Message_Int));
-            f = EMBRYO_CELL_TO_FLOAT(params[3]);
+            emsg = alloca(sizeof(Edje_Message_Float));
+            ptr = embryo_data_address_get(ep, params[3]);
+            f = EMBRYO_CELL_TO_FLOAT(*ptr);
             emsg->val = (double)f;
             _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
          }
@@ -1266,7 +1269,7 @@
          {
             Edje_Message_String_Set *emsg;
             
-            n = (params[0] / sizeof(Embryo_Cell));
+            n = (params[0] / sizeof(Embryo_Cell)) + 1;
             emsg = alloca(sizeof(Edje_Message_String_Set) + ((n - 3 - 1) * 
sizeof(char *)));
             emsg->count = n - 3;
             for (i = 3; i < n; i++)
@@ -1292,11 +1295,14 @@
          {
             Edje_Message_Int_Set *emsg;
             
-            n = (params[0] / sizeof(Embryo_Cell));
+            n = (params[0] / sizeof(Embryo_Cell)) + 1;
             emsg = alloca(sizeof(Edje_Message_Int_Set) + ((n - 3 - 1) * 
sizeof(int)));
             emsg->count = n - 3;
             for (i = 3; i < n; i++)
-              emsg->val[i - 3] = (int)params[i];
+              {
+                 ptr = embryo_data_address_get(ep, params[i]);
+                 emsg->val[i - 3] = (int)*ptr;
+              }
             _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
          }
        break;
@@ -1304,14 +1310,15 @@
          {
             Edje_Message_Float_Set *emsg;
             
-            n = (params[0] / sizeof(Embryo_Cell));
+            n = (params[0] / sizeof(Embryo_Cell)) + 1;
             emsg = alloca(sizeof(Edje_Message_Float_Set) + ((n - 3 - 1) * 
sizeof(double)));
             emsg->count = n - 3;
             for (i = 3; i < n; i++)
               {
                  float f;
                  
-                 f = EMBRYO_CELL_TO_FLOAT(params[i]);
+                 ptr = embryo_data_address_get(ep, params[i]);
+                 f = EMBRYO_CELL_TO_FLOAT(*ptr);
                  emsg->val[i - 3] = (double)f;
               }
             _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
@@ -1333,7 +1340,8 @@
                  embryo_data_string_get(ep, cptr, s);
                  emsg = alloca(sizeof(Edje_Message_String_Int));
                  emsg->str = s;
-                 emsg->val = (int)params[4];
+                 ptr = embryo_data_address_get(ep, params[4]);
+                 emsg->val = (int)*ptr;
                  _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
               }
          }
@@ -1355,7 +1363,8 @@
                  embryo_data_string_get(ep, cptr, s);
                  emsg = alloca(sizeof(Edje_Message_String_Float));
                  emsg->str = s;
-                 f = EMBRYO_CELL_TO_FLOAT(params[4]);
+                 ptr = embryo_data_address_get(ep, params[4]);
+                 f = EMBRYO_CELL_TO_FLOAT(*ptr);
                  emsg->val = (double)f;
                  _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
               }
@@ -1375,12 +1384,15 @@
                  l = embryo_data_string_length_get(ep, cptr);
                  s = alloca(l + 1);
                  embryo_data_string_get(ep, cptr, s);
-                 n = (params[0] / sizeof(Embryo_Cell));
+                 n = (params[0] / sizeof(Embryo_Cell)) + 1;
                  emsg = alloca(sizeof(Edje_Message_String_Int_Set) + ((n - 4 - 
1) * sizeof(int)));
                  emsg->str = s;
                  emsg->count = n - 4;
                  for (i = 4; i < n; i++)
-                   emsg->val[i - 4] = (int)params[i];
+                   {
+                      ptr = embryo_data_address_get(ep, params[i]);
+                      emsg->val[i - 4] = (int)*ptr;
+                   }
                  _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
               }
          }
@@ -1399,7 +1411,7 @@
                  l = embryo_data_string_length_get(ep, cptr);
                  s = alloca(l + 1);
                  embryo_data_string_get(ep, cptr, s);
-                 n = (params[0] / sizeof(Embryo_Cell));
+                 n = (params[0] / sizeof(Embryo_Cell)) + 1;
                  emsg = alloca(sizeof(Edje_Message_String_Float_Set) + ((n - 4 
- 1) * sizeof(double)));
                  emsg->str = s;
                  emsg->count = n - 4;
@@ -1407,7 +1419,8 @@
                    {
                       float f;
                       
-                      f = EMBRYO_CELL_TO_FLOAT(params[i]);
+                      ptr = embryo_data_address_get(ep, params[i]);
+                      f = EMBRYO_CELL_TO_FLOAT(*ptr);
                       emsg->val[i - 4] = (double)f;
                    }
                  _edje_message_send(ed, EDJE_QUEUE_APP, type, id, emsg);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_message_queue.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- edje_message_queue.c        2 Dec 2004 09:21:22 -0000       1.13
+++ edje_message_queue.c        9 Dec 2004 05:49:34 -0000       1.14
@@ -439,16 +439,21 @@
                                     ((Edje_Message_String *)em->msg)->str);
        break;
       case EDJE_MESSAGE_INT:
-       embryo_parameter_cell_push(em->edje->collection->script, 
-                                  (Embryo_Cell)((Edje_Message_Int 
*)em->msg)->val);
+         {
+            Embryo_Cell v;
+            
+            v = (Embryo_Cell)((Edje_Message_Int *)em->msg)->val;
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
+         }
        break;
       case EDJE_MESSAGE_FLOAT:
          {
-            float v;
+            Embryo_Cell v;
+            float fv;
             
-            v = (Embryo_Cell)((Edje_Message_Float *)em->msg)->val;
-            embryo_parameter_cell_push(em->edje->collection->script, 
-                                       (Embryo_Cell)EMBRYO_FLOAT_TO_CELL(v));
+            fv = ((Edje_Message_Float *)em->msg)->val;
+            v = EMBRYO_FLOAT_TO_CELL(fv);
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
          }
        break;
       case EDJE_MESSAGE_STRING_SET:
@@ -458,53 +463,68 @@
        break;
       case EDJE_MESSAGE_INT_SET:
        for (i = 0; i < ((Edje_Message_Int_Set *)em->msg)->count; i++)
-         embryo_parameter_cell_push(em->edje->collection->script, 
-                                    (Embryo_Cell)((Edje_Message_Int_Set 
*)em->msg)->val[i]);
+         {
+            Embryo_Cell v;
+            
+            v = (Embryo_Cell)((Edje_Message_Int_Set *)em->msg)->val[i];
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
+         }
        break;
       case EDJE_MESSAGE_FLOAT_SET:
        for (i = 0; i < ((Edje_Message_Float_Set *)em->msg)->count; i++)
          {
-            float v;
+            Embryo_Cell v;
+            float fv;
             
-            v = ((Edje_Message_Float_Set *)em->msg)->val[i];
-            embryo_parameter_cell_push(em->edje->collection->script, 
-                                       (Embryo_Cell)EMBRYO_FLOAT_TO_CELL(v));
+            fv = ((Edje_Message_Float_Set *)em->msg)->val[i];
+            v = EMBRYO_FLOAT_TO_CELL(fv);
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
          }
        break;
       case EDJE_MESSAGE_STRING_INT:
        embryo_parameter_string_push(em->edje->collection->script, 
                                     ((Edje_Message_String_Int *)em->msg)->str);
-       embryo_parameter_cell_push(em->edje->collection->script, 
-                                  (Embryo_Cell)((Edje_Message_String_Int 
*)em->msg)->val);
+         {
+            Embryo_Cell v;
+            
+            v = (Embryo_Cell)((Edje_Message_String_Int *)em->msg)->val;
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
+         }
        break;
       case EDJE_MESSAGE_STRING_FLOAT:
        embryo_parameter_string_push(em->edje->collection->script, 
                                     ((Edje_Message_String_Float 
*)em->msg)->str);
          {
-            float v;
+            Embryo_Cell v;
+            float fv;
             
-            v = (Embryo_Cell)((Edje_Message_String_Float *)em->msg)->val;
-            embryo_parameter_cell_push(em->edje->collection->script, 
-                                       (Embryo_Cell)EMBRYO_FLOAT_TO_CELL(v));
+            fv = ((Edje_Message_String_Float *)em->msg)->val;
+            v = EMBRYO_FLOAT_TO_CELL(fv);
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
          }
        break;
       case EDJE_MESSAGE_STRING_INT_SET:
        embryo_parameter_string_push(em->edje->collection->script, 
                                     ((Edje_Message_String_Int_Set 
*)em->msg)->str);
        for (i = 0; i < ((Edje_Message_String_Int_Set *)em->msg)->count; i++)
-         embryo_parameter_cell_push(em->edje->collection->script, 
-                                    (Embryo_Cell)((Edje_Message_String_Int_Set 
*)em->msg)->val[i]);
+         {
+            Embryo_Cell v;
+            
+            v = (Embryo_Cell)((Edje_Message_String_Int_Set *)em->msg)->val[i];
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
+         }
        break;
       case EDJE_MESSAGE_STRING_FLOAT_SET:
        embryo_parameter_string_push(em->edje->collection->script, 
                                     ((Edje_Message_String_Float_Set 
*)em->msg)->str);
        for (i = 0; i < ((Edje_Message_String_Float_Set *)em->msg)->count; i++)
          {
-            float v;
+            Embryo_Cell v;
+            float fv;
             
-            v = ((Edje_Message_String_Float_Set *)em->msg)->val[i];
-            embryo_parameter_cell_push(em->edje->collection->script, 
-                                       (Embryo_Cell)EMBRYO_FLOAT_TO_CELL(v));
+            fv = ((Edje_Message_String_Float_Set *)em->msg)->val[i];
+            v = EMBRYO_FLOAT_TO_CELL(fv);
+            embryo_parameter_cell_array_push(em->edje->collection->script, &v, 
1);
          }
        break;
       default:




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to