summaryrefslogtreecommitdiff
path: root/src/lib/ector/software
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-05-19 11:41:27 +0100
committerTom Hacohen <tom@stosb.com>2015-05-20 13:03:24 +0100
commit6efbfe227aaaa24eda7bcb7df916d4daf0a74400 (patch)
treec96e166b7348c5e825aca2d4af084675172e0cec /src/lib/ector/software
parente7ed0bfcedcea87f8645107a8a0775f67227d7c1 (diff)
Eo: Add a return value to eo_constructor().
From now on, constructors should return a value, usually the object being worked on, or NULL (if the constructor failed). This can also be used for implementing singletons, by just always returning the same object from the constructor. This is one of the final steps towards stabilizing Eo. @feature
Diffstat (limited to 'src/lib/ector/software')
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_linear.c6
-rw-r--r--src/lib/ector/software/ector_renderer_software_gradient_radial.c6
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.c6
-rw-r--r--src/lib/ector/software/ector_software_surface.c6
4 files changed, 16 insertions, 8 deletions
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_linear.c b/src/lib/ector/software/ector_renderer_software_gradient_linear.c
index a6e32b008b..f2ca832cdc 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_linear.c
+++ b/src/lib/ector/software/ector_renderer_software_gradient_linear.c
@@ -71,13 +71,15 @@ _ector_renderer_software_gradient_linear_ector_renderer_software_base_fill(Eo *o
71 return EINA_TRUE; 71 return EINA_TRUE;
72} 72}
73 73
74void 74Eo *
75_ector_renderer_software_gradient_linear_eo_base_constructor(Eo *obj, 75_ector_renderer_software_gradient_linear_eo_base_constructor(Eo *obj,
76 Ector_Renderer_Software_Gradient_Data *pd) 76 Ector_Renderer_Software_Gradient_Data *pd)
77{ 77{
78 eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, eo_constructor()); 78 obj = eo_do_super_ret(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, obj, eo_constructor());
79 pd->gd = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN, obj); 79 pd->gd = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN, obj);
80 pd->gld = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN, obj); 80 pd->gld = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_LINEAR_MIXIN, obj);
81
82 return obj;
81} 83}
82 84
83void 85void
diff --git a/src/lib/ector/software/ector_renderer_software_gradient_radial.c b/src/lib/ector/software/ector_renderer_software_gradient_radial.c
index a05b4874f4..5b63f957be 100644
--- a/src/lib/ector/software/ector_renderer_software_gradient_radial.c
+++ b/src/lib/ector/software/ector_renderer_software_gradient_radial.c
@@ -79,13 +79,15 @@ _ector_renderer_software_gradient_radial_ector_renderer_software_base_fill(Eo *o
79 return EINA_TRUE; 79 return EINA_TRUE;
80} 80}
81 81
82void 82Eo *
83_ector_renderer_software_gradient_radial_eo_base_constructor(Eo *obj, 83_ector_renderer_software_gradient_radial_eo_base_constructor(Eo *obj,
84 Ector_Renderer_Software_Gradient_Data *pd) 84 Ector_Renderer_Software_Gradient_Data *pd)
85{ 85{
86 eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, eo_constructor()); 86 obj = eo_do_super_ret(obj, ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, obj, eo_constructor());
87 pd->gd = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN, obj); 87 pd->gd = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_MIXIN, obj);
88 pd->gld = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN, obj); 88 pd->gld = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN, obj);
89
90 return obj;
89} 91}
90 92
91void 93void
diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c
index 2e4fbea5aa..a91b80eb3b 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.c
+++ b/src/lib/ector/software/ector_renderer_software_shape.c
@@ -362,14 +362,16 @@ _ector_renderer_software_shape_path_changed(void *data, Eo *obj EINA_UNUSED, con
362 return EINA_TRUE; 362 return EINA_TRUE;
363} 363}
364 364
365void 365Eo *
366_ector_renderer_software_shape_eo_base_constructor(Eo *obj, Ector_Renderer_Software_Shape_Data *pd) 366_ector_renderer_software_shape_eo_base_constructor(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
367{ 367{
368 eo_do_super(obj, ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, eo_constructor()); 368 obj = eo_do_super_ret(obj, ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, obj, eo_constructor());
369 pd->shape = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_SHAPE_MIXIN, obj); 369 pd->shape = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_SHAPE_MIXIN, obj);
370 pd->base = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, obj); 370 pd->base = eo_data_xref(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, obj);
371 eo_do(obj, 371 eo_do(obj,
372 eo_event_callback_add(EFL_GFX_PATH_CHANGED, _ector_renderer_software_shape_path_changed, pd)); 372 eo_event_callback_add(EFL_GFX_PATH_CHANGED, _ector_renderer_software_shape_path_changed, pd));
373
374 return obj;
373} 375}
374 376
375void 377void
diff --git a/src/lib/ector/software/ector_software_surface.c b/src/lib/ector/software/ector_software_surface.c
index 02d93c39df..a5583028e6 100644
--- a/src/lib/ector/software/ector_software_surface.c
+++ b/src/lib/ector/software/ector_software_surface.c
@@ -65,17 +65,19 @@ _ector_software_surface_surface_get(Eo *obj EINA_UNUSED,
65 *height = pd->software->fill_data.raster_buffer.height; 65 *height = pd->software->fill_data.raster_buffer.height;
66} 66}
67 67
68static void 68static Eo *
69_ector_software_surface_eo_base_constructor(Eo *obj, 69_ector_software_surface_eo_base_constructor(Eo *obj,
70 Ector_Software_Surface_Data *pd EINA_UNUSED) 70 Ector_Software_Surface_Data *pd EINA_UNUSED)
71{ 71{
72 eo_do_super(obj, ECTOR_SOFTWARE_SURFACE_CLASS, eo_constructor()); 72 obj = eo_do_super_ret(obj, ECTOR_SOFTWARE_SURFACE_CLASS, obj, eo_constructor());
73 if(_software_count == 0) 73 if(_software_count == 0)
74 { 74 {
75 pd->software = (Software_Rasterizer *) calloc(1, sizeof(Software_Rasterizer)); 75 pd->software = (Software_Rasterizer *) calloc(1, sizeof(Software_Rasterizer));
76 ector_software_rasterizer_init(pd->software); 76 ector_software_rasterizer_init(pd->software);
77 } 77 }
78 _software_count++; 78 _software_count++;
79
80 return obj;
79} 81}
80 82
81static void 83static void