From 77d148cec90b8ba82d6788c655ecc9ff9022522e Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Wed, 27 Aug 2014 15:01:09 +0100 Subject: [PATCH] eo: migrate constructors sections to constructing methods --- src/examples/eolian_cxx/colourable.eo | 13 ++++++----- src/examples/eolian_cxx/colourablesquare.eo | 7 +++--- src/lib/ecore/ecore_animator.eo | 12 ++++++---- src/lib/ecore/ecore_idle_enterer.eo | 8 ++++--- src/lib/ecore/ecore_idle_exiter.eo | 7 +++--- src/lib/ecore/ecore_idler.eo | 7 +++--- src/lib/ecore/ecore_job.eo | 7 +++--- src/lib/ecore/ecore_poller.eo | 7 +++--- src/lib/ecore/ecore_timer.eo | 36 ++++++++++++++--------------- src/lib/eo/eo_base.eo | 11 ++++----- src/lib/evas/canvas/evas_3d_node.eo | 9 ++++---- src/tests/eolian/data/base.eo | 6 ++--- src/tests/eolian/data/ctor_dtor.eo | 6 ++--- src/tests/eolian/data/object_impl.eo | 18 +++++++-------- src/tests/eolian_cxx/callback.eo | 13 ++++------- 15 files changed, 83 insertions(+), 84 deletions(-) diff --git a/src/examples/eolian_cxx/colourable.eo b/src/examples/eolian_cxx/colourable.eo index 29b221e..342790c 100644 --- a/src/examples/eolian_cxx/colourable.eo +++ b/src/examples/eolian_cxx/colourable.eo @@ -3,26 +3,27 @@ class Colourable (Eo.Base) /*@ Colourable class. */ legacy_prefix: legacy; data: Colourable_Data; - constructors { - constructor { + methods { + constructor @constructor { /*@ Default constructor. */ + legacy: null; } - rgb_composite_constructor { + rgb_composite_constructor @constructor { /*@ Composite RGB Constructor. */ + legacy: null; params { @in int r; /*@ The red component. */ @in int g; /*@ The green component. */ @in int b; /*@ The blue component. */ } } - rgb_24bits_constructor { + rgb_24bits_constructor @constructor { /*@ RGB Constructor. */ + legacy: null; params { @in int rgb; /*@ 24-bit RGB Component. */ } } - } - methods { print_colour { /*@ Print the RGB colour. */ } colour_mask { /*@ The masked RGB value. */ diff --git a/src/examples/eolian_cxx/colourablesquare.eo b/src/examples/eolian_cxx/colourablesquare.eo index 0a7c101..1d12862 100644 --- a/src/examples/eolian_cxx/colourablesquare.eo +++ b/src/examples/eolian_cxx/colourablesquare.eo @@ -2,14 +2,13 @@ class ColourableSquare (Colourable) { legacy_prefix: legacy; data: ColourableSquare_Data; - constructors { - size_constructor { + properties { + size_constructor @constructor { + legacy: null; params { @in int size; } } - } - properties { size { set { /*@ Sets size. */ diff --git a/src/lib/ecore/ecore_animator.eo b/src/lib/ecore/ecore_animator.eo index e9a3999..a0f0cfe 100644 --- a/src/lib/ecore/ecore_animator.eo +++ b/src/lib/ecore/ecore_animator.eo @@ -1,17 +1,19 @@ class Ecore.Animator (Eo.Base) { eo_prefix: ecore_animator; - constructors { - timeline_constructor { - /*@ Contructor. */ + methods { + timeline_constructor @constructor { + /*@ Constructor. */ + legacy: null; params { @in double runtime; @in Ecore_Timeline_Cb func; @in const(void)* data; } } - constructor { - /*@ Contructor. */ + constructor @constructor { + /*@ Constructor. */ + legacy: null; params { @in Ecore_Task_Cb func; @in const(void)* data; diff --git a/src/lib/ecore/ecore_idle_enterer.eo b/src/lib/ecore/ecore_idle_enterer.eo index b7f2c1e..8250d50 100644 --- a/src/lib/ecore/ecore_idle_enterer.eo +++ b/src/lib/ecore/ecore_idle_enterer.eo @@ -1,16 +1,18 @@ class Ecore.Idle.Enterer (Eo.Base) { eo_prefix: ecore_idle_enterer; - constructors { - before_constructor { + methods { + before_constructor @constructor { /*@ Contructor. Will insert the handler at the beginning of the list. */ + legacy: null; params { @in Ecore_Task_Cb func; @in const(void)* data; } } - after_constructor { + after_constructor @constructor { /*@ Contructor. Will insert the handler at the end of the list. */ + legacy: null; params { @in Ecore_Task_Cb func; @in const(void)* data; diff --git a/src/lib/ecore/ecore_idle_exiter.eo b/src/lib/ecore/ecore_idle_exiter.eo index c9eaf39..711ece6 100644 --- a/src/lib/ecore/ecore_idle_exiter.eo +++ b/src/lib/ecore/ecore_idle_exiter.eo @@ -1,9 +1,10 @@ class Ecore.Idle.Exiter (Eo.Base) { eo_prefix: ecore_idle_exiter; - constructors { - constructor { - /*@ Contructor. */ + methods { + constructor @constructor { + /*@ Constructor. */ + legacy: null; params { @in Ecore_Task_Cb func; @in const(void)* data; diff --git a/src/lib/ecore/ecore_idler.eo b/src/lib/ecore/ecore_idler.eo index 175cf1f5..e071567 100644 --- a/src/lib/ecore/ecore_idler.eo +++ b/src/lib/ecore/ecore_idler.eo @@ -1,9 +1,10 @@ class Ecore.Idler (Eo.Base) { eo_prefix: ecore_idler; - constructors { - constructor { - /*@ Contructor. */ + methods { + constructor @constructor { + /*@ Constructor. */ + legacy: null; params { @in Ecore_Task_Cb func; @in const(void)* data; diff --git a/src/lib/ecore/ecore_job.eo b/src/lib/ecore/ecore_job.eo index 21ed646..fdd5cb2 100644 --- a/src/lib/ecore/ecore_job.eo +++ b/src/lib/ecore/ecore_job.eo @@ -1,9 +1,10 @@ class Ecore.Job (Eo.Base) { eo_prefix: ecore_job; - constructors { - constructor { - /*@ Contructor. */ + methods { + constructor @constructor { + /*@ Constructor. */ + legacy: null; params { @in Ecore_Cb func; @in const(void)* data; diff --git a/src/lib/ecore/ecore_poller.eo b/src/lib/ecore/ecore_poller.eo index b1e040f..4dcf714 100644 --- a/src/lib/ecore/ecore_poller.eo +++ b/src/lib/ecore/ecore_poller.eo @@ -1,8 +1,9 @@ class Ecore.Poller (Eo.Base) { - constructors { - constructor { - /*@ Contructor with parameters for Ecore Poller. */ + methods { + constructor @constructor { + /*@ Constructor with parameters for Ecore Poller. */ + legacy: null; params { @in Ecore_Poller_Type type; @in int interval; diff --git a/src/lib/ecore/ecore_timer.eo b/src/lib/ecore/ecore_timer.eo index cc991bf..f83290a 100644 --- a/src/lib/ecore/ecore_timer.eo +++ b/src/lib/ecore/ecore_timer.eo @@ -8,24 +8,6 @@ class Ecore.Timer (Eo.Base) * guarantee exact timing, but try to work on a "best effort basis. */ eo_prefix: ecore_obj_timer; - constructors { - loop_constructor { - /*@ Create a timer to call in a given time from now */ - params { - @in double in; /*@ The time, in seconds, from now when to go off */ - @in Ecore_Task_Cb func; /*@ The callback function to call when the timer goes off */ - @in const(void)* data; /*@ A pointer to pass to the callback function as its data pointer */ - } - } - constructor { - /*@ Create a timer to call in a given time from when the mainloop woke up from sleep */ - params { - @in double in; /*@ The time, in seconds, from when the main loop woke up, to go off */ - @in Ecore_Task_Cb func; /*@ The callback function to call when the timer goes off */ - @in const(void)* data; /*@ A pointer to pass to the callback function as its data pointer */ - } - } - } properties { interval { set { @@ -48,6 +30,24 @@ class Ecore.Timer (Eo.Base) } } methods { + loop_constructor @constructor { + /*@ Create a timer to call in a given time from now */ + legacy: null; + params { + @in double in; /*@ The time, in seconds, from now when to go off */ + @in Ecore_Task_Cb func; /*@ The callback function to call when the timer goes off */ + @in const(void)* data; /*@ A pointer to pass to the callback function as its data pointer */ + } + } + constructor @constructor { + /*@ Create a timer to call in a given time from when the mainloop woke up from sleep */ + legacy: null; + params { + @in double in; /*@ The time, in seconds, from when the main loop woke up, to go off */ + @in Ecore_Task_Cb func; /*@ The callback function to call when the timer goes off */ + @in const(void)* data; /*@ A pointer to pass to the callback function as its data pointer */ + } + } reset { /*@ Reset a timer to its full interval. This effectively makes * the timer start ticking off from zero now. diff --git a/src/lib/eo/eo_base.eo b/src/lib/eo/eo_base.eo index 2fdad27..562119e 100644 --- a/src/lib/eo/eo_base.eo +++ b/src/lib/eo/eo_base.eo @@ -3,12 +3,6 @@ abstract Eo.Base () eo_prefix: eo; legacy_prefix: null; - constructors { - constructor { - /*@ Call the object's constructor. -Should not be used with #eo_do. Only use it with #eo_do_super. */ - } - } properties { parent { set { @@ -42,6 +36,11 @@ Return event freeze count. */ } } methods { + constructor @constructor { + /*@ Call the object's constructor. +Should not be used with #eo_do. Only use it with #eo_do_super. */ + legacy: null; + } event_callback_forwarder_del { /*@ Remove an event callback forwarder for an event and an object. */ params { diff --git a/src/lib/evas/canvas/evas_3d_node.eo b/src/lib/evas/canvas/evas_3d_node.eo index 96cae90..b4c4703 100644 --- a/src/lib/evas/canvas/evas_3d_node.eo +++ b/src/lib/evas/canvas/evas_3d_node.eo @@ -2,15 +2,14 @@ class Evas_3D_Node (Evas_3D_Object, Evas.Common_Interface) { legacy_prefix: null; data: Evas_3D_Node_Data; - constructors { - constructor { - /*@ Contructor. */ + methods { + constructor @constructor { + /*@ Constructor. */ + legacy: null; params { @in Evas_3D_Node_Type type; } } - } - methods { type_get @const { /* Get the type of the given node. diff --git a/src/tests/eolian/data/base.eo b/src/tests/eolian/data/base.eo index f6e83d7..948389a 100644 --- a/src/tests/eolian/data/base.eo +++ b/src/tests/eolian/data/base.eo @@ -1,9 +1,7 @@ class Base { - constructors { - constructor { - } - } methods { + constructor @constructor { + } destructor { } } diff --git a/src/tests/eolian/data/ctor_dtor.eo b/src/tests/eolian/data/ctor_dtor.eo index 047a668..9a1d031 100644 --- a/src/tests/eolian/data/ctor_dtor.eo +++ b/src/tests/eolian/data/ctor_dtor.eo @@ -1,12 +1,12 @@ class Ctor_Dtor (Base) { - constructors { - custom_constructor_1 { + methods { + custom_constructor_1 @constructor { params { @in int a; @in char b; } } - custom_constructor_2 { + custom_constructor_2 @constructor { } } implements { diff --git a/src/tests/eolian/data/object_impl.eo b/src/tests/eolian/data/object_impl.eo index 0eb08e0..425002d 100644 --- a/src/tests/eolian/data/object_impl.eo +++ b/src/tests/eolian/data/object_impl.eo @@ -1,14 +1,4 @@ class Object_Impl (Base) { - constructors { - constructor_1 { - params { - @in int a; - @in char b; - } - } - constructor_2 { - } - } properties { a { set { @@ -36,6 +26,14 @@ class Object_Impl (Base) { } } methods { + constructor_1 @constructor { + params { + @in int a; + @in char b; + } + } + constructor_2 @constructor { + } foo1 { /*@ comment foo */ params { diff --git a/src/tests/eolian_cxx/callback.eo b/src/tests/eolian_cxx/callback.eo index f1825c9..24cfa72 100644 --- a/src/tests/eolian_cxx/callback.eo +++ b/src/tests/eolian_cxx/callback.eo @@ -2,24 +2,22 @@ class Callback (Eo.Base) { legacy_prefix: null; data: Callback_Data; - constructors { - default_constructor { + methods { + default_constructor @constructor { } - constructor { + constructor @constructor { params { @in Ecore_Cb cb; @in void* data; } } - constructor2 { + constructor2 @constructor { params { @in Ecore_Cb cb; @in void* data; @in Ecore_Cb cb2; } } - } - methods { onecallback { params { @in Ecore_Cb cb; @@ -37,5 +35,4 @@ class Callback (Eo.Base) events { call_on_add; } -} - \ No newline at end of file +} \ No newline at end of file -- 2.7.4