so given:

--------------------------------

class Tst (Eo_Base)
{
   eo_prefix: tst;
   data: Tst_Data;
   properties {
      name {
         set { /*@ This sets the name of the tst object */
         }
         get { /*@ This gets the name of the tst object if set */
         }
         values {
            const char *name; /*@ The name of the tst object as a C string */
         }
      }
      size {
         set { /*@ This sets the size of the object, and on failure returns
EINA_TRUE, and on failure EINA_FALSE */ return Eina_Bool; /* returns EINA_TRUE
on success and EINA_FALSE on failure */ }
         get { /*@ This gets the size set */
         }
         values {
            int size; /*@ The size in pixels */
         }
      }
   }
   methods {
      activate { /*@ This method will activate the tst object, and when
                  * called, any events listening to activated will be
                  * triggered */
         params {
            @in int number; /*@ The number of pixels to activate */
            @in const char *string; /*@ A label to display on activation */
         }
         return Eina_Bool; /* If activation succeeds, return EINA_TRUE, and on
failure EINA_FALSE */ }
      disable { /*@ This disables the tst object to the level intidicated */
         params {
            @in int level; /*@ This is the disabling level to use */
         }
      }
   }
   implements {
      Eo_Base::destructor;
   }
   events {
      activated; /*@ When the tst object has been activated */
      disabled; /*@ When the tst object has been disabled */
   }
}

--------------------------------

then i need to make my actual implementation of code, but in this, all the
lines marked with // GENME imho should be able to be auto-generated (or
appended) to save a lot of copy & paste work and trying to figure out what to
put in the heading (includes etc.

--------------------------------

#define EFL_BETA_API_SUPPORT // GENME
#include <Eo.h> // GENME
#include "tst.eo.h" // GENME

#define EO_BASE_CLASS EO_CLASS

typedef struct // GENME
{ // GENME
   int size;
   char *name;
   Eina_Bool activated : 1;
   Eina_Bool disabled : 1;
} Tst_Data; // GENME

EOLIAN static void _tst_name_set(Eo *obj, Tst_Data *pd, const char *name) //
GENME { // GENME
   printf("set %s\n", name);
   pd->name = strdup(name);
} // GENME

EOLIAN static const char * _tst_name_get(Eo *obj, Tst_Data *pd) // GENME
{ // GENME
   return pd->name;
} // GENME

EOLIAN static Eina_Bool _tst_size_set(Eo *obj, Tst_Data *pd, int size) // GENME
{ // GENME
   printf("size set %i\n", size);
   pd->size = size;
} // GENME

EOLIAN static int _tst_size_get(Eo *obj, Tst_Data *pd) // GENME
{ // GENME
   return pd->size;
} // GENME

EOLIAN static Eina_Bool _tst_activate(Eo *obj, Tst_Data *pd, int number, const
char *string) // GENME { // GENME
   printf("activate! %i '%s'\n", number, string);
   pd->activated = EINA_TRUE;
   // strictly correct...
   eo_do(obj, eo_event_callback_call(TST_EVENT_ACTIVATED, NULL));
} // GENME

EOLIAN static void _tst_disable(Eo *obj, Tst_Data *pd, int level) // GENME
{ // GENME
   printf("disable\n");
   pd->disabled = EINA_TRUE;
   // this is just fine. it's a local call within  an eo_do() already
   // due to eo_do handling its own stack. this works with any method
   // actually that this object inherits/supports
   eo_event_callback_call(TST_EVENT_DISABLED, NULL);
} // GENME

EOLIAN static void _tst_eo_base_destructor(Eo *obj, Tst_Data *pd) // GENME
{ // GENME
   if (pd->name) free(pd->name);
   eo_do_super(obj, TST_CLASS, eo_destructor()); // GENME
} // GENME

#include "tst.eo.c"

--------------------------------

notice how much of that file is boilerplate copies from tst.eo.c or just is
standard stuff anyway? this would make things far less mysterious and
painful. :)

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com

Attachment: tst.eo
Description: Binary data

#define EFL_BETA_API_SUPPORT // GENME
#include <Eo.h> // GENME
#include "tst.eo.h" // GENME

#define EO_BASE_CLASS EO_CLASS

typedef struct // GENME
{ // GENME
   int size;
   char *name;
   Eina_Bool activated : 1;
   Eina_Bool disabled : 1;
} Tst_Data; // GENME

EOLIAN static void _tst_name_set(Eo *obj, Tst_Data *pd, const char *name) // GENME
{ // GENME
   printf("set %s\n", name);
   pd->name = strdup(name);
} // GENME

EOLIAN static const char * _tst_name_get(Eo *obj, Tst_Data *pd) // GENME
{ // GENME
   return pd->name;
} // GENME

EOLIAN static Eina_Bool _tst_size_set(Eo *obj, Tst_Data *pd, int size) // GENME
{ // GENME
   printf("size set %i\n", size);
   pd->size = size;
} // GENME

EOLIAN static int _tst_size_get(Eo *obj, Tst_Data *pd) // GENME
{ // GENME
   return pd->size;
} // GENME

EOLIAN static Eina_Bool _tst_activate(Eo *obj, Tst_Data *pd, int number, const char *string) // GENME
{ // GENME
   printf("activate! %i '%s'\n", number, string);
   pd->activated = EINA_TRUE;
   // strictly correct...
   eo_do(obj, eo_event_callback_call(TST_EVENT_ACTIVATED, NULL));
} // GENME

EOLIAN static void _tst_disable(Eo *obj, Tst_Data *pd, int level) // GENME
{ // GENME
   printf("disable\n");
   pd->disabled = EINA_TRUE;
   // this is just fine. it's a local call within  an eo_do() already
   // due to eo_do handling its own stack. this works with any method
   // actually that this object inherits/supports
   eo_event_callback_call(TST_EVENT_DISABLED, NULL);
} // GENME

EOLIAN static void _tst_eo_base_destructor(Eo *obj, Tst_Data *pd) // GENME
{ // GENME
   if (pd->name) free(pd->name);
   eo_do_super(obj, TST_CLASS, eo_destructor()); // GENME
} // GENME

#include "tst.eo.c"
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to