eolian: move efl eo files over to the new ctor syntax
authorDaniel Kolesa <d.kolesa@samsung.com>
Mon, 1 Sep 2014 14:53:35 +0000 (15:53 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Mon, 1 Sep 2014 14:53:35 +0000 (15:53 +0100)
18 files changed:
src/examples/eolian_cxx/colourable.eo
src/examples/eolian_cxx/colourablesquare.eo
src/lib/ecore/ecore_animator.eo
src/lib/ecore/ecore_exe.eo
src/lib/ecore/ecore_idle_enterer.eo
src/lib/ecore/ecore_idle_exiter.eo
src/lib/ecore/ecore_idler.eo
src/lib/ecore/ecore_job.eo
src/lib/ecore/ecore_poller.eo
src/lib/ecore/ecore_timer.eo
src/lib/eo/eo_base.eo
src/lib/eolian/eo_parser.c
src/lib/evas/canvas/evas_3d_node.eo
src/tests/eolian/data/base.eo
src/tests/eolian/data/ctor_dtor.eo
src/tests/eolian/data/object_impl.eo
src/tests/eolian/eolian_parsing.c
src/tests/eolian_cxx/callback.eo

index 342790c..a262387 100644 (file)
@@ -4,11 +4,11 @@ class Colourable (Eo.Base)
     legacy_prefix: legacy;
     data: Colourable_Data;
     methods {
-        constructor @constructor {
+        constructor {
             /*@ Default constructor. */
             legacy: null;
         }
-        rgb_composite_constructor @constructor {
+        rgb_composite_constructor {
             /*@ Composite RGB Constructor. */
             legacy: null;
             params {
@@ -17,7 +17,7 @@ class Colourable (Eo.Base)
                 @in int b; /*@ The blue component. */
                }
         }
-        rgb_24bits_constructor @constructor {
+        rgb_24bits_constructor {
             /*@ RGB Constructor. */
             legacy: null;
             params {
@@ -59,6 +59,11 @@ class Colourable (Eo.Base)
             }
         }
     }
+    constructors {
+        .constructor;
+        .rgb_composite_constructor;
+        .rgb_24bits_constructor;
+    }
     events {
         colour_changed: int;
     }
index 1d12862..f21f7b4 100644 (file)
@@ -3,7 +3,7 @@ class ColourableSquare (Colourable)
     legacy_prefix: legacy;
     data: ColourableSquare_Data;
     properties {
-       size_constructor @constructor {
+       size_constructor {
            legacy: null;
            params {
               @in int size;
@@ -24,4 +24,7 @@ class ColourableSquare (Colourable)
     methods {
         size_print { /*@ Show the square. */ }
     }
+    constructors {
+        .size_constructor;
+    }
 }
index a0f0cfe..81ed666 100644 (file)
@@ -2,7 +2,7 @@ class Ecore.Animator (Eo.Base)
 {
    eo_prefix: ecore_animator;
    methods {
-      timeline_constructor @constructor {
+      timeline_constructor {
          /*@ Constructor. */
          legacy: null;
          params {
@@ -11,7 +11,7 @@ class Ecore.Animator (Eo.Base)
             @in const(void)* data;
          }
       }
-      constructor @constructor {
+      constructor {
          /*@ Constructor. */
          legacy: null;
          params {
@@ -26,4 +26,8 @@ class Ecore.Animator (Eo.Base)
       Eo.Base.event_freeze;
       Eo.Base.event_thaw;
    }
+   constructors {
+      .constructor;
+      .timeline_constructor;
+   }
 }
index dcb624c..618595d 100644 (file)
@@ -2,7 +2,7 @@ class Ecore.Exe (Eo.Base, Efl.Control)
 {
    eo_prefix: ecore_obj_exe;
    properties {
-        command @constructor {
+        command {
              /*@ Control the command that's executed. FIXME: May need a split/rename. */
              set {
                   legacy: null;
@@ -24,6 +24,9 @@ class Ecore.Exe (Eo.Base, Efl.Control)
         Eo.Base.finalize;
         Efl.Control.suspend.set;
    }
+   constructors {
+      .command;
+   }
    events {
         data,get: Ecore_Exe_Event_Data;
         data,error: Ecore_Exe_Event_Data;
index 8250d50..f28ca7e 100644 (file)
@@ -2,7 +2,7 @@ class Ecore.Idle.Enterer (Eo.Base)
 {
    eo_prefix: ecore_idle_enterer;
    methods {
-      before_constructor @constructor {
+      before_constructor {
          /*@ Contructor. Will insert the handler at the beginning of the list. */
          legacy: null;
          params {
@@ -10,7 +10,7 @@ class Ecore.Idle.Enterer (Eo.Base)
             @in const(void)* data;
          }
       }
-      after_constructor @constructor {
+      after_constructor {
          /*@ Contructor. Will insert the handler at the end of the list. */
          legacy: null;
          params {
@@ -23,4 +23,8 @@ class Ecore.Idle.Enterer (Eo.Base)
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
+   constructors {
+      .before_constructor;
+      .after_constructor;
+   }
 }
index 711ece6..22602cc 100644 (file)
@@ -2,7 +2,7 @@ class Ecore.Idle.Exiter (Eo.Base)
 {
    eo_prefix: ecore_idle_exiter;
    methods {
-      constructor @constructor {
+      constructor {
          /*@ Constructor. */
          legacy: null;
          params {
@@ -15,4 +15,7 @@ class Ecore.Idle.Exiter (Eo.Base)
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
+   constructors {
+      .constructor;
+   }
 }
index e071567..db69277 100644 (file)
@@ -2,7 +2,7 @@ class Ecore.Idler (Eo.Base)
 {
    eo_prefix: ecore_idler;
    methods {
-      constructor @constructor {
+      constructor {
          /*@ Constructor. */
          legacy: null;
          params {
@@ -15,4 +15,7 @@ class Ecore.Idler (Eo.Base)
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
+   constructors {
+      .constructor;
+   }
 }
index fdd5cb2..2bc9d68 100644 (file)
@@ -2,7 +2,7 @@ class Ecore.Job (Eo.Base)
 {
    eo_prefix: ecore_job;
    methods {
-      constructor @constructor {
+      constructor {
          /*@ Constructor. */
          legacy: null;
          params {
@@ -15,4 +15,7 @@ class Ecore.Job (Eo.Base)
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
+   constructors {
+      .constructor;
+   }
 }
index 4dcf714..c08a605 100644 (file)
@@ -1,7 +1,7 @@
 class Ecore.Poller (Eo.Base)
 {
    methods {
-      constructor @constructor {
+      constructor {
          /*@ Constructor with parameters for Ecore Poller. */
          legacy: null;
          params {
@@ -41,4 +41,7 @@ class Ecore.Poller (Eo.Base)
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
+   constructors {
+      .constructor;
+   }
 }
index f83290a..165487a 100644 (file)
@@ -30,7 +30,7 @@ class Ecore.Timer (Eo.Base)
       }
    }
    methods {
-      loop_constructor @constructor {
+      loop_constructor {
          /*@ Create a timer to call in a given time from now */
          legacy: null;
          params {
@@ -39,7 +39,7 @@ class Ecore.Timer (Eo.Base)
             @in const(void)* data; /*@ A pointer to pass to the callback function as its data pointer */
          }
       }
-      constructor @constructor {
+      constructor {
          /*@ Create a timer to call in a given time from when the mainloop woke up from sleep */
          legacy: null;
          params {
@@ -100,5 +100,9 @@ class Ecore.Timer (Eo.Base)
        *
        * @see ecore_timer_freeze()
        */
-     }
+   }
+   constructors {
+      .constructor;
+      .loop_constructor;
+   }
 }
index 37ba6c7..b76b45b 100644 (file)
@@ -44,7 +44,7 @@ Return event freeze count. */
       }
    }
    methods {
-      constructor @constructor {
+      constructor {
          /*@ Call the object's constructor.
 Should not be used with #eo_do. Only use it with #eo_do_super. */
          legacy: null;
@@ -178,6 +178,9 @@ callbacks of the same priority are called in reverse order of creation. */
         class.constructor;
         class.destructor;
    }
+   constructors {
+      .constructor;
+   }
    events {
       callback,add; /*@ A callback was added. */
       callback,del; /*@ A callback was deleted. */
index b74c991..6ce69c6 100644 (file)
@@ -1529,7 +1529,10 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
         check_next(ls, '.');
         if ((ls->t.token != TOK_VALUE) || (ls->t.kw == KW_get || ls->t.kw == KW_set))
           eo_lexer_syntax_error(ls, "name expected");
-        impl->full_name = eina_stringshare_add(ls->t.value.s);
+        if (impl->is_virtual)
+          impl->full_name = eina_stringshare_ref(ls->t.value.s);
+        else
+          impl->full_name = eina_stringshare_printf(".%s", ls->t.value.s);
         eo_lexer_get(ls);
         if (ls->t.token == '.')
           {
@@ -1613,7 +1616,7 @@ parse_constructor(Eo_Lexer *ls)
         check_next(ls, '.');
         if (ls->t.token != TOK_VALUE)
           eo_lexer_syntax_error(ls, "name expected");
-        ctor->full_name = eina_stringshare_add(ls->t.value.s);
+        ctor->full_name = eina_stringshare_printf(".%s", ls->t.value.s);
         eo_lexer_get(ls);
         check_next(ls, ';');
         return;
index b4c4703..ec862e1 100644 (file)
@@ -3,7 +3,7 @@ class Evas_3D_Node (Evas_3D_Object, Evas.Common_Interface)
    legacy_prefix: null;
    data: Evas_3D_Node_Data;
    methods {
-      constructor @constructor {
+      constructor {
          /*@ Constructor. */
          legacy: null;
          params {
@@ -582,4 +582,7 @@ class Evas_3D_Node (Evas_3D_Object, Evas.Common_Interface)
       Evas_3D_Object.update_notify;
       Evas_3D_Object.change_notify;
    }
+   constructors {
+      .constructor;
+   }
 }
index 4527e83..5956014 100644 (file)
@@ -1,6 +1,6 @@
 class Base {
    methods {
-      constructor @constructor {
+      constructor {
       }
       destructor {
       }
@@ -8,4 +8,7 @@ class Base {
    implements {
       @virtual .constructor;
    }
+   constructors {
+      .constructor;
+   }
 }
index 9a1d031..e1b6cfc 100644 (file)
@@ -1,12 +1,12 @@
 class Ctor_Dtor (Base) {
    methods {
-      custom_constructor_1 @constructor {
+      custom_constructor_1 {
          params {
             @in int a;
             @in char b;
          }
       }
-      custom_constructor_2 @constructor {
+      custom_constructor_2 {
       }
    }
    implements {
@@ -15,4 +15,8 @@ class Ctor_Dtor (Base) {
       Base.constructor;
       Base.destructor;
    }
+    constructors {
+        .custom_constructor_1;
+        .custom_constructor_2;
+    }
 }
index bec9d8f..b65efda 100644 (file)
@@ -26,13 +26,13 @@ class Object_Impl (Base) {
       }
    }
    methods {
-      constructor_1 @constructor {
+      constructor_1 {
          params {
             @in int a;
             @in char b;
          }
       }
-      constructor_2 @constructor {
+      constructor_2 {
       }
       foo1 {
          /*@ comment foo */
@@ -62,4 +62,8 @@ class Object_Impl (Base) {
       @virtual .pure_foo3;
       @virtual .b.get;
    }
+   constructors {
+      .constructor_1;
+      .constructor_2;
+   }
 }
index a90395a..4010fdd 100644 (file)
@@ -208,6 +208,7 @@ START_TEST(eolian_ctor_dtor)
    const Eolian_Function *impl_func = NULL;
    const Eolian_Class *class, *base;
    const Eolian_Implement *impl;
+   const Eolian_Constructor *ctor;
    void *dummy;
 
    eolian_init();
@@ -237,13 +238,20 @@ START_TEST(eolian_ctor_dtor)
    eina_iterator_free(iter);
 
    /* Custom ctors/dtors */
-   fail_if(!(impl_func = eolian_class_function_get_by_name(base, "constructor", EOLIAN_METHOD)));
-   fail_if(!eolian_function_is_constructing(impl_func));
    fail_if(!eolian_class_function_get_by_name(base, "destructor", EOLIAN_METHOD));
-   fail_if(!(impl_func = eolian_class_function_get_by_name(class, "custom_constructor_1", EOLIAN_METHOD)));
-   fail_if(!eolian_function_is_constructing(impl_func));
-   fail_if(!(impl_func = eolian_class_function_get_by_name(class, "custom_constructor_2", EOLIAN_METHOD)));
-   fail_if(!eolian_function_is_constructing(impl_func));
+   fail_if(!(iter = eolian_class_constructors_get(class)));
+   fail_if(!(eina_iterator_next(iter, (void**)&ctor)));
+   fail_if(!(impl_class = eolian_constructor_class_get(ctor)));
+   fail_if(!(impl_func = eolian_constructor_function_get(ctor)));
+   fail_if(impl_class != class);
+   fail_if(strcmp(eolian_function_name_get(impl_func), "custom_constructor_1"));
+   fail_if(!(eina_iterator_next(iter, (void**)&ctor)));
+   fail_if(!(impl_class = eolian_constructor_class_get(ctor)));
+   fail_if(!(impl_func = eolian_constructor_function_get(ctor)));
+   fail_if(impl_class != class);
+   fail_if(strcmp(eolian_function_name_get(impl_func), "custom_constructor_2"));
+   fail_if(eina_iterator_next(iter, &dummy));
+   eina_iterator_free(iter);
 
    eolian_shutdown();
 }
index 24cfa72..a22885e 100644 (file)
@@ -3,15 +3,15 @@ class Callback (Eo.Base)
    legacy_prefix: null;
    data: Callback_Data;
    methods {
-      default_constructor @constructor {
+      default_constructor {
       }
-      constructor @constructor {
+      constructor {
          params {
             @in Ecore_Cb cb;
             @in void* data;
          }
       }
-      constructor2 @constructor {
+      constructor2 {
          params {
             @in Ecore_Cb cb;
             @in void* data;
@@ -32,6 +32,11 @@ class Callback (Eo.Base)
          }
       }
    }
+    constructors {
+        .default_constructor;
+        .constructor;
+        .constructor2;
+    }
    events {
      call_on_add;
    }