// Clearly duplicated and should be in a common place...
static Eina_Bool
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
{
   if (pd->pat) return EINA_FALSE;

   Ector_Renderer_Generic_Gradient_Radial_Data *gld;

   // FIXME: don't ignore clipping !
   gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN);
   if (!pd->pat || !gld) return EINA_FALSE;

   eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, ector_renderer_draw(op, clips, mul_col));

   USE(obj, cairo_arc, EINA_FALSE);
   USE(obj, cairo_fill, EINA_FALSE);

   cairo_arc(pd->parent->cairo,
             gld->radial.x, gld->radial.y,
             gld->radius,
             0, 2 * M_PI);
   eo_do(obj, ector_renderer_cairo_base_fill());
   cairo_fill(pd->parent->cairo);

   return EINA_TRUE;
}
Example #2
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;
}
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;
}
Example #4
0
EOLIAN static void
_ecore_idler_eo_base_destructor(Eo *obj, Ecore_Idler_Data *idler)
{
   idler->delete_me = 1;
   idlers_delete_me = 1;

   eo_do_super(obj, MY_CLASS, eo_destructor());
}
Example #5
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();
}
Example #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);
}
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;
     }
}
Example #8
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++;
}
Example #10
0
File: main.c Project: wargio/e17
int
main(int argc, char *argv[])
{
   (void) argc;
   (void) argv;
   eo_init();

   Eo *obj = eo_add(INHERIT2_CLASS, NULL);

   eo_do(obj, simple_a_set(1));
   Simple_Public_Data *pd = eo_data_get(obj, SIMPLE_CLASS);
   fail_if(pd->a != 2);

   eo_unref(obj);

   obj = eo_add(INHERIT3_CLASS, NULL);

   eo_do(obj, simple_a_set(1));
   pd = eo_data_get(obj, SIMPLE_CLASS);
   fail_if(pd->a != 3);

   eo_unref(obj);

   obj = eo_add(INHERIT2_CLASS, NULL);
   eo_do(obj, inherit2_print());
   eo_unref(obj);

   obj = eo_add(SIMPLE_CLASS, NULL);
   fail_if(eo_do(obj, inherit2_print2()));

   fail_if(eo_do_super(obj, simple_a_print()));

   fail_if(eo_do(obj, simple_class_print()));

   fail_if(!eo_class_do(SIMPLE_CLASS, simple_class_print()));
   fail_if(!eo_class_do(INHERIT_CLASS, simple_class_print()));
   fail_if(!eo_class_do(INHERIT2_CLASS, simple_class_print()));
   fail_if(!eo_class_do(INHERIT3_CLASS, simple_class_print()));

   fail_if(eo_class_do(SIMPLE_CLASS, simple_a_print()));

   eo_constructor_super(obj);
   eo_destructor_super(obj);

   eo_unref(obj);

   eo_shutdown();
   return 0;
}
Example #11
0
EOLIAN static Eina_Bool
_elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd)
{
   Eina_List *l;
   Elm_Object_Item *it;

   if (sd->auto_hide) evas_object_hide(obj);

   EINA_LIST_FOREACH(sd->items, l, it)
     eo_do(it, elm_wdg_item_translate());

   eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());

   return EINA_TRUE;
}
Example #12
0
EOLIAN static void
_evas_out_eo_base_destructor(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);
   if (!e) return ;
   // XXX: need to free output and context one they get allocated one day
   // e->engine.func->context_free(eo_dat->output, eo_dat->context);
   // e->engine.func->output_free(eo_dat->output);
   e->engine.func->info_free(eo_parent, eo_dat->info);
   e->outputs = eina_list_remove(e->outputs, eo_obj);
   eo_do_super(eo_obj, MY_CLASS, eo_destructor());
}
static Eina_Bool
_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd)
{
   Ector_Renderer_Generic_Gradient_Radial_Data *grd;
   Ector_Renderer_Generic_Gradient_Data *gd;
   unsigned int i;

   eo_do_super(obj, ECTOR_RENDERER_CAIRO_GRADIENT_RADIAL_CLASS, ector_renderer_prepare());

   if (pd->pat) return EINA_FALSE;

   grd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN);
   gd = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN);
   if (!grd || !gd) return EINA_FALSE;

   USE(obj, cairo_pattern_create_radial, EINA_FALSE);
   USE(obj, cairo_pattern_add_color_stop_rgba, EINA_FALSE);

   pd->pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0,
                                         grd->radial.x, grd->radial.y, grd->radius);

   int r,g,b,a;
   for (i = 0; i < gd->colors_count; i++)
     {
       r = gd->colors[i].r;
       g = gd->colors[i].g;
       b = gd->colors[i].b;
       a = gd->colors[i].a;
       ector_color_argb_unpremul(a, &r, &g, &b);
       cairo_pattern_add_color_stop_rgba(pd->pat, gd->colors[i].offset, r/255.0, g/255.0, b/255.0, a/255.0);
     }

   USE(obj, cairo_pattern_set_extend, EINA_FALSE);
   cairo_pattern_set_extend(pd->pat, _ector_cairo_extent_get(gd->s));

   if (!pd->parent)
     {
        Eo *parent;

        eo_do(obj, parent = eo_parent_get());
        if (!parent) return EINA_FALSE;
        pd->parent = eo_data_xref(parent, ECTOR_CAIRO_SURFACE_CLASS, obj);
     }

   return EINA_FALSE;
}
Example #14
0
END_TEST

START_TEST(eo_op_not_found_in_super)
{
   eo_init();
   eina_log_print_cb_set(eo_test_print_cb, &ctx);

   Eo *obj = eo_add(SIMPLE_CLASS, NULL);
   fail_if(!obj);

   TEST_EO_ERROR("_eo_call_resolve", "in %s:%d: func '%s' (%d) could not be resolved for class '%s' for super of '%s'.");
   eo_do_super(obj, SIMPLE_CLASS, simple_a_set(10));
   fail_unless(ctx.did);

   eo_unref(obj);
   eina_log_print_cb_set(eina_log_print_cb_stderr, NULL);
   eo_shutdown();
}
Example #15
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
}
Example #16
0
EOLIAN static Eina_Bool
_elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
{
   Eina_Bool int_ret = EINA_FALSE;
   eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
   if (!int_ret) return EINA_FALSE;

   _mirrored_set(obj, elm_widget_mirrored_get(obj));

   _notify_theme_apply(obj);
   if (sd->block_events) _block_events_theme_apply(obj);

   edje_object_scale_set
     (sd->notify, elm_widget_scale_get(obj) * elm_config_scale_get());

   _sizing_eval(obj);

   return EINA_TRUE;
}
Example #17
0
static int
_ab_sum_get(Eo *obj, void *class_data)
{
   /* This cast is a hack just for the tests... */
   Mixin2_Public_Data *pd = (Mixin2_Public_Data *) class_data;
   int sum = 0;
   printf("%s %s\n", eo_class_name_get(MY_CLASS), __func__);
   eo_do_super(obj, MY_CLASS, sum = mixin_ab_sum_get());

   ++sum;
   pd->count += 2;

     {
        int _a = 0, _b = 0;
        eo_do(obj, _a = simple_a_get(), _b = simple_b_get());
        fail_if(sum != _a + _b + 1);
     }

   return sum;
}
Example #18
0
static void
_elm_panes_smart_theme(Eo *obj, void *_pd, va_list *list)
{
   double size;
   Evas_Coord minw = 0, minh = 0;

   Elm_Panes_Smart_Data *sd = _pd;
   Eina_Bool *ret = va_arg(*list, Eina_Bool *);
   if (ret) *ret = EINA_FALSE;
   Eina_Bool int_ret = EINA_FALSE;
   ELM_LAYOUT_DATA_GET(obj, ld);

   if (sd->horizontal)
     eina_stringshare_replace(&ld->group, "horizontal");
   else
     eina_stringshare_replace(&ld->group, "vertical");

   evas_object_hide(sd->event);
   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
   evas_object_size_hint_min_set(sd->event, minw, minh);

   eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret));
   if (!int_ret) return;

   size = elm_panes_content_left_size_get(obj);

   if (sd->fixed)
     {
        elm_layout_signal_emit(obj, "elm,panes,fixed", "elm");

        //TODO: remove this signal on EFL 2.0.
        // I left this due to the backward compatibility.
        elm_layout_signal_emit(obj, "elm.panes.fixed", "elm");
     }

   elm_layout_sizing_eval(obj);

   elm_panes_content_left_size_set(obj, size);

   if (ret) *ret = EINA_TRUE;
}
Example #19
0
static void
_elm_notify_smart_theme(Eo *obj, void *_pd, va_list *list)
{
   Elm_Notify_Smart_Data *sd = _pd;
   Eina_Bool *ret = va_arg(*list, Eina_Bool *);
   if (ret) *ret = EINA_FALSE;
   Eina_Bool int_ret = EINA_FALSE;

   eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret));
   if (!int_ret) return;

   _mirrored_set(obj, elm_widget_mirrored_get(obj));

   _notify_theme_apply(obj);
   if (sd->block_events) _block_events_theme_apply(obj);

   edje_object_scale_set
     (sd->notify, elm_widget_scale_get(obj) * elm_config_scale_get());

   _sizing_eval(obj);

   if (ret) *ret = EINA_TRUE;
}