EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(efl_gfx_buffer_size_set, EFL_FUNC_CALL(sz), Eina_Size2D sz);
EAPI EAPI_WEAK EFL_FUNC_BODY_CONST(efl_gfx_buffer_size_get, Eina_Size2D, ((Eina_Size2D){0}));
EAPI EAPI_WEAK EFL_FUNC_BODY_CONST(efl_gfx_buffer_colorspace_get, Efl_Gfx_Colorspace, 0);

static Eina_Error
__eolian_efl_gfx_buffer_alpha_set_reflect(Eo *obj, Eina_Value val)
{
   Eina_Error r = 0;   Eina_Bool cval;
   if (!eina_value_bool_convert(&val, &cval))
      {
         r = EINA_ERROR_VALUE_FAILED;
         goto end;
      }
   efl_gfx_buffer_alpha_set(obj, cval);
 end:
   eina_value_flush(&val);
   return r;
}

EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(efl_gfx_buffer_alpha_set, EFL_FUNC_CALL(alpha), Eina_Bool alpha);

static Eina_Value
__eolian_efl_gfx_buffer_alpha_get_reflect(const Eo *obj)
{
   Eina_Bool val = efl_gfx_buffer_alpha_get(obj);
   return eina_value_bool_init(val);
}

EAPI EAPI_WEAK EFL_FUNC_BODY_CONST(efl_gfx_buffer_alpha_get, Eina_Bool, 0);

static Eina_Value
__eolian_efl_gfx_buffer_stride_get_reflect(const Eo *obj)
{
   int val = efl_gfx_buffer_stride_get(obj);
   return eina_value_int_init(val);
}

EAPI EAPI_WEAK EFL_FUNC_BODY_CONST(efl_gfx_buffer_stride_get, int, 0);
EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV(efl_gfx_buffer_update_add, EFL_FUNC_CALL(region), const Eina_Rect *region);
EAPI EAPI_WEAK EFL_VOID_FUNC_BODYV_CONST(efl_gfx_buffer_borders_get, EFL_FUNC_CALL(l, r, t, b), unsigned int *l, unsigned int *r, unsigned int *t, unsigned int *b);
EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_gfx_buffer_map, Eina_Rw_Slice, ((Eina_Rw_Slice){0}), EFL_FUNC_CALL(mode, region, cspace, plane, stride), Efl_Gfx_Buffer_Access_Mode mode, const Eina_Rect *region, Efl_Gfx_Colorspace cspace, int plane, int *stride);
EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_gfx_buffer_unmap, Eina_Bool, 0, EFL_FUNC_CALL(slice), Eina_Rw_Slice slice);
EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_gfx_buffer_copy_set, Eina_Bool, 0, EFL_FUNC_CALL(slice, size, stride, cspace, plane), const Eina_Slice *slice, Eina_Size2D size, int stride, Efl_Gfx_Colorspace cspace, int plane);
EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_gfx_buffer_managed_set, Eina_Bool, 0, EFL_FUNC_CALL(slice, size, stride, cspace, plane), const Eina_Slice *slice, Eina_Size2D size, int stride, Efl_Gfx_Colorspace cspace, int plane);
EAPI EAPI_WEAK EFL_FUNC_BODYV(efl_gfx_buffer_managed_get, Eina_Slice, ((Eina_Slice){0}), EFL_FUNC_CALL(plane), int plane);

static Eina_Bool
_efl_gfx_buffer_class_initializer(Efl_Class *klass)
{
   const Efl_Object_Ops *opsp = NULL;

   const Efl_Object_Property_Reflection_Ops *ropsp = NULL;

#ifndef EFL_GFX_BUFFER_EXTRA_OPS
#define EFL_GFX_BUFFER_EXTRA_OPS
#endif

   EFL_OPS_DEFINE(ops,
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_size_set, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_size_get, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_colorspace_get, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_alpha_set, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_alpha_get, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_stride_get, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_update_add, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_borders_get, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_map, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_unmap, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_copy_set, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_managed_set, NULL),
      EFL_OBJECT_OP_FUNC(efl_gfx_buffer_managed_get, NULL),
      EFL_GFX_BUFFER_EXTRA_OPS
   );
   opsp = &ops;

   static const Efl_Object_Property_Reflection refl_table[] = {
      {"alpha", __eolian_efl_gfx_buffer_alpha_set_reflect, __eolian_efl_gfx_buffer_alpha_get_reflect},
      {"stride", NULL, __eolian_efl_gfx_buffer_stride_get_reflect},
   };
   static const Efl_Object_Property_Reflection_Ops rops = {
      refl_table, EINA_C_ARRAY_LENGTH(refl_table)
   };
   ropsp = &rops;

   return efl_class_functions_set(klass, opsp, ropsp);
}

static const Efl_Class_Description _efl_gfx_buffer_class_desc = {
   EO_VERSION,
   "Efl.Gfx.Buffer",
   EFL_CLASS_TYPE_INTERFACE,
   0,
   _efl_gfx_buffer_class_initializer,
   NULL,
   NULL
};

EFL_DEFINE_CLASS(efl_gfx_buffer_interface_get, &_efl_gfx_buffer_class_desc, NULL, NULL);
