summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--src/Makefile.am6
-rw-r--r--src/Makefile_Evas.am11
-rw-r--r--src/lib/evas/Evas_Eo.h4
-rw-r--r--src/lib/evas/canvas/evas_line.eo29
-rw-r--r--src/lib/evas/canvas/evas_object_line.c98
6 files changed, 70 insertions, 81 deletions
diff --git a/.gitignore b/.gitignore
index 1f5d422f85..5589fb4262 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,9 @@ tags
28*.gcno 28*.gcno
29*.gcda 29*.gcda
30*.dirstamp 30*.dirstamp
31*.eo.c
32*.eo.h
33*.eo.legacy.h
31/efl-*-doc.tar.bz2 34/efl-*-doc.tar.bz2
32/ar-lib 35/ar-lib
33/stamp-h1 36/stamp-h1
diff --git a/src/Makefile.am b/src/Makefile.am
index eb158223b0..07d007aeea 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,10 @@ AUTOMAKE_OPTIONS = subdir-objects
3MAINTAINERCLEANFILES = Makefile.in 3MAINTAINERCLEANFILES = Makefile.in
4CLEANFILES = 4CLEANFILES =
5BUILT_SOURCES = 5BUILT_SOURCES =
6EOLIAN_FLAGS = 6
7EOLIAN_FLAGS = \
8 -I$(srcdir)/lib/eo \
9 -I$(srcdir)/lib/evas
7 10
8DIST_SUBDIRS = 11DIST_SUBDIRS =
9SUBDIRS = 12SUBDIRS =
@@ -16,6 +19,7 @@ check_PROGRAMS =
16TESTS = 19TESTS =
17EXTRA_DIST = 20EXTRA_DIST =
18 21
22
19EFL_INSTALL_EXEC_HOOK= 23EFL_INSTALL_EXEC_HOOK=
20 24
21include Makefile_Efl.am 25include Makefile_Efl.am
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 9c136a3327..adebb2c97a 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -1,6 +1,13 @@
1 1
2### Library 2### Library
3 3
4BUILT_SOURCES += \
5 lib/evas/canvas/evas_line.eo.c \
6 lib/evas/canvas/evas_line.eo.h
7
8EXTRA_DIST += \
9 lib/evas/canvas/evas_line.eo
10
4lib_LTLIBRARIES += lib/evas/libevas.la 11lib_LTLIBRARIES += lib/evas/libevas.la
5noinst_LTLIBRARIES = 12noinst_LTLIBRARIES =
6 13
@@ -11,7 +18,8 @@ lib/evas/Evas_Common.h \
11lib/evas/Evas_Eo.h \ 18lib/evas/Evas_Eo.h \
12lib/evas/Evas_Legacy.h \ 19lib/evas/Evas_Legacy.h \
13lib/evas/Evas_GL.h \ 20lib/evas/Evas_GL.h \
14lib/evas/Evas_Loader.h 21lib/evas/Evas_Loader.h \
22lib/evas/canvas/evas_line.eo.h
15 23
16noinst_HEADERS = \ 24noinst_HEADERS = \
17lib/evas/include/evas_inline.x \ 25lib/evas/include/evas_inline.x \
@@ -204,6 +212,7 @@ lib/evas/common/evas_font_ot.h
204 212
205lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 213lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
206-I$(top_srcdir)/src/lib/evas/common \ 214-I$(top_srcdir)/src/lib/evas/common \
215-I$(top_builddir)/src/lib/evas/canvas \
207-I$(top_srcdir)/src/lib/evas/cserve2 \ 216-I$(top_srcdir)/src/lib/evas/cserve2 \
208-I$(top_srcdir)/src/lib/evas/file \ 217-I$(top_srcdir)/src/lib/evas/file \
209-I$(top_srcdir)/src/lib/evas/include \ 218-I$(top_srcdir)/src/lib/evas/include \
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 6e3166eed2..c685ea525b 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -2917,6 +2917,9 @@ enum
2917 * 2917 *
2918 * @{ 2918 * @{
2919 */ 2919 */
2920#include "evas_line.eo.h"
2921
2922#if 0
2920#define EVAS_OBJ_LINE_CLASS evas_object_line_class_get() 2923#define EVAS_OBJ_LINE_CLASS evas_object_line_class_get()
2921const Eo_Class *evas_object_line_class_get(void) EINA_CONST; 2924const Eo_Class *evas_object_line_class_get(void) EINA_CONST;
2922 2925
@@ -2961,6 +2964,7 @@ enum
2961 * @see evas_object_line_xy_get 2964 * @see evas_object_line_xy_get
2962 */ 2965 */
2963#define evas_obj_line_xy_get(x1, y1, x2, y2) EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_GET), EO_TYPECHECK(Evas_Coord *, x1), EO_TYPECHECK(Evas_Coord *, y1), EO_TYPECHECK(Evas_Coord *, x2), EO_TYPECHECK(Evas_Coord *, y2) 2966#define evas_obj_line_xy_get(x1, y1, x2, y2) EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_GET), EO_TYPECHECK(Evas_Coord *, x1), EO_TYPECHECK(Evas_Coord *, y1), EO_TYPECHECK(Evas_Coord *, x2), EO_TYPECHECK(Evas_Coord *, y2)
2967#endif
2964 2968
2965/** 2969/**
2966 * @} 2970 * @}
diff --git a/src/lib/evas/canvas/evas_line.eo b/src/lib/evas/canvas/evas_line.eo
new file mode 100644
index 0000000000..fd53f4f374
--- /dev/null
+++ b/src/lib/evas/canvas/evas_line.eo
@@ -0,0 +1,29 @@
1class Evas_Line (Evas_Object)
2{
3 legacy_prefix: evas_object_line;
4 properties {
5 xy {
6 set {
7 /*@
8 @since 1.8
9
10 Sets the coordinates of the end points of the given evas line object. */
11 }
12 get {
13 /*@
14 Retrieves the coordinates of the end points of the given evas line object.
15 second end point. */
16 }
17 values {
18 Evas_Coord x1; /*@ The X coordinate of the first point. */
19 Evas_Coord y1; /*@ The Y coordinate of the first point. */
20 Evas_Coord x2; /*@ The X coordinate of the second point. */
21 Evas_Coord y2; /*@ The Y coordinate of the second point. */
22 }
23 }
24 }
25 implements {
26 Eo_Base::constructor;
27 }
28
29}
diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c
index f5dae37c78..55dd025f63 100644
--- a/src/lib/evas/canvas/evas_object_line.c
+++ b/src/lib/evas/canvas/evas_object_line.c
@@ -3,17 +3,15 @@
3 3
4#include "Eo.h" 4#include "Eo.h"
5 5
6EAPI Eo_Op EVAS_OBJ_LINE_BASE_ID = EO_NOOP;
7
8#define MY_CLASS EVAS_OBJ_LINE_CLASS 6#define MY_CLASS EVAS_OBJ_LINE_CLASS
9 7
10/* private magic number for line objects */ 8/* private magic number for line objects */
11static const char o_type[] = "line"; 9static const char o_type[] = "line";
12 10
13/* private struct for line object internal data */ 11/* private struct for line object internal data */
14typedef struct _Evas_Object_Line Evas_Object_Line; 12typedef struct _Evas_Line_Data Evas_Line_Data;
15 13
16struct _Evas_Object_Line 14struct _Evas_Line_Data
17{ 15{
18 struct { 16 struct {
19 struct { 17 struct {
@@ -105,21 +103,11 @@ evas_object_line_add(Evas *e)
105 return eo_obj; 103 return eo_obj;
106} 104}
107 105
108EAPI void 106EOLIAN static void
109evas_object_line_xy_set(Evas_Object *eo_obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2) 107_evas_line_xy_set(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2)
110{
111 eo_do(eo_obj, evas_obj_line_xy_set(x1, y1, x2, y2));
112}
113
114static void
115_line_xy_set(Eo *eo_obj, void *_pd, va_list *list)
116{ 108{
117 Evas_Coord x1 = va_arg(*list, Evas_Coord);
118 Evas_Coord y1 = va_arg(*list, Evas_Coord);
119 Evas_Coord x2 = va_arg(*list, Evas_Coord);
120 Evas_Coord y2 = va_arg(*list, Evas_Coord);
121 109
122 Evas_Object_Line *o = _pd; 110 Evas_Line_Data *o = _pd;
123 Evas_Coord min_x, max_x, min_y, max_y; 111 Evas_Coord min_x, max_x, min_y, max_y;
124 int is, was = 0; 112 int is, was = 0;
125 113
@@ -204,28 +192,11 @@ _line_xy_set(Eo *eo_obj, void *_pd, va_list *list)
204 evas_object_inform_call_resize(eo_obj); 192 evas_object_inform_call_resize(eo_obj);
205} 193}
206 194
207EAPI void 195EOLIAN static void
208evas_object_line_xy_get(const Evas_Object *eo_obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2) 196_evas_line_xy_get(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2)
209{
210 MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
211 if (x1) *x1 = 0;
212 if (y1) *y1 = 0;
213 if (x2) *x2 = 0;
214 if (y2) *y2 = 0;
215 return;
216 MAGIC_CHECK_END();
217 eo_do((Eo *)eo_obj, evas_obj_line_xy_get(x1, y1, x2, y2));
218}
219
220static void
221_line_xy_get(Eo *eo_obj, void *_pd, va_list *list)
222{ 197{
223 const Evas_Object_Line *o = _pd; 198 const Evas_Line_Data *o = _pd;
224 199
225 Evas_Coord *x1 = va_arg(*list, Evas_Coord *);
226 Evas_Coord *y1 = va_arg(*list, Evas_Coord *);
227 Evas_Coord *x2 = va_arg(*list, Evas_Coord *);
228 Evas_Coord *y2 = va_arg(*list, Evas_Coord *);
229 200
230 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); 201 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
231 if (x1) *x1 = obj->cur->geometry.x + o->cur.x1; 202 if (x1) *x1 = obj->cur->geometry.x + o->cur.x1;
@@ -245,11 +216,11 @@ evas_object_line_init(Evas_Object *eo_obj)
245 obj->type = o_type; 216 obj->type = o_type;
246} 217}
247 218
248static void 219EOLIAN static void
249_constructor(Eo *eo_obj, void *class_data, va_list *list EINA_UNUSED) 220_evas_line_constructor(Eo *eo_obj, Evas_Line_Data *class_data EINA_UNUSED)
250{ 221{
251 Evas_Object_Protected_Data *obj; 222 Evas_Object_Protected_Data *obj;
252 Evas_Object_Line *o; 223 Evas_Line_Data *o;
253 Eo *parent; 224 Eo *parent;
254 225
255 eo_do_super(eo_obj, MY_CLASS, eo_constructor()); 226 eo_do_super(eo_obj, MY_CLASS, eo_constructor());
@@ -274,7 +245,7 @@ evas_object_line_render(Evas_Object *eo_obj EINA_UNUSED,
274 void *type_private_data, 245 void *type_private_data,
275 void *output, void *context, void *surface, int x, int y, Eina_Bool do_async) 246 void *output, void *context, void *surface, int x, int y, Eina_Bool do_async)
276{ 247{
277 Evas_Object_Line *o = type_private_data; 248 Evas_Line_Data *o = type_private_data;
278 249
279 /* render object to surface with context, and offxet by x,y */ 250 /* render object to surface with context, and offxet by x,y */
280 251
@@ -305,7 +276,7 @@ evas_object_line_render_pre(Evas_Object *eo_obj,
305 Evas_Object_Protected_Data *obj, 276 Evas_Object_Protected_Data *obj,
306 void *type_private_data) 277 void *type_private_data)
307{ 278{
308 Evas_Object_Line *o = type_private_data; 279 Evas_Line_Data *o = type_private_data;
309 int is_v, was_v; 280 int is_v, was_v;
310 Eina_Bool changed_color = EINA_FALSE; 281 Eina_Bool changed_color = EINA_FALSE;
311 282
@@ -393,7 +364,7 @@ evas_object_line_render_post(Evas_Object *eo_obj,
393 Evas_Object_Protected_Data *obj EINA_UNUSED, 364 Evas_Object_Protected_Data *obj EINA_UNUSED,
394 void *type_private_data) 365 void *type_private_data)
395{ 366{
396 Evas_Object_Line *o = type_private_data; 367 Evas_Line_Data *o = type_private_data;
397 368
398 /* this moves the current data to the previous state parts of the object */ 369 /* this moves the current data to the previous state parts of the object */
399 /* in whatever way is safest for the object. also if we don't need object */ 370 /* in whatever way is safest for the object. also if we don't need object */
@@ -407,21 +378,21 @@ evas_object_line_render_post(Evas_Object *eo_obj,
407 378
408static unsigned int evas_object_line_id_get(Evas_Object *eo_obj) 379static unsigned int evas_object_line_id_get(Evas_Object *eo_obj)
409{ 380{
410 Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS); 381 Evas_Line_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
411 if (!o) return 0; 382 if (!o) return 0;
412 return MAGIC_OBJ_LINE; 383 return MAGIC_OBJ_LINE;
413} 384}
414 385
415static unsigned int evas_object_line_visual_id_get(Evas_Object *eo_obj) 386static unsigned int evas_object_line_visual_id_get(Evas_Object *eo_obj)
416{ 387{
417 Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS); 388 Evas_Line_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
418 if (!o) return 0; 389 if (!o) return 0;
419 return MAGIC_OBJ_SHAPE; 390 return MAGIC_OBJ_SHAPE;
420} 391}
421 392
422static void *evas_object_line_engine_data_get(Evas_Object *eo_obj) 393static void *evas_object_line_engine_data_get(Evas_Object *eo_obj)
423{ 394{
424 Evas_Object_Line *o = eo_data_scope_get(eo_obj, MY_CLASS); 395 Evas_Line_Data *o = eo_data_scope_get(eo_obj, MY_CLASS);
425 return o->engine_data; 396 return o->engine_data;
426} 397}
427 398
@@ -474,7 +445,7 @@ evas_object_line_coords_recalc(Evas_Object *eo_obj EINA_UNUSED,
474 Evas_Object_Protected_Data *obj, 445 Evas_Object_Protected_Data *obj,
475 void *type_private_data) 446 void *type_private_data)
476{ 447{
477 Evas_Object_Line *o = type_private_data; 448 Evas_Line_Data *o = type_private_data;
478 449
479 o->cur.cache.x1 = obj->cur->geometry.x + o->cur.x1; 450 o->cur.cache.x1 = obj->cur->geometry.x + o->cur.x1;
480 o->cur.cache.y1 = obj->cur->geometry.y + o->cur.y1; 451 o->cur.cache.y1 = obj->cur->geometry.y + o->cur.y1;
@@ -484,35 +455,4 @@ evas_object_line_coords_recalc(Evas_Object *eo_obj EINA_UNUSED,
484 o->cur.cache.object.h = obj->cur->geometry.h; 455 o->cur.cache.object.h = obj->cur->geometry.h;
485} 456}
486 457
487static void 458#include "evas_line.eo.c" \ No newline at end of file
488_class_constructor(Eo_Class *klass)
489{
490 const Eo_Op_Func_Description func_desc[] = {
491 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
492 EO_OP_FUNC(EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_SET), _line_xy_set),
493 EO_OP_FUNC(EVAS_OBJ_LINE_ID(EVAS_OBJ_LINE_SUB_ID_XY_GET), _line_xy_get),
494 EO_OP_FUNC_SENTINEL
495 };
496
497 eo_class_funcs_set(klass, func_desc);
498}
499
500static const Eo_Op_Description op_desc[] = {
501 EO_OP_DESCRIPTION(EVAS_OBJ_LINE_SUB_ID_XY_SET, "Sets the coordinates of the end points of the given evas line object."),
502 EO_OP_DESCRIPTION(EVAS_OBJ_LINE_SUB_ID_XY_GET, "Retrieves the coordinates of the end points of the given evas line object."),
503 EO_OP_DESCRIPTION_SENTINEL
504};
505
506static const Eo_Class_Description class_desc = {
507 EO_VERSION,
508 "Evas_Line",
509 EO_CLASS_TYPE_REGULAR,
510 EO_CLASS_DESCRIPTION_OPS(&EVAS_OBJ_LINE_BASE_ID, op_desc, EVAS_OBJ_LINE_SUB_ID_LAST),
511 NULL,
512 sizeof(Evas_Object_Line),
513 _class_constructor,
514 NULL
515};
516
517EO_DEFINE_CLASS(evas_object_line_class_get, &class_desc, EVAS_OBJ_CLASS, NULL);
518