static Eina_Bool
_ecore_timer_add(Ecore_Timer *obj,
                 Ecore_Timer_Private_Data *timer,
                 double now,
                 double in,
                 Ecore_Task_Cb func,
                 const void *data)
{

   if (EINA_UNLIKELY(!eina_main_loop_is()))
     {
        eo_error_set(obj);
        EINA_MAIN_LOOP_CHECK_RETURN_VAL(EINA_FALSE);
     }

   timer->obj = obj;
   eo_do_super(obj, eo_constructor());
   eo_manual_free_set(obj, EINA_TRUE);

   if (!func)
     {
        eo_error_set(obj);
        ERR("callback function must be set up for an object of class: '%s'", MY_CLASS_NAME);
        return EINA_FALSE;
     }

   if (in < 0.0) in = 0.0;

#ifdef WANT_ECORE_TIMER_DUMP
   timer->timer_bt_num = backtrace((void **)(timer->timer_bt),
                                   ECORE_TIMER_DEBUG_BT_NUM);
#endif
   _ecore_timer_set(obj, now + in, in, func, (void *)data);
   return EINA_TRUE;
}
Beispiel #2
0
EOLIAN static Eo_Base *
_emerite_eo_base_constructor(Eo *obj, Emerite_Data *pd)
{
    Eina_Bool chk;
    char exe[PATH_MAX];
    const char exe_name[] = "emerite";

    obj = eo_constructor(eo_super(obj, MY_CLASS));

    if (email_in_tree_is())
    {
        snprintf(exe, sizeof(exe), "%s/emerite/%s", BUILD_BIN_DIR, exe_name);
    }
    else
    {
        snprintf(exe, sizeof(exe), "%s", exe_name);
    }
    exe[sizeof(exe) - 1] = '\0';

    pd->exe = ecore_exe_pipe_run(exe, ECORE_EXE_TERM_WITH_PARENT, pd);
    if (EINA_UNLIKELY(!pd->exe))
    {
        EINA_LOG_CRIT("Failed to create Ecore_Exe");
        return NULL; // FIXME leak
    }

    chk = email_subprocess_callback_register(pd->exe, ECORE_EXE_EVENT_DEL,
            _exe_del_cb, obj);
    if (EINA_UNLIKELY(!chk))
    {
        EINA_LOG_CRIT("Failed to register deletion callback");
        return NULL; // FIXME leak
    }
    return obj;
}
Beispiel #3
0
static Eina_Bool
_ecore_idle_enterer_add(Ecore_Idle_Enterer *obj,
                    Ecore_Idle_Enterer_Data *ie,
                    Ecore_Task_Cb func,
                    const void   *data)
{
    if (EINA_UNLIKELY(!eina_main_loop_is()))
      {
         eo_error_set(obj);
         EINA_MAIN_LOOP_CHECK_RETURN_VAL(EINA_FALSE);
      }

   ie->obj = obj;
   eo_do_super(obj, MY_CLASS, eo_constructor());
   eo_manual_free_set(obj, EINA_TRUE);

   if (!func)
     {
        eo_error_set(obj);
        ERR("callback function must be set up for an object of class: '%s'", MY_CLASS_NAME);
        return EINA_FALSE;
     }

   ie->func = func;
   ie->data = (void *)data;
   return EINA_TRUE;
}
Beispiel #4
0
EOLIAN static void
_edje_object_eo_base_constructor(Eo *obj, Edje *ed)
{
   ed->base = eo_data_ref(obj, EVAS_SMART_CLIPPED_CLASS);

   eo_do_super(obj, MY_CLASS, eo_constructor());
   eo_do(obj, evas_obj_type_set(MY_CLASS_NAME_LEGACY));
   _edje_lib_ref();
}
Beispiel #5
0
EOLIAN static Eo *
_evas_canvas3d_primitive_eo_base_constructor(Eo *obj, Evas_Canvas3D_Primitive_Data *pd)
{
   obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
   eo_do(obj, evas_canvas3d_object_type_set(EVAS_CANVAS3D_OBJECT_TYPE_PRIMITIVE));
   _primitive_init(pd);

   return obj;
}
Beispiel #6
0
EOLIAN static void
_evas_3d_object_eo_base_constructor(Eo *obj, Evas_3D_Object_Data *pd)
{
   Eo *e = NULL;
   eo_do_super(obj, MY_CLASS, eo_constructor());
   eo_do(obj, e = eo_parent_get());
   pd->evas = e;
   pd->type = EVAS_3D_OBJECT_TYPE_INVALID;
   memset(&pd->dirty[0], 0x00, sizeof(Eina_Bool) * EVAS_3D_STATE_MAX);
}
Beispiel #7
0
static void
_colourablesquare_size_constructor(Eo *obj, ColourableSquare_Data *self, int size)
{
   if(!_colourablesquare_impl_logdomain)
     {
        _colourablesquare_impl_logdomain
          = eina_log_domain_register
          ("colourablesquare", EINA_COLOR_LIGHTBLUE);
     }
   self->size = size;
   DBG("_colourablesquare_constructor(%d)\n", size);
   eo_do_super(obj, MY_CLASS, eo_constructor());
}
static void
_simple_constructor(Eo *obj, void *class_data, va_list *list)
{
   Private_Data *pd = class_data;
   int a;
   a = va_arg(*list, int);

   eo_do_super(obj, eo_constructor());

   pd->a = a;
   printf("%s %d\n", __func__, pd->a);

   my_init_count++;
}
Beispiel #9
0
EOLIAN static void
_evas_out_eo_base_constructor(Eo *eo_obj, Evas_Out_Data *eo_dat)
{
   Eo *eo_parent = NULL;
   Evas_Public_Data *e;

   eo_do(eo_obj, eo_parent = eo_parent_get());
   e = eo_data_scope_get(eo_parent, EVAS_CLASS);

   eo_do_super(eo_obj, MY_CLASS, eo_constructor());

   if (!e) return;
   e->outputs = eina_list_append(e->outputs, eo_obj);
   if (e->engine.func->info) eo_dat->info = e->engine.func->info(eo_parent);
   // XXX: context and output are currently held in the core engine and are
   // allocated by engine specific internal code. this all needs a new engine
   // api to make it work
}
Beispiel #10
0
   (void) data;
   (void) desc;

   if (callback_array->desc != EV_A_CHANGED)
      return EINA_TRUE;

   pd->cb_count--;

   printf("Removed EV_A_CHANGED callback from %p. Count: %d\n", obj, pd->cb_count);
   return EO_CALLBACK_CONTINUE;
}

static Eo *
_constructor(Eo *obj, void *class_data EINA_UNUSED)
{
   obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());

   eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, NULL));
   eo_do(obj, eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, NULL));

   eo_do(obj, eo_key_data_set("cb_count", NULL));

   return obj;
}

EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);

static Eo_Op_Description op_descs[] = {
     EO_OP_FUNC_OVERRIDE(eo_constructor, _constructor),
     EO_OP_FUNC(simple_a_set, _a_set),
};