summaryrefslogtreecommitdiff
path: root/src/lib/evas/include/evas_private.h
blob: c1f938829aec3ca1cfcf52125926e39a18a3e774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
#ifndef EVAS_PRIVATE_H
#define EVAS_PRIVATE_H

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#ifndef EFL_CANVAS_OBJECT_PROTECTED
# define EFL_CANVAS_OBJECT_PROTECTED
#endif

#include "Evas.h"
#include "Eet.h"

#include "../file/evas_module.h"
#include "../file/evas_path.h"
#include "../common/evas_text_utils.h"
#include "../common/language/evas_bidi_utils.h"
#include "../common/language/evas_language_utils.h"

#include "evas_3d_utils.h"

#ifdef EAPI
# undef EAPI
#endif

#ifdef _WIN32
# ifdef EFL_EVAS_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif /* ! DLL_EXPORT */
# else
#  define EAPI __declspec(dllimport)
# endif /* ! EFL_EVAS_BUILD */
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif /* ! _WIN32 */

#include "canvas/evas_text.eo.h"
#include "canvas/evas_textgrid.eo.h"
#include "canvas/evas_line.eo.h"
#include "canvas/evas_box.eo.h"
#include "canvas/evas_table.eo.h"
#include "canvas/evas_grid.eo.h"

#define RENDER_METHOD_INVALID            0x00000000

typedef struct _Evas_Layer                  Evas_Layer;
typedef struct _Evas_Size                   Evas_Size;
typedef struct _Evas_Aspect                 Evas_Aspect;
typedef struct _Evas_Border                 Evas_Border;
typedef struct _Evas_Double_Pair            Evas_Double_Pair;
typedef struct _Evas_Size_Hints             Evas_Size_Hints;
typedef struct _Evas_Font_Dir               Evas_Font_Dir;
typedef struct _Evas_Font                   Evas_Font;
typedef struct _Evas_Font_Alias             Evas_Font_Alias;
typedef struct _Evas_Font_Description       Evas_Font_Description;
typedef struct _Evas_Data_Node              Evas_Data_Node;
typedef struct _Evas_Func                   Evas_Func;
typedef struct _Evas_Image_Save_Func        Evas_Image_Save_Func;
typedef struct _Evas_Vg_Load_Func           Evas_Vg_Load_Func;
typedef struct _Evas_Vg_Save_Func           Evas_Vg_Save_Func;
typedef struct _Evas_Object_Func            Evas_Object_Func;
typedef struct _Evas_Intercept_Func         Evas_Intercept_Func;
typedef struct _Evas_Key_Grab               Evas_Key_Grab;
typedef struct _Evas_Format                 Evas_Format;
typedef struct _Evas_Map_Point              Evas_Map_Point;
typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
typedef struct _Evas_Smart_Interfaces_Array Evas_Smart_Interfaces_Array;
typedef struct _Evas_Post_Callback          Evas_Post_Callback;
typedef struct _Evas_Coord_Touch_Point      Evas_Coord_Touch_Point;
typedef struct _Evas_Object_Proxy_Data      Evas_Object_Proxy_Data;
typedef struct _Evas_Object_Map_Data        Evas_Object_Map_Data;
typedef struct _Evas_Proxy_Render_Data      Evas_Proxy_Render_Data;
typedef struct _Evas_Object_3D_Data         Evas_Object_3D_Data;
typedef struct _Evas_Object_Mask_Data       Evas_Object_Mask_Data;
typedef struct _Evas_Object_Pointer_Data            Evas_Object_Pointer_Data;

typedef struct _Evas_Smart_Data             Evas_Smart_Data;

typedef struct _Evas_Object_Protected_State Evas_Object_Protected_State;
typedef struct _Evas_Object_Protected_Data  Evas_Object_Protected_Data;

typedef struct _Evas_Filter_Program         Evas_Filter_Program;
typedef struct _Evas_Object_Filter_Data     Evas_Object_Filter_Data;
typedef struct _Evas_Filter_Data_Binding    Evas_Filter_Data_Binding;
typedef struct _Evas_Pointer_Data           Evas_Pointer_Data;

// 3D stuff

#define EVAS_CANVAS3D_VERTEX_ATTRIB_COUNT    5
#define EVAS_CANVAS3D_MATERIAL_ATTRIB_COUNT  5

typedef struct _Evas_Canvas3D_Object                Evas_Canvas3D_Object_Data;
typedef struct _Evas_Canvas3D_Scene_Public_Data     Evas_Canvas3D_Scene_Public_Data;
typedef struct _Evas_Canvas3D_Vertex_Buffer         Evas_Canvas3D_Vertex_Buffer;
typedef struct _Evas_Canvas3D_Mesh_Frame            Evas_Canvas3D_Mesh_Frame;
typedef struct _Evas_Canvas3D_Node_Mesh             Evas_Canvas3D_Node_Mesh;
typedef struct _Evas_Canvas3D_Object_Func           Evas_Canvas3D_Object_Func;
typedef struct _Evas_Canvas3D_Pick_Data             Evas_Canvas3D_Pick_Data;
typedef struct _Evas_Canvas3D_Interpolate_Vertex_Buffer Evas_Canvas3D_Interpolate_Vertex_Buffer;

typedef struct _Evas_Canvas3D_Scene            Evas_Canvas3D_Scene_Data;
typedef struct _Evas_Canvas3D_Node             Evas_Canvas3D_Node_Data;
typedef struct _Evas_Canvas3D_Mesh             Evas_Canvas3D_Mesh_Data;
typedef struct _Evas_Canvas3D_Camera           Evas_Canvas3D_Camera_Data;
typedef struct _Evas_Canvas3D_Light            Evas_Canvas3D_Light_Data;
typedef struct _Evas_Canvas3D_Material         Evas_Canvas3D_Material_Data;
typedef struct _Evas_Canvas3D_Texture          Evas_Canvas3D_Texture_Data;
typedef struct _Evas_Canvas3D_Primitive        Evas_Canvas3D_Primitive_Data;

/* Structs for mesh eet saver/loader */
typedef struct _Evas_Canvas3D_Vec2_Eet         Evas_Canvas3D_Vec2_Eet;
typedef struct _Evas_Canvas3D_Vec3_Eet         Evas_Canvas3D_Vec3_Eet;
typedef struct _Evas_Canvas3D_Vertex_Eet       Evas_Canvas3D_Vertex_Eet;
typedef struct _Evas_Canvas3D_Geometry_Eet     Evas_Canvas3D_Geometry_Eet;
typedef struct _Evas_Canvas3D_Color_Eet        Evas_Canvas3D_Color_Eet;
typedef struct _Evas_Canvas3D_Material_Eet     Evas_Canvas3D_Material_Eet;
typedef struct _Evas_Canvas3D_Frame_Eet        Evas_Canvas3D_Frame_Eet;
typedef struct _Evas_Canvas3D_Mesh_Eet         Evas_Canvas3D_Mesh_Eet;
typedef struct _Evas_Canvas3D_Header_Eet       Evas_Canvas3D_Header_Eet;
typedef struct _Evas_Canvas3D_File_Eet         Evas_Canvas3D_File_Eet;

struct _Evas_Canvas3D_Vec2_Eet
{
   float x;
   float y;
};

struct _Evas_Canvas3D_Vec3_Eet
{
   float x;
   float y;
   float z;
};

struct _Evas_Canvas3D_Vertex_Eet
{
   Evas_Canvas3D_Vec3_Eet position;
   Evas_Canvas3D_Vec3_Eet normal;
   Evas_Canvas3D_Vec2_Eet texcoord;
};//one point of mesh

struct _Evas_Canvas3D_Geometry_Eet
{
   unsigned int id;
   int vertices_count;
   Evas_Canvas3D_Vertex_Eet *vertices;
};//contain array of vertices and id for using in Evas_Canvas3D_Frame_Eet in future

struct _Evas_Canvas3D_Color_Eet
{
   float r;
   float g;
   float b;
   float a;
};

struct _Evas_Canvas3D_Material_Eet
{
   int id;
   float shininess;
   int colors_count;
   Evas_Canvas3D_Color_Eet *colors;//Color per attribute (ambient, diffuse, specular etc.)
};

struct _Evas_Canvas3D_Frame_Eet
{
   int id;
   int geometry_id;
   int material_id;
};//only ids to prevent of spending of memory when animation will change only geometry or only material

struct _Evas_Canvas3D_Mesh_Eet
{
   int materials_count;
   int frames_count;
   int geometries_count;
   Evas_Canvas3D_Material_Eet *materials;
   Evas_Canvas3D_Frame_Eet *frames;
   Evas_Canvas3D_Geometry_Eet *geometries;
};//contain materials, geometries and bounding between it (frames)

struct _Evas_Canvas3D_Header_Eet
{
   int version;
   int *materials;//colors_count
   int materials_count;
   int *geometries;//vertices_count
   int geometries_count;
   int frames;
};//can be use for fast allocating of memory

struct _Evas_Canvas3D_File_Eet
{
   Evas_Canvas3D_Mesh_Eet *mesh;
   Evas_Canvas3D_Header_Eet *header;
};//contain mesh data and information about mesh size

typedef Eina_Bool (*Evas_Canvas3D_Node_Func)(Evas_Canvas3D_Node *, void *data);


typedef enum _Evas_Canvas3D_Node_Traverse_Type
{
   EVAS_CANVAS3D_NODE_TRAVERSE_DOWNWARD,
   EVAS_CANVAS3D_NODE_TRAVERSE_UPWARD,
} Evas_Canvas3D_Node_Traverse_Type;

typedef enum _Evas_Canvas3D_Tree_Traverse_Type
{
   EVAS_CANVAS3D_TREE_TRAVERSE_PRE_ORDER,
   EVAS_CANVAS3D_TREE_TRAVERSE_ANY_ORDER = EVAS_CANVAS3D_TREE_TRAVERSE_PRE_ORDER,
   EVAS_CANVAS3D_TREE_TRAVERSE_POST_ORDER,
   EVAS_CANVAS3D_TREE_TRAVERSE_LEVEL_ORDER,
} Evas_Canvas3D_Tree_Traverse_Type;


struct _Evas_Canvas3D_Object
{
   Evas                *evas;
   Evas_Canvas3D_Object_Type  type;

   Eina_Bool            dirty[EVAS_CANVAS3D_STATE_MAX];
};

struct _Evas_Canvas3D_Scene
{
   Evas_Canvas3D_Node     *root_node;
   Evas_Canvas3D_Node     *camera_node;
   Evas_Color       bg_color;
   Eina_Bool        shadows_enabled :1;
   Eina_Bool        color_pick_enabled :1;

   void             *surface;
   int               w, h;
   Eina_List        *images;

   Eina_Hash        *node_mesh_colors;
   Eina_Hash        *colors_node_mesh;
   /*sets constant for shadow rendering*/
   Evas_Real depth_offset;
   Evas_Real depth_constant;
};

struct _Evas_Canvas3D_Node_Mesh
{
   Evas_Canvas3D_Node           *node;
   Evas_Canvas3D_Mesh           *mesh;
   int                     frame;
};

struct _Evas_Canvas3D_Node
{
   Eina_List        *members;
   Evas_Canvas3D_Node     *parent;
   Evas_Canvas3D_Node     *billboard_target;

   Eina_Vector3         position;
   Eina_Quaternion         orientation;
   Eina_Vector3         scale;

   Eina_Vector3         position_world;
   Eina_Quaternion   orientation_world;
   Eina_Vector3         scale_world;

   Evas_Box3         aabb;
   Evas_Box3         obb;
   Evas_Sphere       bsphere;

   Evas_Canvas3D_Node_Type type;

   /* Camera node. */
   union {
        struct {
             Evas_Canvas3D_Camera  *camera;
             Eina_Matrix4        matrix_world_to_eye;
        } camera;

        struct {
             Evas_Canvas3D_Light   *light;
             Eina_Matrix4        matrix_local_to_world;
        } light;

        struct {
             Eina_List       *meshes;
             Eina_Hash       *node_meshes;
             Eina_Matrix4        matrix_local_to_world;
        } mesh;
   } data;

   /* Scene using this node as root. */
   Eina_Hash        *scenes_root;

   /* Scene using this node as camera. */
   Eina_Hash        *scenes_camera;

   Eina_Bool         position_inherit : 1;
   Eina_Bool         orientation_inherit : 1;
   Eina_Bool         scale_inherit : 1;
   Eina_Bool         lod : 1;
};

struct _Evas_Canvas3D_Camera
{
   Eina_Matrix4      projection;
   Eina_Hash     *nodes;
};

struct _Evas_Canvas3D_Light
{
   Evas_Color     ambient;
   Evas_Color     diffuse;
   Evas_Color     specular;

   Eina_Bool      directional;
   Evas_Real      spot_exp;
   Evas_Real      spot_cutoff;
   Evas_Real      spot_cutoff_cos;

   Eina_Bool      enable_attenuation;
   Evas_Real      atten_const;
   Evas_Real      atten_linear;
   Evas_Real      atten_quad;
   Eina_Matrix4      projection;

   Eina_Hash     *nodes;
};

struct _Evas_Canvas3D_Vertex_Buffer
{
   int         element_count;
   int         stride;
   void       *data;
   int         size;
   Eina_Bool   owns_data;
   Eina_Bool   mapped;
};

struct _Evas_Canvas3D_Interpolate_Vertex_Buffer
{
   void       *data0;
   int         stride0;
   int         size0;

   void       *data1;
   int         stride1;
   int         size1;

   Evas_Real   weight;
};

struct _Evas_Canvas3D_Mesh_Frame
{
   Evas_Canvas3D_Mesh           *mesh;

   int                     frame;
   Evas_Canvas3D_Material       *material;
   Evas_Box3               aabb;

   Evas_Canvas3D_Vertex_Buffer   vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COUNT];
};

struct _Evas_Canvas3D_Mesh
{
   Evas_Canvas3D_Shader_Mode      shader_mode;

   int                     vertex_count;
   int                     frame_count;
   Eina_List              *frames;

   Evas_Canvas3D_Index_Format    index_format;
   int                     index_count;
   void                   *indices;
   int                     index_size;
   Eina_Bool               owns_indices;
   Eina_Bool               index_mapped;

   Evas_Canvas3D_Vertex_Assembly assembly;

   Eina_Hash               *nodes;
   Eina_Bool               shadowed;

   Eina_Bool               blending :1;
   Evas_Canvas3D_Blend_Func      blend_sfactor;
   Evas_Canvas3D_Blend_Func      blend_dfactor;

   Evas_Canvas3D_Comparison      alpha_comparison;
   Evas_Real               alpha_ref_value;
   Eina_Bool               alpha_test_enabled :1;

   Evas_Color              fog_color;
   Eina_Bool               fog_enabled :1;
   Evas_Color              color_pick_key;
   Eina_Bool               color_pick_enabled :1;
   /*sets of the quality and offsets for shadow rendering*/
   int                     shadows_edges_filtering_level;
   Evas_Real               shadows_edges_size;
   Evas_Real               shadows_constant_bias;
   Evas_Real               near_lod_boundary;
   Evas_Real               far_lod_boundary;
};

struct _Evas_Canvas3D_Texture
{
   /* List of materials using this texture. */
   Eina_Hash        *materials;

   /* Proxy data. */
   Evas_Object      *source;
   Eina_Bool         proxy_rendering;
   void             *proxy_surface;
   /* Engine-side object. */
   void             *engine_data;

   /*Use atlases, @EINA_TRUE by default*/
   Eina_Bool        atlas_enable :1;
};

struct _Evas_Canvas3D_Material
{
   struct {
        Eina_Bool         enable;
        Evas_Color        color;
        Evas_Canvas3D_Texture  *texture;
   } attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_COUNT];

   Evas_Real         shininess;

   Eina_Hash        *meshes;
};

struct _Evas_Canvas3D_Primitive
{
   Evas_Canvas3D_Mesh_Primitive  form;
   Evas_Canvas3D_Primitive_Mode  mode;
   Evas_Real               ratio;
   int                     precision;
   Evas_Canvas3D_Surface_Func   *surface;

   Eina_Vector2 tex_scale;
};

struct _Evas_Canvas3D_Scene_Public_Data
{
   Evas_Color       bg_color;
   Evas_Canvas3D_Node     *camera_node;
   Eina_List        *light_nodes;
   Eina_List        *mesh_nodes;
   Eina_Bool        shadows_enabled :1;
   Eina_Bool        color_pick_enabled :1;
   Eina_Hash        *node_mesh_colors;
   Eina_Hash        *colors_node_mesh;

   /*sets constant for shadow rendering*/
   Evas_Real depth_offset;
   Evas_Real depth_constant;
   Eina_Bool render_to_texture;

   unsigned int     lod_distance;

   Eina_Bool post_processing :1;
   Evas_Canvas3D_Shader_Mode post_processing_type;
};

struct _Evas_Canvas3D_Pick_Data
{
   /* Input */
   Evas_Real         x, y;
   Eina_Matrix4         matrix_vp;
   Evas_Ray3         ray_world;

   /* Output */
   Eina_Bool         picked;
   Evas_Real         z;
   Evas_Canvas3D_Node     *node;
   Evas_Canvas3D_Mesh     *mesh;
   Evas_Real         u, v;
   Evas_Real         s, t;
};

enum _Evas_Font_Style
{
   EVAS_FONT_STYLE_SLANT,
   EVAS_FONT_STYLE_WEIGHT,
   EVAS_FONT_STYLE_WIDTH
};

enum _Evas_Font_Slant
{
   EVAS_FONT_SLANT_NORMAL,
   EVAS_FONT_SLANT_OBLIQUE,
   EVAS_FONT_SLANT_ITALIC
};

enum _Evas_Font_Weight
{
   EVAS_FONT_WEIGHT_NORMAL,
   EVAS_FONT_WEIGHT_THIN,
   EVAS_FONT_WEIGHT_ULTRALIGHT,
   EVAS_FONT_WEIGHT_EXTRALIGHT,
   EVAS_FONT_WEIGHT_LIGHT,
   EVAS_FONT_WEIGHT_BOOK,
   EVAS_FONT_WEIGHT_MEDIUM,
   EVAS_FONT_WEIGHT_SEMIBOLD,
   EVAS_FONT_WEIGHT_BOLD,
   EVAS_FONT_WEIGHT_ULTRABOLD,
   EVAS_FONT_WEIGHT_EXTRABOLD,
   EVAS_FONT_WEIGHT_BLACK,
   EVAS_FONT_WEIGHT_EXTRABLACK
};

enum _Evas_Font_Width
{
   EVAS_FONT_WIDTH_NORMAL,
   EVAS_FONT_WIDTH_ULTRACONDENSED,
   EVAS_FONT_WIDTH_EXTRACONDENSED,
   EVAS_FONT_WIDTH_CONDENSED,
   EVAS_FONT_WIDTH_SEMICONDENSED,
   EVAS_FONT_WIDTH_SEMIEXPANDED,
   EVAS_FONT_WIDTH_EXPANDED,
   EVAS_FONT_WIDTH_EXTRAEXPANDED,
   EVAS_FONT_WIDTH_ULTRAEXPANDED
};

enum _Evas_Font_Spacing
{
   EVAS_FONT_SPACING_PROPORTIONAL,
   EVAS_FONT_SPACING_DUAL,
   EVAS_FONT_SPACING_MONO,
   EVAS_FONT_SPACING_CHARCELL
};

typedef enum _Evas_Font_Style               Evas_Font_Style;
typedef enum _Evas_Font_Slant               Evas_Font_Slant;
typedef enum _Evas_Font_Weight              Evas_Font_Weight;
typedef enum _Evas_Font_Width               Evas_Font_Width;
typedef enum _Evas_Font_Spacing             Evas_Font_Spacing;

/* General types - used for script type chceking */
#define OPAQUE_TYPE(type) struct __##type { int a; }; \
   typedef struct __##type type

OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */
OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */
/* End of general types */

#define MAGIC_EVAS                 0x70777770
#define MAGIC_OBJ                  0x71737723
#define MAGIC_OBJ_RECTANGLE        0x76748772
#define MAGIC_OBJ_LINE             0x7a27f839
#define MAGIC_OBJ_POLYGON          0x7bb7577e
#define MAGIC_OBJ_IMAGE            0x747ad76c
#define MAGIC_OBJ_TEXT             0x77757721
#define MAGIC_OBJ_SMART            0x78c7c73f
#define MAGIC_OBJ_TEXTBLOCK        0x71737744
#define MAGIC_OBJ_TEXTGRID         0x7377a7ca
#define MAGIC_SMART                0x7c6977c5
#define MAGIC_OBJ_SHAPE            0x747297f7
#define MAGIC_OBJ_CONTAINER        0x71877776
#define MAGIC_OBJ_VG               0x77817EE7
#define MAGIC_OBJ_CUSTOM           0x7b7857ab
#define MAGIC_EVAS_GL              0x77976718
#define MAGIC_MAP                  0x7575177d
#define MAGIC_DEV                  0x7d773738

#ifdef EINA_MAGIC_DEBUG
# define MAGIC_CHECK_FAILED(o, t, m) \
{evas_debug_error(); \
 if (!o) evas_debug_input_null(); \
}
# define MAGIC_CHECK(o, t, m) \
{if (EINA_UNLIKELY(!o)) { \
MAGIC_CHECK_FAILED(o, t, m)
# define MAGIC_CHECK_END() }}
#else
# define MAGIC_CHECK_FAILED(o, t, m)
# define MAGIC_CHECK(o, t, m)  { if (!o) {
# define MAGIC_CHECK_END() }}
#endif

// helper function for legacy EAPI implementations
#define EVAS_OBJ_GET_OR_RETURN(o, ...) ({ \
   Evas_Object_Protected_Data *_obj = efl_isa(o, EFL_CANVAS_OBJECT_CLASS) ? \
     efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS) : NULL; \
   if (!_obj) { MAGIC_CHECK_FAILED(o,0,0) return __VA_ARGS__; } \
   _obj; })

#define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);

#define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE
#define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL
#define MERR_BAD() _evas_alloc_error = EVAS_ALLOC_ERROR_RECOVERED

/* DEBUG mode: fail, but normally just ERR(). This also returns if NULL. */
#ifdef DEBUG
#define EVAS_OBJECT_LEGACY_API(_eo, ...) \
   do { Evas_Object_Protected_Data *_o = efl_data_scope_get(_eo, EFL_CANVAS_OBJECT_CLASS); \
      if (EINA_UNLIKELY(!_o)) return __VA_ARGS__; \
      if (EINA_UNLIKELY(!_o->legacy)) { \
         char buf[1024]; snprintf(buf, sizeof(buf), "Calling legacy API on EO object '%s' is not permitted!", efl_class_name_get(_o->object)); \
         EINA_SAFETY_ERROR(buf); \
         return __VA_ARGS__; \
   } } while (0)
#else
#define EVAS_OBJECT_LEGACY_API(_eo, ...) \
   do { Evas_Object_Protected_Data *_o = efl_data_scope_get(_eo, EFL_CANVAS_OBJECT_CLASS); \
      if (EINA_UNLIKELY(!_o)) return __VA_ARGS__; \
      if (EINA_UNLIKELY(!_o->legacy)) { \
         char buf[1024]; snprintf(buf, sizeof(buf), "Calling legacy API on EO object '%s' is not permitted!", efl_class_name_get(_o->object)); \
         EINA_SAFETY_ERROR(buf); \
   } } while (0)
#endif

#define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(cur, prev)                  \
  if (cur->u.file && !cur->mmaped_source)				\
    {                                                                   \
       eina_stringshare_del(cur->u.file);				\
       if (prev->u.file == cur->u.file)					\
         prev->u.file = NULL;						\
       cur->u.file = NULL;						\
    }                                                                   \
  if (cur->key)                                                         \
    {                                                                   \
       eina_stringshare_del(cur->key);                                  \
       if (prev->key == cur->key)                                       \
         prev->key = NULL;                                              \
       cur->key = NULL;                                                 \
    }                                                                   \
  if (prev->u.file && !prev->mmaped_source)				\
    {                                                                   \
       eina_stringshare_del(prev->u.file);				\
       prev->u.file = NULL;						\
    }                                                                   \
  if (prev->key)                                                        \
    {                                                                   \
       eina_stringshare_del(prev->key);                                 \
       prev->key = NULL;                                                \
    }

struct _Evas_Coord_Touch_Point
{
   double x, y;
   int id; // id in order to distinguish each point
   Evas_Touch_Point_State state;
};

struct _Evas_Key_Grab
{
   char               *keyname;
   Evas_Modifier_Mask  modifiers;
   Evas_Modifier_Mask  not_modifiers;
   Evas_Object        *object;
   Eina_Bool           exclusive : 1;
   Eina_Bool           just_added : 1;
   Eina_Bool           delete_me : 1;
   Eina_Bool           is_active : 1;
};

struct _Evas_Intercept_Func
{
   struct {
      Evas_Object_Intercept_Show_Cb func;
      void *data;
      Eina_Bool intercepted;
   } show;
   struct {
      Evas_Object_Intercept_Hide_Cb func;
      void *data;
      Eina_Bool intercepted;
   } hide;
   struct {
      Evas_Object_Intercept_Move_Cb func;
      void *data;
      Eina_Bool intercepted;
   } move;
   struct {
      Evas_Object_Intercept_Resize_Cb func;
      void *data;
      Eina_Bool intercepted;
   } resize;
   struct {
      Evas_Object_Intercept_Raise_Cb func;
      void *data;
      Eina_Bool intercepted;
   } raise;
   struct {
      Evas_Object_Intercept_Lower_Cb func;
      void *data;
      Eina_Bool intercepted;
   } lower;
   struct {
      Evas_Object_Intercept_Stack_Above_Cb func;
      void *data;
      Eina_Bool intercepted;
   } stack_above;
   struct {
      Evas_Object_Intercept_Stack_Below_Cb func;
      void *data;
      Eina_Bool intercepted;
   } stack_below;
   struct {
      Evas_Object_Intercept_Layer_Set_Cb func;
      void *data;
      Eina_Bool intercepted;
   } layer_set;
   struct {
      Evas_Object_Intercept_Color_Set_Cb func;
      void *data;
      Eina_Bool intercepted;
   } color_set;
   struct {
      Evas_Object_Intercept_Clip_Set_Cb func;
      void *data;
      Eina_Bool intercepted;
   } clip_set;
   struct {
      Evas_Object_Intercept_Clip_Unset_Cb func;
      void *data;
      Eina_Bool intercepted;
   } clip_unset;
   struct {
      Evas_Object_Intercept_Focus_Set_Cb func;
      void *data;
      Eina_Bool intercepted;
   } focus_set;
};

struct _Evas_Smart_Cb_Description_Array
{
   unsigned int                      size;
   const Evas_Smart_Cb_Description **array;
};

struct _Evas_Smart_Interfaces_Array
{
   unsigned int                 size;
   const Evas_Smart_Interface **array;
};

struct _Evas_Smart
{
   DATA32            magic;

   int               usage;

   const Evas_Smart_Class *smart_class;

   Evas_Smart_Cb_Description_Array callbacks;
   Evas_Smart_Interfaces_Array interfaces;

   unsigned char     delete_me : 1;
   unsigned char     class_allocated : 1;

};

struct _Evas_Modifier
{
   struct {
      int       count;
      char    **list;
   } mod;
   Eina_Hash *masks; /* we have a max of 64 modifiers per seat */
   Evas_Public_Data *e;
};

struct _Evas_Lock
{
   struct {
      int       count;
      char    **list;
   } lock;
   Eina_Hash *masks; /* we have a max of 64 locks per seat */
   Evas_Public_Data *e;
};

struct _Evas_Post_Callback
{
   Evas_Object               *obj;
   Evas_Object_Event_Post_Cb  func;
   const void                *data;
   unsigned char              delete_me : 1;
};

// somehow this has bugs ... and i am not sure why...
//#define INLINE_ACTIVE_GEOM 1

typedef struct
{
#ifdef INLINE_ACTIVE_GEOM
   Evas_Coord_Rectangle        rect;
#endif
   Evas_Object_Protected_Data *obj;
} Evas_Active_Entry;

struct _Evas_Pointer_Data
{
   Evas_Device    *pointer;
   struct {
      Eina_List *in;
   } object;
   DATA32         button;
   Evas_Coord     x, y;
   Evas_Point     prev;
   int            mouse_grabbed;
   int            downs;
   int            nogrep;
   unsigned char  inside : 1;
};

struct _Evas_Public_Data
{
   EINA_INLIST;

   DATA32            magic;
   Evas              *evas;

   Eina_List         *pointers;

   struct  {
      Evas_Coord     x, y, w, h;
      unsigned char  changed : 1;
   } viewport;

   struct {
      int            w, h;
      DATA32         render_method;
      unsigned char  changed : 1;
   } output;

   struct
     {
        Evas_Coord x, y, w, h;
        Eina_Bool changed : 1;
     } framespace;

   Eina_List        *damages;
   Eina_List        *obscures;

   Evas_Layer       *layers;

   Eina_Hash        *name_hash;

   // locking so we can implement async rendering threads
   Eina_Lock         lock_objects;

   int               output_validity;

   int               walking_list;
   Evas_Event_Flags  default_event_flags;

   struct {
      Evas_Module *module;
      Evas_Func *func;
      Ector_Surface *ector;
      struct {
         void *output;
      } data;

      void *info;
      int   info_magic;
   } engine;

   struct {
      Eina_List *updates;
      Eina_Spinlock lock;
   } render;

   Eina_Array     delete_objects;
   Eina_Inarray   active_objects;
   Eina_Array     restack_objects;
   Eina_Array     render_objects;
   Eina_Array     pending_objects;
   Eina_Array     obscuring_objects;
   Eina_Array     temporary_objects;
   Eina_Array     snapshot_objects;
   Eina_Array     clip_changes;
   Eina_Array     scie_unref_queue;
   Eina_Array     image_unref_queue;
   Eina_Array     glyph_unref_queue;
   Eina_Array     texts_unref_queue;

   Eina_Clist     calc_list;
   Eina_Clist     calc_done;
   Eina_List     *video_objects;

   Eina_List     *post_events; // free me on evas_free

   Eina_Inlist    *callbacks;

   int            delete_grabs;
   int            walking_grabs;
   Eina_List     *grabs;

   Eina_List     *font_path;

   Eina_Inarray  *update_del_redirect_array;

   int            in_smart_calc;
   int            smart_calc_count;

   Eina_Hash     *focused_objects; //Key - seat; value - the focused object
   Eina_List     *focused_by; //Which seat has the canvas focus
   void          *attach_data;
   Evas_Modifier  modifiers;
   Evas_Lock      locks;
   unsigned int   last_timestamp;
   int            last_mouse_down_counter;
   int            last_mouse_up_counter;
   int            nochange;
   Evas_Font_Hinting_Flags hinting;

   Eina_List     *touch_points;
   Eina_List     *devices;
   Eina_Array    *cur_device;

   Eina_List     *outputs;

   Evas_Device   *default_seat;
   Evas_Device   *default_mouse;
   Evas_Device   *default_keyboard;

   unsigned char  changed : 1;
   unsigned char  delete_me : 1;
   unsigned char  invalidate : 1;
   unsigned char  cleanup : 1;
   Eina_Bool      is_frozen : 1;
   Eina_Bool      rendering : 1;
   Eina_Bool      render2 : 1;
   Eina_Bool      common_init : 1;
};

struct _Evas_Layer
{
   EINA_INLIST;

   short             layer;
   Evas_Object_Protected_Data      *objects;

   Evas_Public_Data *evas;

   void             *engine_data;
   Eina_List        *removes;
   int               usage;
   int               walking_objects;
   unsigned char     delete_me : 1;
};

struct _Evas_Size
{
   Evas_Coord w, h;
};

struct _Evas_Aspect
{
   Evas_Aspect_Control mode;
   Evas_Size size;
};

struct _Evas_Border
{
   Evas_Coord l, r, t, b;
};

struct _Evas_Double_Pair
{
   double x, y;
};

struct _Evas_Size_Hints
{
   Evas_Size min, max, user_min, request;
   Evas_Aspect aspect;
   Evas_Double_Pair align, weight;
   Evas_Border padding;
   Evas_Display_Mode dispmode;
};

struct _Evas_Map_Point
{
   double x, y, z, px, py;
   double u, v;
   unsigned char r, g, b, a;
};

struct _Evas_Map
{
   DATA32                magic;
   int                   count; // num of points
   Evas_Coord_Rectangle  normal_geometry; // bounding box of map geom actually
//   void                 *surface; // surface holding map if needed
//   int                   surface_w, surface_h; // current surface w & h alloc
   double                mx, my; // mouse x, y after conversion to map space
   struct {
      Evas_Coord         px, py, z0, foc;
   } persp;
   Eina_Bool             alpha : 1;
   Eina_Bool             smooth : 1;
   struct {
      Eina_Bool          enabled : 1;
      Evas_Coord         diff_x, diff_y;
   } move_sync;
   Evas_Map_Point        points[]; // actual points
};

struct _Evas_Object_Proxy_Data
{
   Eina_List               *proxies;
   Eina_List               *proxy_textures;
   void                    *surface;
   int                      w,h;
   Eina_List               *src_event_in;
   Eina_Bool                redraw : 1;
   Eina_Bool                is_proxy : 1;
   Eina_Bool                src_invisible : 1;
   Eina_Bool                src_events: 1;
};

struct _Evas_Object_Map_Data
{
   // WARNING - you cannot change the below cur/prev layout, content or size
   // unless you also update evas_object_main.c _map_same() func
   struct {
      Evas_Map             *map;
      Evas_Object          *map_parent;

      Eina_Bool             usemap : 1;
      Eina_Bool             valid_map : 1;
   } cur, prev;
   void                 *surface; // surface holding map if needed
   int                   surface_w, surface_h; // current surface w & h alloc

   Evas_Map             *cache_map;
   RGBA_Map             *spans;
};

struct _Evas_Object_3D_Data
{
   void          *surface;
   int            w, h;
};

// Mask clipper information
struct _Evas_Object_Mask_Data
{
   void          *surface;
   int            w, h;
   Eina_Bool      is_mask : 1;
   Eina_Bool      redraw : 1;
   Eina_Bool      is_alpha : 1;
   Eina_Bool      is_scaled : 1;
};

struct _Evas_Object_Protected_State
{
   Evas_Object_Protected_Data *clipper;

   Evas_Coord_Rectangle  geometry;
   struct {
      struct {
         Evas_Coord      x, y, w, h;
         unsigned char   r, g, b, a;
         Eina_Bool       visible : 1;
         Eina_Bool       dirty : 1;
      } clip;
   } cache;
   struct {
      unsigned char      r, g, b, a;
   } color;

   double                scale;

   short                 layer;

   Evas_Render_Op        render_op : 4;

   Eina_Bool             visible : 1;
   Eina_Bool             have_clipees : 1;
   Eina_Bool             anti_alias : 1;
   Eina_Bool             valid_bounding_box : 1;
   Eina_Bool             snapshot : 1;
};

struct _Evas_Object_Pointer_Data {
   EINA_INLIST;

   Evas_Pointer_Data *evas_pdata;
   Evas_Object_Pointer_Mode pointer_mode;
   int mouse_grabbed;
   Eina_Bool mouse_in;
};

struct _Evas_Object_Protected_Data
{
   EINA_INLIST;

   const char              *type;
   Evas_Layer              *layer;

   const Evas_Object_Protected_State *cur;
   const Evas_Object_Protected_State *prev;

   char                       *name;

   Evas_Intercept_Func        *interceptors;
   Eina_List                  *grabs;

   Eina_Inlist                *callbacks;
   /*
      The list below contain the seats (Efl.Input.Devices) which this
      object allows events to be reported (Mouse, Keybord and focus events).
    */
   Eina_List                  *events_whitelist;

   struct {
      Eina_List               *clipees;
      Eina_List               *cache_clipees_answer;
      Eina_List               *changes;
      Evas_Object_Protected_Data *mask, *prev_mask;
   } clip;

   const Evas_Object_Func     *func;
   void                       *private_data;

   struct {
      Evas_Smart              *smart;
      Evas_Object             *parent;
      Evas_Smart_Data         *parent_data;
      Evas_Object_Protected_Data *parent_object_data;
   } smart;

   // Eina_Cow pointer be careful when writing to it
   const Evas_Object_Proxy_Data *proxy;
   const Evas_Object_Map_Data *map;
   const Evas_Object_3D_Data  *data_3d;
   const Evas_Object_Mask_Data *mask;
   Eina_List                  *focused_by_seats;
   Eina_Inlist                *pointer_grabs;

   // Pointer to the Evas_Object itself
   Evas_Object                *object;

   Evas_Size_Hints            *size_hints;

   int                         last_mouse_down_counter;
   int                         last_mouse_up_counter;
   int                         last_event_id;
   Evas_Callback_Type          last_event_type;

   struct {
      int                      in_move, in_resize;
   } doing;

   unsigned int                ref;

   unsigned int                animator_ref;
   uint64_t                    callback_mask;

   unsigned char               no_change_render;
   unsigned char               delete_me;

   Eina_Bool                   render_pre : 1;
   Eina_Bool                   rect_del : 1;

   Eina_Bool                   is_active : 1;
   Eina_Bool                   changed : 1;
   Eina_Bool                   restack : 1;
   Eina_Bool                   is_smart : 1;
   Eina_Bool                   pass_events : 1;
   Eina_Bool                   store : 1;

   Eina_Bool                   changed_move : 1;
   Eina_Bool                   changed_color : 1;
   Eina_Bool                   changed_map : 1;
   Eina_Bool                   changed_pchange : 1;
   Eina_Bool                   changed_src_visible : 1;
   Eina_Bool                   freeze_events : 1;
   Eina_Bool                   repeat_events : 1;
   Eina_Bool                   no_propagate : 1;

   Eina_Bool                   del_ref : 1;
   Eina_Bool                   need_surface_clear : 1;
   Eina_Bool                   pre_render_done : 1;
   Eina_Bool                   precise_is_inside : 1;
   Eina_Bool                   is_static_clip : 1;

   Eina_Bool                   in_layer : 1;
   Eina_Bool                   is_frame : 1;
   Eina_Bool                   is_frame_top : 1; // this is the frame edje
   Eina_Bool                   child_has_map : 1;
   Eina_Bool                   efl_del_called : 1;
   Eina_Bool                   no_render : 1; // since 1.15
   Eina_Bool                   legacy : 1; // used legacy constructor
   Eina_Bool                   clean_layer : 1; // destructor option

   struct  {
      Eina_Bool                pass_events : 1;
      Eina_Bool                pass_events_valid : 1;
      Eina_Bool                freeze_events : 1;
      Eina_Bool                freeze_events_valid : 1;
      Eina_Bool                src_invisible : 1;
      Eina_Bool                src_invisible_valid : 1;
   } parent_cache;

   Eina_Bool                   events_filter_enabled : 1;
};

struct _Evas_Data_Node
{
   char *key;
   void *data;
};

struct _Evas_Font_Dir
{
   Eina_Hash *lookup;
   Eina_List *fonts;
   Eina_List *aliases;
   DATA64     dir_mod_time;
   DATA64     fonts_dir_mod_time;
   DATA64     fonts_alias_mod_time;
};

struct _Evas_Font
{
   struct {
      const char *prop[14];
   } x;
   struct {
      const char *name;
   } simple;
   const char *path;
   char     type;
};

struct _Evas_Font_Alias
{
   const char *alias;
   Evas_Font  *fn;
};

struct _Evas_Font_Description
{
   int ref;
   Eina_Stringshare *name;
   Eina_Stringshare *fallbacks;
   Eina_Stringshare *lang;
   Eina_Stringshare *style;

   Evas_Font_Slant slant;
   Evas_Font_Weight weight;
   Evas_Font_Width width;
   Evas_Font_Spacing spacing;

   Eina_Bool is_new : 1;
};

struct _Evas_Object_Filter_Data
{
   Eina_Stringshare    *name;
   Eina_Stringshare    *code;
   Evas_Filter_Program *chain;
   Eina_Hash           *sources; // Evas_Filter_Proxy_Binding
   Eina_Inlist         *data; // Evas_Filter_Data_Binding
   void                *output;
   struct {
      struct {
         Eina_Stringshare *name;
         double            value;
      } cur;
      struct {
         Eina_Stringshare *name;
         double            value;
      } next;
      double               pos;
   } state;
   Eina_Bool            changed : 1;
   Eina_Bool            invalid : 1; // Code parse failed
   Eina_Bool            async : 1;
};

struct _Evas_Object_Func
{
   void (*free) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
   void (*render) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
                   void *output, void *context, void *surface, int x, int y, Eina_Bool do_async);
   void (*render_pre) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
   void (*render_post) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);

   unsigned int  (*type_id_get) (Evas_Object *obj);
   unsigned int  (*visual_id_get) (Evas_Object *obj);
   void *(*engine_data_get) (Evas_Object *obj);

   void (*store) (Evas_Object *obj);
   void (*unstore) (Evas_Object *obj);

   int  (*is_visible) (Evas_Object *obj);
   int  (*was_visible) (Evas_Object *obj);

   int  (*is_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
   int  (*was_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);

   int  (*is_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
                      Evas_Coord x, Evas_Coord y);
   int  (*was_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
                       Evas_Coord x, Evas_Coord y);

   void (*coords_recalc) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);

   void (*scale_update) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);

   int (*has_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
   int (*get_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
                           Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);

   int (*can_map) (Evas_Object *obj);
// new - add to prepare list during render if object needs some pre-render
// preparation - may include rendering content to buffer or loading data
// from disk or uploading to texture etc.
   void (*render_prepare) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Eina_Bool do_async);

// new render2 functions

   void (*render2_walk) (Evas_Object *obj, Evas_Object_Protected_Data *pd,
                         void *type_private_data, void *updates,
                         int offx, int offy);
//   void (*render2) (Evas_Object *obj, Evas_Object_Protected_Data *pd,
//                    void *type_private_data, void *output, void *context,
//                    void *surface, int x, int y);
};

struct _Evas_Func
{
   void *(*info)                           (Evas *e);
   void (*info_free)                       (Evas *e, void *info);
   void *(*setup)                          (void *info, unsigned int w, unsigned int h);
   int  (*update)                          (void *data, void *info, unsigned int w, unsigned int h);

   void (*output_free)                     (void *data);
   void (*output_resize)                   (void *data, int w, int h);
   void (*output_tile_size_set)            (void *data, int w, int h);
   void (*output_redraws_rect_add)         (void *data, int x, int y, int w, int h);
   void (*output_redraws_rect_del)         (void *data, int x, int y, int w, int h);
   void (*output_redraws_clear)            (void *data);
   void *(*output_redraws_next_update_get) (void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
   void (*output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h, Evas_Render_Mode render_mode);
   void (*output_flush)                    (void *data, Evas_Render_Mode render_mode);
   void (*output_idle_flush)               (void *data);
   void (*output_dump)                     (void *data);

   void *(*context_new)                    (void *data);
   void *(*context_dup)                    (void *data, void *context);
   Eina_Bool (*canvas_alpha_get)           (void *data);
   void (*context_free)                    (void *data, void *context);
   void (*context_clip_set)                (void *data, void *context, int x, int y, int w, int h);
   void (*context_clip_image_set)          (void *data, void *context, void *surface, int x, int y, Evas_Public_Data *evas, Eina_Bool do_async);
   void (*context_clip_image_unset)        (void *data, void *context);
   void (*context_clip_image_get)          (void *data, void *context, void **surface, int *x, int *y); /* incref surface if not NULL */
   void (*context_clip_clip)               (void *data, void *context, int x, int y, int w, int h);
   void (*context_clip_unset)              (void *data, void *context);
   int  (*context_clip_get)                (void *data, void *context, int *x, int *y, int *w, int *h);
   void (*context_color_set)               (void *data, void *context, int r, int g, int b, int a);
   int  (*context_color_get)               (void *data, void *context, int *r, int *g, int *b, int *a);
   void (*context_multiplier_set)          (void *data, void *context, int r, int g, int b, int a);
   void (*context_multiplier_unset)        (void *data, void *context);
   int  (*context_multiplier_get)          (void *data, void *context, int *r, int *g, int *b, int *a);
   void (*context_cutout_add)              (void *data, void *context, int x, int y, int w, int h);
   void (*context_cutout_clear)            (void *data, void *context);
   void (*context_anti_alias_set)          (void *data, void *context, unsigned char aa);
   unsigned char (*context_anti_alias_get) (void *data, void *context);
   void (*context_color_interpolation_set) (void *data, void *context, int color_space);
   int  (*context_color_interpolation_get) (void *data, void *context);
   void (*context_render_op_set)           (void *data, void *context, int render_op);
   int  (*context_render_op_get)           (void *data, void *context);

   void (*rectangle_draw)                  (void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async);

   void (*line_draw)                       (void *data, void *context, void *surface, int x1, int y1, int x2, int y2, Eina_Bool do_async);

   void *(*polygon_point_add)              (void *data, void *polygon, int x, int y);
   void *(*polygon_points_clear)           (void *data, void *polygon);
   void (*polygon_draw)                    (void *data, void *context, void *surface, void *polygon, int x, int y, Eina_Bool do_async);

   void *(*image_load)                     (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
   void *(*image_mmap)                     (void *data, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo);
   void *(*image_new_from_data)            (void *data, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
   void *(*image_new_from_copied_data)     (void *data, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
   void (*image_free)                      (void *data, void *image);
   void *(*image_ref)                      (void *data, void *image);
   void (*image_size_get)                  (void *data, void *image, int *w, int *h);
   void *(*image_size_set)                 (void *data, void *image, int w, int h);
   void (*image_stride_get)                (void *data, void *image, int *stride);
   void *(*image_dirty_region)             (void *data, void *image, int x, int y, int w, int h);
   void *(*image_data_get)                 (void *data, void *image, int to_write, DATA32 **image_data, int *err, Eina_Bool *tofree);
   void *(*image_data_put)                 (void *data, void *image, DATA32 *image_data);
   Eina_Bool (*image_data_direct_get)      (void *data, void *image, int plane, Eina_Slice *slice, Evas_Colorspace *cspace);
   void  (*image_data_preload_request)     (void *data, void *image, const Eo *target);
   void  (*image_data_preload_cancel)      (void *data, void *image, const Eo *target);
   void *(*image_alpha_set)                (void *data, void *image, int has_alpha);
   int  (*image_alpha_get)                 (void *data, void *image);
   void *(*image_orient_set)               (void *data, void *image, Evas_Image_Orient orient);
   Evas_Image_Orient (*image_orient_get)   (void *data, void *image);
   Eina_Bool (*image_draw)                 (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async);
   void (*image_colorspace_set)            (void *data, void *image, Evas_Colorspace cspace);
   Evas_Colorspace (*image_colorspace_get) (void *data, void *image);
   Evas_Colorspace (*image_file_colorspace_get)(void *data, void *image);
   Eina_Bool (*image_can_region_get)       (void *data, void *image);

   /* image data map/unmap: direct or indirect access to pixels data */
   Eina_Bool (*image_data_map)             (void *data, void **image, Eina_Rw_Slice *slice, int *stride, int x, int y, int w, int h, Evas_Colorspace cspace, Efl_Gfx_Buffer_Access_Mode mode, int plane);
   Eina_Bool (*image_data_unmap)           (void *data, void *image, const Eina_Rw_Slice *slice);
   int (*image_data_maps_get)              (void *data, const void *image, const Eina_Rw_Slice **slices);

   /* new api for direct data set (not put) */
   void *(*image_data_slice_add)           (void *data, void *image, const Eina_Slice *slice, Eina_Bool copy, int w, int h, int stride, Evas_Colorspace space, int plane, Eina_Bool alpha);

   void (*image_prepare)                   (void *data, void *image);

   void *(*image_surface_noscale_new)      (void *data, int w, int h, int alpha);
   void (*image_surface_noscale_region_get)(void *data, void *image, int *x, int *y, int *w, int *h);

   int (*image_native_init)                (void *data, Evas_Native_Surface_Type type);
   void (*image_native_shutdown)           (void *data, Evas_Native_Surface_Type type);
   void *(*image_native_set)               (void *data, void *image, void *native);
   void *(*image_native_get)               (void *data, void *image);

   void (*image_cache_flush)               (void *data);
   void (*image_cache_set)                 (void *data, int bytes);
   int  (*image_cache_get)                 (void *data);

   Evas_Font_Set *(*font_load)             (void *data, const char *name, int size, Font_Rend_Flags wanted_rend);
   Evas_Font_Set *(*font_memory_load)      (void *data, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
   Evas_Font_Set *(*font_add)              (void *data, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend);
   Evas_Font_Set *(*font_memory_add)       (void *data, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
   void (*font_free)                       (void *data, Evas_Font_Set *font);
   int  (*font_ascent_get)                 (void *data, Evas_Font_Set *font);
   int  (*font_descent_get)                (void *data, Evas_Font_Set *font);
   int  (*font_max_ascent_get)             (void *data, Evas_Font_Set *font);
   int  (*font_max_descent_get)            (void *data, Evas_Font_Set *font);
   void (*font_string_size_get)            (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h);
   int  (*font_inset_get)                  (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
   int  (*font_h_advance_get)              (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
   int  (*font_v_advance_get)              (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
   int  (*font_char_coords_get)            (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
   int  (*font_char_at_coords_get)         (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
   Eina_Bool (*font_draw)                  (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Text_Props *intl_props, Eina_Bool do_async);
   void (*font_cache_flush)                (void *data);
   void (*font_cache_set)                  (void *data, int bytes);
   int  (*font_cache_get)                  (void *data);

   /* Engine functions will over time expand from here */

   void (*font_hinting_set)                (void *data, Evas_Font_Set *font, int hinting);
   int  (*font_hinting_can_hint)           (void *data, int hinting);

/*    void (*image_rotation_set)              (void *data, void *image); */

   void (*image_scale_hint_set)            (void *data, void *image, int hint);
   int  (*image_scale_hint_get)            (void *data, void *image);
   int  (*font_last_up_to_pos)             (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y);

   Eina_Bool (*image_map_draw)                  (void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async);
   void *(*image_map_surface_new)          (void *data, int w, int h, int alpha);
   void (*image_map_clean)                 (void *data, RGBA_Map *m);
   void *(*image_scaled_update)            (void *data, void *scaled, void *image, int dst_w, int dst_h, Eina_Bool smooth, Eina_Bool alpha, Evas_Colorspace cspace);

   void (*image_content_hint_set)          (void *data, void *surface, int hint);
   int  (*image_content_hint_get)          (void *data, void *surface);
   int  (*font_pen_coords_get)             (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
   Eina_Bool (*font_text_props_info_create) (void *data, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len, Evas_Text_Props_Mode mode, const char *lang);
   int  (*font_right_inset_get)            (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);

   /* EFL-GL Glue Layer */
   void *(*gl_surface_create)            (void *data, void *config, int w, int h);
   void *(*gl_pbuffer_surface_create)    (void *data, void *config, int w, int h, int const *attrib_list);
   int  (*gl_surface_destroy)            (void *data, void *surface);
   void *(*gl_context_create)            (void *data, void *share_context, int version, void *(*native_context_get)(void *ctx), void *(*engine_data_get)(void *evasgl));
   int  (*gl_context_destroy)            (void *data, void *context);
   int  (*gl_make_current)               (void *data, void *surface, void *context);
   const char *(*gl_string_query)        (void *data, int name);
   void *(*gl_proc_address_get)          (void *data, const char *name);
   int  (*gl_native_surface_get)         (void *data, void *surface, void *native_surface);
   void *(*gl_api_get)                   (void *data, int version);
   void (*gl_direct_override_get)        (void *data, Eina_Bool *override, Eina_Bool *force_off);
   void (*gl_get_pixels_set)             (void *data, void *get_pixels, void *get_pixels_data, void *obj);
   Eina_Bool (*gl_surface_lock)          (void *data, void *surface);
   Eina_Bool (*gl_surface_read_pixels)   (void *data, void *surface, int x, int y, int w, int h, Evas_Colorspace cspace, void *pixels);
   Eina_Bool (*gl_surface_unlock)        (void *data, void *surface);
   int  (*gl_error_get)                  (void *data);
   void *(*gl_current_context_get)       (void *data);
   void *(*gl_current_surface_get)       (void *data);
   int  (*gl_rotation_angle_get)         (void *data);
   Eina_Bool (*gl_surface_query)         (void *data, void *surface, int attr, void *value);
   Eina_Bool (*gl_surface_direct_renderable_get) (void *data, Evas_Native_Surface *ns, Eina_Bool *override, void *surface);
   void (*gl_image_direct_set)           (void *data, void *image, Eina_Bool direct);
   int  (*gl_image_direct_get)           (void *data, void *image);
   void (*gl_get_pixels_pre)             (void *data);
   void (*gl_get_pixels_post)            (void *data);

   int  (*image_load_error_get)          (void *data, void *image);
   int  (*font_run_end_get)              (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);

   /* animated feature */
   Eina_Bool (*image_animated_get)       (void *data, void *image);
   int (*image_animated_frame_count_get) (void *data, void *image);
   Evas_Image_Animated_Loop_Hint  (*image_animated_loop_type_get) (void *data, void *image);
   int (*image_animated_loop_count_get)  (void *data, void *image);
   double (*image_animated_frame_duration_get) (void *data, void *image, int start_frame, int frame_num);
   Eina_Bool (*image_animated_frame_set) (void *data, void *image, int frame_index);

   /* max size query */
   void (*image_max_size_get)            (void *data, int *maxw, int *maxh);

   /* multiple font draws */
   Eina_Bool (*multi_font_draw)          (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Font_Array *texts, Eina_Bool do_async);

   Eina_Bool (*pixel_alpha_get)          (void *image, int x, int y, DATA8 *alpha, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);

   void (*context_flush)                 (void *data);

   /* 3D features */
   void *(*drawable_new)                 (void *data, int w, int h, int alpha);
   void  (*drawable_free)                (void *data, void *drawable);
   void  (*drawable_size_get)            (void *data, void *drawable, int *w, int *h);
   void *(*image_drawable_set)           (void *data, void *image, void *drawable);
   void (*drawable_texture_rendered_pixels_get) (unsigned int tex, int x, int y, int w, int h, void *drawable EINA_UNUSED, void *data);
   void  (*drawable_scene_render)        (void *data, void *drawable, void *scene_data);
   Eina_Bool (*drawable_scene_render_to_texture) (void *data, void *drawable, void *scene_data);

   int (*drawable_texture_color_pick_id_get) (void *drawable);
   int (*drawable_texture_target_id_get) (void *drawable);
   void (*drawable_texture_pixel_color_get) (unsigned int tex EINA_UNUSED, int x, int y, Evas_Color *color, void *drawable);

   void *(*texture_new)                  (void *data, Eina_Bool use_atlas);
   void  (*texture_free)                 (void *data, void *texture);
   void  (*texture_size_get)             (void *data, void *texture, int *w, int *h);
   void  (*texture_wrap_set)             (void *data, void *texture, Evas_Canvas3D_Wrap_Mode s, Evas_Canvas3D_Wrap_Mode t);
   void  (*texture_wrap_get)             (void *data, void *texture, Evas_Canvas3D_Wrap_Mode *s, Evas_Canvas3D_Wrap_Mode *t);
   void  (*texture_filter_set)           (void *data, void *texture, Evas_Canvas3D_Texture_Filter min, Evas_Canvas3D_Texture_Filter mag);
   void  (*texture_filter_get)           (void *data, void *texture, Evas_Canvas3D_Texture_Filter *min, Evas_Canvas3D_Texture_Filter *mag);
   void  (*texture_image_set)            (void *data, void *texture, void *image);
   void *(*texture_image_get)            (void *data, void *texture);

   Ector_Surface *(*ector_create)        (void *data);
   void  (*ector_destroy)                (void *data, Ector_Surface *surface);
   Ector_Buffer *(*ector_buffer_wrap)    (void *data, Evas *e, void *engine_image, Eina_Bool is_rgba_image);
   Ector_Buffer *(*ector_buffer_new)     (void *data, Evas *e, void *pixels, int width, int height, int stride, Efl_Gfx_Colorspace cspace, Eina_Bool writeable, int l, int r, int t, int b, Ector_Buffer_Flag flags);
   void  (*ector_begin)                  (void *data, void *context, Ector_Surface *ector, void *surface, void *engine_data, int x, int y, Eina_Bool do_async);
   void  (*ector_renderer_draw)          (void *data, void *context, void *surface, void *engine_data, Ector_Renderer *r, Eina_Array *clips, Eina_Bool do_async);
   void  (*ector_end)                    (void *data, void *context, Ector_Surface *ector, void *surface, void *engine_data, Eina_Bool do_async);
   void* (*ector_new)                    (void *data, void *context, Ector_Surface *ector, void *surface);
   void  (*ector_free)                   (void *engine_data);
};

struct _Evas_Image_Save_Func
{
  int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding);
};

struct _Evas_Vg_Load_Func
{
  void     *(*file_data) (Eina_File *f, Eina_Stringshare *key, int *error);
};

struct _Evas_Vg_Save_Func
{
  int (*vg_save) (void *vg, const char *file, const char *key, int compress);
};

#ifdef __cplusplus
extern "C" {
#endif

Evas_Object *evas_object_new(Evas *e);
void evas_object_change_reset(Evas_Object *obj);
void evas_object_clip_recalc(Evas_Object_Protected_Data *obj);
void evas_object_cur_prev(Evas_Object *obj);
void evas_object_free(Evas_Object *obj, Eina_Bool clean_layer);
void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s);
void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e);
void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer);
void evas_object_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_content_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_clip_changes_clean(Evas_Object *obj);
void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
void evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh);
Evas_Object_Pointer_Data *_evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata, Evas_Object_Protected_Data *obj);

void evas_object_clip_dirty(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_recalc_clippees(Evas_Object_Protected_Data *pd);
Evas_Layer *evas_layer_new(Evas *e);
void _evas_layer_flush_removes(Evas_Layer *lay);
void evas_layer_pre_free(Evas_Layer *lay);
void evas_layer_free_objects(Evas_Layer *lay);
void evas_layer_clean(Evas *e);
Evas_Layer *evas_layer_find(Evas *e, short layer_num);
void evas_layer_add(Evas_Layer *lay);
void evas_layer_del(Evas_Layer *lay);

int evas_object_was_in_output_rect(Evas_Object *obj, Evas_Object_Protected_Data *pd, int x, int y, int w, int h);

int evas_object_was_opaque(Evas_Object *obj, Evas_Object_Protected_Data *pd);
int evas_object_is_inside(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y);
int evas_object_was_inside(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y);
void evas_object_clip_across_check(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_clip_across_clippees_check(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_mapped_clip_across_mark(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info);
void evas_object_callback_init(Efl_Canvas_Object *eo_obj, Evas_Object_Protected_Data *obj);
void evas_object_event_callback_call(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Callback_Type type, void *event_info, int event_id, const Efl_Event_Description *efl_event_desc);
Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
int evas_mem_free(int mem_required);
int evas_mem_degrade(int mem_required);
void evas_debug_error(void);
void evas_debug_input_null(void);
void evas_debug_magic_null(void);
void evas_debug_magic_wrong(DATA32 expected, DATA32 supplied);
void evas_debug_generic(const char *str);
const char *evas_debug_magic_string_get(DATA32 magic);
void evas_render_update_del(Evas_Public_Data *e, int x, int y, int w, int h);
void evas_render_object_render_cache_free(Evas_Object *eo_obj, void *data);
   
void evas_object_smart_use(Evas_Smart *s);
void evas_object_smart_unuse(Evas_Smart *s);
void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1);
Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1);
const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;

Evas_Object *_evas_object_image_source_get(Evas_Object *obj);
Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading);
void _evas_object_image_preloading_check(Evas_Object *obj);
Evas_Object *_evas_object_image_videfl_parent_get(Evas_Object *obj);
void _evas_object_image_video_overlay_show(Evas_Object *obj);
void _evas_object_image_video_overlay_hide(Evas_Object *obj);
void _evas_object_image_video_overlay_do(Evas_Object *obj);
void _evas_object_image_free(Evas_Object *obj);
void evas_object_smart_bounding_box_get(Evas_Object *eo_obj,
                                        Evas_Coord_Rectangle *cur_bounding_box,
                                        Evas_Coord_Rectangle *prev_bounding_box);
void evas_object_smart_del(Evas_Object *obj);
void evas_object_smart_cleanup(Evas_Object *obj);
void evas_object_smart_member_raise(Evas_Object *member);
void evas_object_smart_member_lower(Evas_Object *member);
void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other);
void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other);
void evas_object_smart_render_cache_clear(Evas_Object *eo_obj);
void *evas_object_smart_render_cache_get(const Evas_Object *eo_obj);
void evas_object_smart_render_cache_set(Evas_Object *eo_obj, void *data);

const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
void _efl_canvas_group_group_members_all_del(Evas_Object *obj);
void _evas_object_smart_xy_update(Eo *eo_obj, Evas_Coord *px, Evas_Coord *py, Evas_Coord x, Evas_Coord y);
void evas_call_smarts_calculate(Evas *e);
void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
void evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
void *evas_mem_calloc(int size);
void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd);
void _evas_post_event_callback_free(Evas *e);
void evas_event_callback_list_post_free(Eina_Inlist **list);
void evas_object_event_callback_all_del(Evas_Object *obj);
void evas_object_event_callback_cleanup(Evas_Object *obj);
void evas_event_callback_all_del(Evas *e);
void evas_event_callback_cleanup(Evas *e);
void evas_object_inform_call_show(Evas_Object *obj);
void evas_object_inform_call_hide(Evas_Object *obj);
void evas_object_inform_call_move(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_object_inform_call_resize(Evas_Object *obj);
void evas_object_inform_call_restack(Evas_Object *obj);
void evas_object_inform_call_changed_size_hints(Evas_Object *obj);
void evas_object_inform_call_image_preloaded(Evas_Object *obj);
void evas_object_inform_call_image_unloaded(Evas_Object *obj);
void evas_object_inform_call_image_resize(Evas_Object *obj);
void evas_object_intercept_cleanup(Evas_Object *obj);
void evas_object_grabs_cleanup(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_key_grab_free(Evas_Object *obj, Evas_Object_Protected_Data *pd, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
void evas_font_dir_cache_free(void);
const char *evas_font_dir_cache_find(char *dir, char *font);
Eina_List *evas_font_dir_available_list(const Evas* evas);
void evas_font_dir_available_list_free(Eina_List *available);
void evas_font_free(Evas *evas, void *font);
void evas_fonts_zero_free(Evas *evas);
void evas_fonts_zero_pressure(Evas *evas);
void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
Evas_Font_Description *evas_font_desc_new(void);
Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
void evas_font_desc_unref(Evas_Font_Description *fdesc);
int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
const char *evas_font_lang_normalize(const char *lang);
void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size);
void evas_font_load_hinting_set(Evas *evas, void *font, int hinting);
void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool sourve_invisible);
void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b);
void _evas_object_text_rehint(Evas_Object *obj);
void _evas_object_textblock_rehint(Evas_Object *obj);

void evas_unref_queue_image_put(Evas_Public_Data *pd, void *image);
void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph);
void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph);

void evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj,
                                     void *data, void *context, void *surface,
                                     void *image, RGBA_Map *m, int smooth,
                                     int level, Eina_Bool do_async);
void evas_font_draw_async_check(Evas_Object_Protected_Data *obj,
                                void *data, void *context, void *surface,
                                Evas_Font_Set *font,
                                int x, int y, int w, int h, int ow, int oh,
                                Evas_Text_Props *intl_props, Eina_Bool do_async);

void _efl_canvas_object_clip_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev);

Eina_Bool _efl_canvas_object_clip_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip);
Eina_Bool _efl_canvas_object_clip_unset_block(Eo *eo_obj, Evas_Object_Protected_Data *obj);
Eina_Bool _efl_canvas_object_efl_gfx_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h, Eina_Bool internal);

void _canvas_event_default_flags_set(Eo *e, void *_pd, va_list *list);
void _canvas_event_default_flags_get(Eo *e, void *_pd, va_list *list);
void _canvas_event_freeze(Eo *e, void *_pd, va_list *list);
void _canvas_event_thaw(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_down(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_up(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_cancel(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_wheel(Eo *e, void *_pd, va_list *list);
void _canvas_event_input_mouse_move(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_move(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_in(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_mouse_out(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_multi_down(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_multi_up(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_multi_move(Eo *e, void *_pd, va_list *list);
void _canvas_event_input_multi_down(Eo *e, void *_pd, va_list *list);
void _canvas_event_input_multi_up(Eo *e, void *_pd, va_list *list);
void _canvas_event_input_multi_move(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_key_down(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_key_up(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_key_down_with_keycode(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_key_up_with_keycode(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_hold(Eo *e, void *_pd, va_list *list);
void _canvas_event_feed_axis_update(Eo *e, void *_pd, va_list *list);
void _canvas_event_refeed_event(Eo *e, void *_pd, va_list *list);
void _canvas_event_down_count_get(Eo *e, void *_pd, va_list *list);
void _canvas_tree_objects_at_xy_get(Eo *e, void *_pd, va_list *list);
void _canvas_focus_get(Eo *e, void *_pd, va_list *list);
void _canvas_font_path_clear(Eo *e, void *_pd, va_list *list);
void _canvas_font_path_append(Eo *e, void *_pd, va_list *list);
void _canvas_font_path_prepend(Eo *e, void *_pd, va_list *list);
void _canvas_font_path_list(Eo *e, void *_pd, va_list *list);
void _canvas_font_hinting_set(Eo *e, void *_pd, va_list *list);
void _canvas_font_hinting_get(Eo *e, void *_pd, va_list *list);
void _canvas_font_hinting_can_hint(Eo *e, void *_pd, va_list *list);
void _canvas_font_cache_flush(Eo *e, void *_pd, va_list *list);
void _canvas_font_cache_set(Eo *e, void *_pd, va_list *list);
void _canvas_font_cache_get(Eo *e, void *_pd, va_list *list);
void _canvas_font_available_list(Eo *e, void *_pd, va_list *list);
void _evas_focus_device_del_cb(void *data, const Efl_Event *ev);

void _canvas_key_modifier_get(Eo *e, void *_pd, va_list *list);
void _canvas_key_lock_get(Eo *e, void *_pd, va_list *list);
void _canvas_key_modifier_add(Eo *e, void *_pd, va_list *list);
void _canvas_key_modifier_del(Eo *e, void *_pd, va_list *list);
void _canvas_key_lock_add(Eo *e, void *_pd, va_list *list);
void _canvas_key_lock_del(Eo *e, void *_pd, va_list *list);
void _canvas_key_modifier_on(Eo *e, void *_pd, va_list *list);
void _canvas_key_modifier_off(Eo *e, void *_pd, va_list *list);
void _canvas_key_lock_on(Eo *e, void *_pd, va_list *list);
void _canvas_key_lock_off(Eo *e, void *_pd, va_list *list);
void _canvas_key_modifier_mask_get(Eo *e, void *_pd, va_list *list);

void _canvas_damage_rectangle_add(Eo *obj, void *_pd, va_list *list);
void _canvas_obscured_rectangle_add(Eo *obj, void *_pd, va_list *list);
void _canvas_obscured_clear(Eo *obj, void *_pd, va_list *list);
void _canvas_render_async(Eo *obj, void *_pd, va_list *list);
void _canvas_render_updates(Eo *obj, void *_pd, va_list *list);
void _canvas_render(Eo *e, void *_pd, va_list *list);
void _canvas_norender(Eo *e, void *_pd, va_list *list);
void _canvas_render_idle_flush(Eo *e, void *_pd, va_list *list);
void _canvas_sync(Eo *obj, void *_pd, va_list *list);
void _canvas_render_dump(Eo *obj, void *_pd, va_list *list);

void _canvas_object_bottom_get(Eo *e, void *_pd, va_list *list);
void _canvas_object_top_get(Eo *e, void *_pd, va_list *list);

void _canvas_image_cache_flush(Eo *e, void *_pd, va_list *list);
void _canvas_image_cache_reload(Eo *e, void *_pd, va_list *list);
void _canvas_image_cache_set(Eo *e, void *_pd, va_list *list);
void _canvas_image_cache_get(Eo *e, void *_pd, va_list *list);
void _canvas_image_max_size_get(Eo *e, void *_pd, va_list *list);

void _canvas_object_name_find(Eo *e, void *_pd, va_list *list);

void _canvas_object_top_at_xy_get(Eo *e, void *_pd, va_list *list);
void _canvas_object_top_in_rectangle_get(Eo *e, void *_pd, va_list *list);
void _canvas_objects_at_xy_get(Eo *e, void *_pd, va_list *list);
void _canvas_objects_in_rectangle_get(Eo *obj, void *_pd, va_list *list);

void _canvas_smart_objects_calculate(Eo *e, void *_pd, va_list *list);
void _canvas_smart_objects_calculate_count_get(Eo *e, void *_pd, va_list *list);

/* Node functions. */
void evas_canvas3d_node_traverse(Evas_Canvas3D_Node *from, Evas_Canvas3D_Node *to, Evas_Canvas3D_Node_Traverse_Type type, Eina_Bool skip, Evas_Canvas3D_Node_Func func, void *data);
void evas_canvas3d_node_tree_traverse(Evas_Canvas3D_Node *root, Evas_Canvas3D_Tree_Traverse_Type type, Eina_Bool skip, Evas_Canvas3D_Node_Func func, void *data);
Eina_Bool evas_canvas3d_node_mesh_collect(Evas_Canvas3D_Node *node, void *data);
Eina_Bool evas_canvas3d_node_color_node_mesh_collect(Evas_Canvas3D_Node *node, void *data);
Eina_Bool evas_canvas3d_node_light_collect(Evas_Canvas3D_Node *node, void *data);
void evas_canvas3d_node_scene_root_add(Evas_Canvas3D_Node *node, Evas_Canvas3D_Scene *scene);
void evas_canvas3d_node_scene_root_del(Evas_Canvas3D_Node *node, Evas_Canvas3D_Scene *scene);
void evas_canvas3d_node_scene_camera_add(Evas_Canvas3D_Node *node, Evas_Canvas3D_Scene *scene);
void evas_canvas3d_node_scene_camera_del(Evas_Canvas3D_Node *node, Evas_Canvas3D_Scene *scene);
Eina_Bool node_aabb_update(Evas_Canvas3D_Node *node, void *data  EINA_UNUSED);

/* Camera functions. */
void evas_canvas3d_camera_node_add(Evas_Canvas3D_Camera *camera, Evas_Canvas3D_Node *node);
void evas_canvas3d_camera_node_del(Evas_Canvas3D_Camera *camera, Evas_Canvas3D_Node *node);

/* Light functions. */
void evas_canvas3d_light_node_add(Evas_Canvas3D_Light *light, Evas_Canvas3D_Node *node);
void evas_canvas3d_light_node_del(Evas_Canvas3D_Light *light, Evas_Canvas3D_Node *node);

/* Mesh functions. */
void evas_canvas3d_mesh_node_add(Evas_Canvas3D_Mesh *mesh, Evas_Canvas3D_Node *node);
void evas_canvas3d_mesh_node_del(Evas_Canvas3D_Mesh *mesh, Evas_Canvas3D_Node *node);
void evas_canvas3d_mesh_interpolate_position_get(Eina_Vector3 *out, const Evas_Canvas3D_Vertex_Buffer *pos0, const Evas_Canvas3D_Vertex_Buffer *pos1, Evas_Real weight, int index);
void evas_canvas3d_mesh_interpolate_vertex_buffer_get(Evas_Canvas3D_Mesh *mesh, int frame, Evas_Canvas3D_Vertex_Attrib attrib, Evas_Canvas3D_Vertex_Buffer *buffer0, Evas_Canvas3D_Vertex_Buffer *buffer1, Evas_Real *weight);
void evas_canvas3d_mesh_file_md2_set(Evas_Canvas3D_Mesh *mesh, const char *file);
void evas_canvas3d_mesh_save_obj(Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f);
void evas_canvas3d_mesh_file_obj_set(Evas_Canvas3D_Mesh *mesh, const char *file);
Eina_Bool evas_canvas3d_mesh_aabb_add_to_frame(Evas_Canvas3D_Mesh_Data *pd, int frame, int stride);
void evas_canvas3d_mesh_file_eet_set(Evas_Canvas3D_Mesh *mesh, const char *file);
void evas_canvas3d_mesh_save_eet(Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f);
void evas_canvas3d_mesh_file_ply_set(Evas_Canvas3D_Mesh *mesh, const char *file);
void evas_canvas3d_mesh_save_ply(Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f);

/* Texture functions. */
void evas_canvas3d_texture_material_add(Evas_Canvas3D_Texture *texture, Evas_Canvas3D_Material *material);
void evas_canvas3d_texture_material_del(Evas_Canvas3D_Texture *texture, Evas_Canvas3D_Material *material);


/* Material functions. */
void evas_canvas3d_material_mesh_add(Evas_Canvas3D_Material *material, Evas_Canvas3D_Mesh *mesh);
void evas_canvas3d_material_mesh_del(Evas_Canvas3D_Material *material, Evas_Canvas3D_Mesh *mesh);

/* Scene functions. */
void evas_canvas3d_scene_data_init(Evas_Canvas3D_Scene_Public_Data *data);
void evas_canvas3d_scene_data_fini(Evas_Canvas3D_Scene_Public_Data *data);

/* Eet saver/loader functions */
Evas_Canvas3D_File_Eet *_evas_canvas3d_eet_file_new(void);
Eet_Data_Descriptor* _evas_canvas3d_eet_file_get();
void _evas_canvas3d_eet_file_init();
void _evas_canvas3d_eet_descriptor_shutdown();
void _evas_canvas3d_eet_file_free(Evas_Canvas3D_File_Eet* eet_file);


/* Filters */
void evas_filter_init(void);
void evas_filter_shutdown(void);

/* Ector */
Ector_Surface *evas_ector_get(Evas_Public_Data *evas);

/* Temporary save/load functions */
void evas_common_load_model_from_file(Evas_Canvas3D_Mesh *model, const char *file);
void evas_common_load_model_from_eina_file(Evas_Canvas3D_Mesh *model, const Eina_File *file);
void evas_common_save_model_to_file(const Evas_Canvas3D_Mesh *model, const char *file, Evas_Canvas3D_Mesh_Frame *f);
void evas_model_load_file_eet(Evas_Canvas3D_Mesh *mesh, Eina_File *file);
void evas_model_load_file_md2(Evas_Canvas3D_Mesh *mesh, Eina_File *file);
void evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file);
void evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file);
void evas_model_save_file_eet(const Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f);
void evas_model_save_file_obj(const Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f);
void evas_model_save_file_ply(const Evas_Canvas3D_Mesh *mesh, const char *file, Evas_Canvas3D_Mesh_Frame *f);

/* Primitives functions */
void evas_common_set_model_from_primitive(Evas_Canvas3D_Mesh *model, int frame, Evas_Canvas3D_Primitive_Data *primitive);
void evas_model_set_from_square_primitive(Evas_Canvas3D_Mesh *mesh, int frame);
void evas_model_set_from_cube_primitive(Evas_Canvas3D_Mesh *mesh, int frame);
void evas_model_set_from_cylinder_primitive(Evas_Canvas3D_Mesh *mesh, int frame, Evas_Canvas3D_Primitive_Mode mode, int precision, Eina_Vector2 tex_scale);
void evas_model_set_from_cone_primitive(Evas_Canvas3D_Mesh *mesh, int frame, Evas_Canvas3D_Primitive_Mode mode, int precision, Eina_Vector2 tex_scale);
void evas_model_set_from_sphere_primitive(Evas_Canvas3D_Mesh *mesh, int frame, Evas_Canvas3D_Primitive_Mode mode, int precision, Eina_Vector2 tex_scale);
void evas_model_set_from_torus_primitive(Evas_Canvas3D_Mesh *mesh, int frame, Evas_Real ratio, int precision, Eina_Vector2 tex_scale);
void evas_model_set_from_surface_primitive(Evas_Canvas3D_Mesh *mesh, int frame, Evas_Canvas3D_Surface_Func func, int precision, Eina_Vector2 tex_scale);
void evas_model_set_from_terrain_primitive(Evas_Canvas3D_Mesh *mesh, int frame, int precision, Eina_Vector2 tex_scale);

/* Filter functions */
Eina_Bool evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async, Eina_Bool alpha);

extern int _evas_alloc_error;
extern int _evas_event_counter;

struct _Evas_Imaging_Image
{
   RGBA_Image *image;
};

struct _Evas_Imaging_Font
{
   RGBA_Font *font;
};

struct _Evas_Proxy_Render_Data
{
   Evas_Object_Protected_Data *proxy_obj;
   Evas_Object_Protected_Data *src_obj;
   Evas_Object *eo_proxy;
   Evas_Object *eo_src;
   Eina_Rectangle region;
   Eina_Bool source_clip : 1;
};

void _evas_canvas_event_init(Evas *eo_e, Evas_Public_Data *e);
void _evas_canvas_event_shutdown(Evas *eo_e, Evas_Public_Data *e);
void _evas_canvas_event_pointer_in_rect_mouse_move_feed(Evas_Public_Data *edata,
                                                        Evas_Object *obj,
                                                        Evas_Object_Protected_Data *obj_data,
                                                        int w, int h,
                                                        Eina_Bool in_objects_list,
                                                        void *data);
void _evas_canvas_event_pointer_in_list_mouse_move_feed(Evas_Public_Data *edata,
                                                        Eina_List *was,
                                                        Evas_Object *obj,
                                                        Evas_Object_Protected_Data *obj_data,
                                                        int w, int h,
                                                        Eina_Bool xor_rule,
                                                        void *data);
void _evas_canvas_event_pointer_move_event_dispatch(Evas_Public_Data *edata,
                                                    Evas_Pointer_Data *pdata,
                                                    void *data);
int evas_async_events_init(void);
int evas_async_events_shutdown(void);
int evas_async_target_del(const void *target);

EAPI int evas_thread_main_loop_begin(void);
EAPI int evas_thread_main_loop_end(void);

void _evas_preload_thread_init(void);
void _evas_preload_thread_shutdown(void);
Evas_Preload_Pthread *evas_preload_thread_run(void (*func_heavy)(void *data),
                                              void (*func_end)(void *data),
                                              void (*func_cancel)(void *data),
                                              const void *data);
Eina_Bool evas_preload_thread_cancel(Evas_Preload_Pthread *thread);
Eina_Bool evas_preload_thread_cancelled_is(Evas_Preload_Pthread *thread);
Eina_Bool evas_preload_pthread_wait(Evas_Preload_Pthread *work, double wait);

void _evas_walk(Evas_Public_Data *e_pd);
void _evas_unwalk(Evas_Public_Data *e_pd);

EAPI void evas_module_task_register(Eina_Bool (*cancelled)(void *data), void *data);
EAPI void evas_module_task_unregister(void);

// expose for use in engines
EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name);
EAPI const char *_evas_module_libdir_get(void);
const char *_evas_module_datadir_get(void);
EAPI Eina_List *_evas_canvas_image_data_unset(Evas *eo_e);
EAPI void _evas_canvas_image_data_regenerate(Eina_List *list);

Eina_Bool evas_render_mapped(Evas_Public_Data *e, Evas_Object *obj,
                             Evas_Object_Protected_Data *source_pd,
                             void *context, void *surface, int off_x, int off_y,
                             int mapped, int ecx, int ecy, int ecw, int ech,
                             Evas_Proxy_Render_Data *proxy_render_data,
                             int level, Eina_Bool do_async);
void evas_render_invalidate(Evas *e);
void evas_render_object_recalc(Evas_Object *obj);
void evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas_Object_Protected_Data *proxy_obj, Eina_Rectangle region, Eina_Bool source_clip, Eina_Bool do_async);
void evas_render_mask_subrender(Evas_Public_Data *e, Evas_Object_Protected_Data *mask, Evas_Object_Protected_Data *prev_mask, int level, Eina_Bool do_async);

Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
Eina_Bool evas_map_coords_get(const Evas_Map *m, double x, double y, double *mx, double *my, int grab);
Eina_Bool evas_object_map_update(Evas_Object *obj, int x, int y, int imagew, int imageh, int uvw, int uvh);
void evas_map_object_move_diff_set(Evas_Map *m, Evas_Coord diff_x, Evas_Coord diff_y);

Eina_List *evas_module_engine_list(void);

/* for updating touch point list */
void _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y);
void _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state);
void _evas_touch_point_remove(Evas *e, int id);

void _evas_device_cleanup(Evas *e);
Evas_Device *_evas_device_top_get(const Evas *e);

/* legacy/eo events */
void *efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Callback_Type type, Evas_Event_Flags **pflags);
void *efl_input_key_legacy_info_fill(Efl_Input_Key *evt, Evas_Event_Flags **pflags);
void *efl_input_hold_legacy_info_fill(Efl_Input_Hold *evt, Evas_Event_Flags **pflags);

Eina_Bool evas_vg_loader_svg(Evas_Object *vg, const Eina_File *f, const char *key EINA_UNUSED);

void *_evas_object_image_surface_get(Evas_Object *eo, Evas_Object_Protected_Data *obj);
Eina_Bool _evas_image_proxy_source_clip_get(const Eo *eo_obj);

void _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj,
                                Efl_Input_Device *seat, Eina_Bool in);
Evas_Pointer_Data *_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer);
Eina_Bool _evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer);
void _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer);
Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata,
                                         Evas_Object *obj,
                                         Evas_Object_Protected_Data *obj_data,
                                         int w, int h);

extern Eina_Cow *evas_object_proxy_cow;
extern Eina_Cow *evas_object_map_cow;
extern Eina_Cow *evas_object_state_cow;

extern Eina_Cow *evas_object_3d_cow;

extern Eina_Cow *evas_object_image_pixels_cow;
extern Eina_Cow *evas_object_image_load_opts_cow;
extern Eina_Cow *evas_object_image_state_cow;

extern Eina_Cow *evas_object_filter_cow;
// This should be replaced by something like "eina_cow_default_get()" maybe
extern const void * const evas_object_filter_cow_default;
extern Eina_Cow *evas_object_mask_cow;

# define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State)          \
  EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \
                       Evas_Object_Protected_State, Write)

# define EINA_COW_STATE_WRITE_END(Obj, Write, State)                    \
    eina_cow_done(evas_object_state_cow, ((const Eina_Cow_Data**)&(Obj->State)), \
		  Write, EINA_FALSE);					\
   }									\
  while (0);

/****************************************************************************/
/*****************************************/
/********************/
#define MPOOL 1

#ifdef MPOOL
typedef struct _Evas_Mempool Evas_Mempool;

struct _Evas_Mempool
{
  int           count;
  int           num_allocs;
  int           num_frees;
  Eina_Mempool *mp;
};
# define EVAS_MEMPOOL(x) \
   static Evas_Mempool x = {0, 0, 0, NULL}
# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \
   do { \
     if (!x.mp) { \
       const char *tmp, *choice = "chained_mempool"; \
       tmp = getenv("EINA_MEMPOOL"); \
       if (tmp && tmp[0]) choice = tmp; \
       x.mp = eina_mempool_add(choice, nam, NULL, sizeof(siz), cnt); \
       if (!x.mp) { \
         return ret; \
       } \
     } \
   } while (0)
# define EVAS_MEMPOOL_ALLOC(x, siz) \
   eina_mempool_malloc(x.mp, sizeof(siz))
# define EVAS_MEMPOOL_PREP(x, p, siz) \
   do { \
     x.count++; \
     x.num_allocs++; \
     memset(p, 0, sizeof(siz)); \
   } while (0)
# define EVAS_MEMPOOL_FREE(x, p) \
   do { \
     eina_mempool_free(x.mp, p); \
     x.count--; \
     x.num_frees++; \
     if (x.count <= 0) { \
       eina_mempool_del(x.mp); \
       x.mp = NULL; \
       x.count = 0; \
     } \
   } while (0)
#else
# define EVAS_MEMPOOL(x)
# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret)
# define EVAS_MEMPOOL_PREP(x, p, siz)
# define EVAS_MEMPOOL_ALLOC(x, siz) \
   calloc(1, sizeof(siz))
# define EVAS_MEMPOOL_FREE(x, p) \
   free(p)
#endif
/********************/
/*****************************************/
/****************************************************************************/

#define EVAS_API_OVERRIDE(func, api, prefix) \
     (api)->func = prefix##func
#define EVAS_API_RESET(func, api) \
     (api)->func = NULL

static inline Efl_Gfx_Render_Op
_evas_to_gfx_render_op(Evas_Render_Op rop)
{
   if (rop == EVAS_RENDER_COPY)
     return EFL_GFX_RENDER_OP_COPY;
   return EFL_GFX_RENDER_OP_BLEND;
}

static inline Evas_Render_Op
_gfx_to_evas_render_op(Efl_Gfx_Render_Op rop)
{
   if (rop == EFL_GFX_RENDER_OP_COPY)
     return EVAS_RENDER_COPY;
   return EVAS_RENDER_BLEND;
}

#include "evas_inline.x"

#ifdef __cplusplus
}
#endif
#endif