Eolian-Cxx: Corrected the syntax of the .eo examples and added missing includes.
authorSavio Sena <savio@expertisesolutions.com.br>
Thu, 19 Jun 2014 22:54:36 +0000 (23:54 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Thu, 19 Jun 2014 22:54:36 +0000 (23:54 +0100)
Summary: Just updating the .eo's to match the new syntax.

Reviewers: cedric, q66, tasn, JackDanielZ

Reviewed By: q66

CC: felipealmeida, smohanty, woohyun, cedric
Differential Revision: https://phab.enlightenment.org/D1067

src/examples/eolian_cxx/colourable.c
src/examples/eolian_cxx/colourable.eo
src/examples/eolian_cxx/colourablesquare.c
src/examples/eolian_cxx/colourablesquare.eo
src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
src/examples/eolian_cxx/eolian_cxx_simple_01.cc

index 3e28958..9bbcce2 100644 (file)
@@ -40,7 +40,7 @@ typedef struct _Colourable_Data  Colourable_Data;
   Colourable_Data *wd = eo_data_scope_get(o, MY_CLASS)
 
 void
-_colourable_constructor(Eo *obj, Colourable_Data *self)
+_colourable_constructor(Eo *obj, Colourable_Data *self EINA_UNUSED)
 {
    if(!_colourable_impl_logdomain)
      {
@@ -52,7 +52,7 @@ _colourable_constructor(Eo *obj, Colourable_Data *self)
 }
 
 void
-_colourable_destructor(Eo *obj, Colourable_Data *self)
+_colourable_destructor(Eo *obj, Colourable_Data *self EINA_UNUSED)
 {
    if(_colourable_impl_logdomain)
      {
@@ -98,13 +98,13 @@ _colourable_rgb_24bits_constructor(Eo *obj, Colourable_Data *self, int rgb)
 }
 
 void
-_colourable_print_colour(Eo *obj, Colourable_Data *self)
+_colourable_print_colour(Eo *obj EINA_UNUSED, Colourable_Data *self EINA_UNUSED)
 {
    DBG("_colourable_print_colour() ==> 0x%2.x 0x%2.x 0x%2.x\n", self->r, self->g, self->b);
 }
 
 int
-_colourable_colour_mask(Eo *obj, Colourable_Data *self, int mask)
+_colourable_colour_mask(Eo *obj EINA_UNUSED, Colourable_Data *self, int mask)
 {
    int masked_rgb =
      (((self->r << 16)& 0x00ff0000) |
@@ -115,7 +115,7 @@ _colourable_colour_mask(Eo *obj, Colourable_Data *self, int mask)
 }
 
 void
-_colourable_composite_colour_get(Eo *obj, Colourable_Data *self, int* r, int* g, int* b)
+_colourable_composite_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self, int* r, int* g, int* b)
 {
    *r = self->r;
    *g = self->g;
@@ -125,7 +125,7 @@ _colourable_composite_colour_get(Eo *obj, Colourable_Data *self, int* r, int* g,
 }
 
 void
-_colourable_composite_colour_set(Eo *obj, Colourable_Data *self, int r, int g, int b)
+_colourable_composite_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int r, int g, int b)
 {
    self->r = r;
    self->g = g;
@@ -136,7 +136,7 @@ _colourable_composite_colour_set(Eo *obj, Colourable_Data *self, int r, int g, i
 }
 
 int
-_colourable_colour_get(Eo *obj, Colourable_Data *self)
+_colourable_colour_get(Eo *obj EINA_UNUSED, Colourable_Data *self)
 {
    int rgb =
      ((self->r << 16)& 0x00ff0000) |
@@ -147,7 +147,7 @@ _colourable_colour_get(Eo *obj, Colourable_Data *self)
 }
 
 void
-_colourable_colour_set(Eo *obj, Colourable_Data *self, int rgb)
+_colourable_colour_set(Eo *obj EINA_UNUSED, Colourable_Data *self, int rgb)
 {
    self->r = (rgb & 0x00ff0000) >> 16;
    self->g = (rgb & 0x0000ff00) >> 8;
@@ -156,10 +156,4 @@ _colourable_colour_set(Eo *obj, Colourable_Data *self, int rgb)
    return;
 }
 
-static void
-_user_colourable_class_constructor(Eo_Class *klass)
-{
-   DBG("_colourable_class_constructor()\n");
-}
-
 #include "colourable.eo.c"
index a708217..22bd59e 100644 (file)
@@ -2,6 +2,7 @@ class Colourable (Eo_Base)
 {
     /*@ Colourable class. */
     legacy_prefix: legacy;
+    data: Colourable_Data;
     constructors {
         constructor {
             /*@ Default constructor. */
@@ -12,52 +13,52 @@ class Colourable (Eo_Base)
                 @in int r; /*@ The red component. */
                 @in int g; /*@ The green component. */
                 @in int b; /*@ The blue component. */
-               };
-        };
+               }
+        }
         rgb_24bits_constructor {
             /*@ RGB Constructor. */
             params {
                 @in int rgb; /*@ 24-bit RGB Component. */
-            };
-        };
-    };
+            }
+        }
+    }
     methods {
-        print_colour { /*@ Print the RGB colour. */ };
+        print_colour { /*@ Print the RGB colour. */ }
         colour_mask {
             /*@ The masked RGB value. */
-            return int;
             params {
                 @in int mask; /*@ The colour mask to be applied to current RGB value. */
-            };
-        };
-    };
+            }
+            return int; /*@ The RGB colour. */
+        }
+    }
     properties {
         colour {
             set {
                 /*@ Sets a 24-bit RGB colour. */
-            };
+            }
             get {
                 /*@ Gets the 24-bit RGB colour. */
-            };
+            }
             values {
                 int rgb; /*@ The RGB colour value. */
-            };
-        };
+            }
+        }
         composite_colour {
             set {
                 /*@ Sets a composite RGB colour. */
-            };
+            }
             get {
                 /*@ Gets the composite RGB colour. */
-            };
+            }
             values {
                 int r; /*@ The red component. */
                 int g; /*@ The green component. */
                 int b; /*@ The blue component. */
-            };
-        };
-    };
+            }
+        }
+    }
     events {
         colour_changed(int);
-    };
-};
+    }
+}
index 1eb190c..9ed046a 100644 (file)
@@ -52,40 +52,23 @@ _colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int siz
    eo_do_super(obj, MY_CLASS, eo_constructor());
 }
 
-static void
-_colourablesquare_destructor(Eo *obj, ColourableSquare_Data *self)
-{
-   eo_do_super(obj, MY_CLASS, eo_destructor());
-   if(_colourablesquare_impl_logdomain)
-     {
-        eina_log_domain_unregister(_colourablesquare_impl_logdomain);
-        _colourablesquare_impl_logdomain = 0;
-     }
-}
-
 static int
-_colourablesquare_size_get(Eo *obj, ColourableSquare_Data *self)
+_colourablesquare_size_get(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
 {
    DBG("_colourablesquare_size_get() => %d\n", self->size);
    return self->size;
 }
 
 static void
-_colourablesquare_size_print(Eo *obj, ColourableSquare_Data *self)
+_colourablesquare_size_print(Eo *obj EINA_UNUSED, ColourableSquare_Data *self)
 {
    DBG("_colourablesquare_size_print() ==> %d\n", self->size);
 }
 
 static void
-_colourablesquare_size_set(Eo *obj, ColourableSquare_Data *self, int size)
+_colourablesquare_size_set(Eo *obj EINA_UNUSED, ColourableSquare_Data *self EINA_UNUSED, int size)
 {
    DBG("_colourablesquare_size_set(%d)\n", size);
 }
 
-static void
-_user_colourablesquare_class_constructor(Eo_Class *klass)
-{
-   DBG("_colourablesquare_class_constructor()\n");
-}
-
 #include "colourablesquare.eo.c"
index d254151..0a7c101 100644 (file)
@@ -1,23 +1,28 @@
 class ColourableSquare (Colourable)
 {
-    constructors {
-       size_constructor { params { @in int size; } }
-    };
     legacy_prefix: legacy;
+    data: ColourableSquare_Data;
+    constructors {
+       size_constructor {
+           params {
+              @in int size;
+           }
+       }
+    }
     properties {
         size {
-            values {
-                int size;
-            };
             set {
                 /*@ Sets size. */
-            };
+            }
             get {
                 /*@ Gets size. */
-            };
-        };
-    };
+            }
+            values {
+                int size; /*@ The size. */
+            }
+        }
+    }
     methods {
-        size_print { /*@ Show the square. */ };
-    };
-};
+        size_print { /*@ Show the square. */ }
+    }
+}
index 798b3a8..763e0c3 100644 (file)
@@ -1,5 +1,6 @@
 
 #include <iostream>
+#include <cassert>
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
index 363073a..0a35f93 100644 (file)
@@ -1,6 +1,7 @@
 // EINA_LOG_LEVELS=colourable:4,colourablesquare:4 ./eolian_cxx_simple_01
 
 #include <iostream>
+#include <cassert>
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>