Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-08-22 14:29:02 +09:00
commit 6b1bd2d334
138 changed files with 5290 additions and 2527 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,829 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
<svg version="1.1" baseProfile="basic" id="svg2" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="900px" height="900px"
viewBox="0 0 900 900" xml:space="preserve">
<path id="path482" fill="none" d="M184.013,144.428"/>
<path id="path6" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M108.956,403.826c0,0,0.178,3.344-1.276,3.311
c-1.455-0.033-30.507-84.917-66.752-80.957C40.928,326.18,72.326,313.197,108.956,403.826z"/>
<path id="path10" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M115.189,398.488c0,0-0.97,3.207-2.327,2.679
c-1.356-0.526,0.203-90.231-35.227-98.837C77.635,302.33,111.576,300.804,115.189,398.488z"/>
<path id="path14" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M163.727,473.225c0,0,2.888,1.695,2.059,2.892
c-0.832,1.194-87.655-21.408-104.35,11.003C61.436,487.118,67.931,453.771,163.727,473.225z"/>
<path id="path18" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M158.767,491.254c0,0,3.277,0.699,2.864,2.096
c-0.411,1.396-89.935,7.298-95.567,43.318C66.063,536.668,61.723,502.971,158.767,491.254z"/>
<path id="path22" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M151.332,481.498c0,0,3.139,1.171,2.528,2.492
c-0.611,1.319-90.037-5.899-100.864,28.915C52.996,512.905,53.617,478.938,151.332,481.498z"/>
<path id="path26" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M132.43,449.356c0,0,2.31,2.427,1.181,3.347
c-1.128,0.919-78.363-44.729-103.341-18.171C30.27,434.532,45.704,404.264,132.43,449.356z"/>
<path id="path30" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M119.108,456.757c0,0,2.571,2.148,1.554,3.192
c-1.017,1.041-82.921-35.576-104.734-6.36C15.928,453.589,27.837,421.769,119.108,456.757z"/>
<path id="path34" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M114.518,463.946c0,0,2.839,1.778,1.974,2.95
c-0.865,1.171-86.997-23.942-104.623,7.974C11.869,474.87,19.329,441.724,114.518,463.946z"/>
<path id="path38" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M133.47,465.03c0,0,1.981,2.703,0.743,3.472
c-1.237,0.768-71.985-54.405-100.161-31.267C34.052,437.235,53.236,409.195,133.47,465.03z"/>
<path id="path42" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M98.546,413.917c0,0,1.06,3.178-0.353,3.531
c-1.413,0.353-51.91-73.804-85.812-60.385C12.381,357.063,39.22,336.229,98.546,413.917z"/>
<path id="path46" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M99.773,426.239c0,0,1.722,2.876,0.417,3.523
c-1.303,0.649-66.605-60.873-96.813-40.458C3.376,389.306,25.088,363.174,99.773,426.239z"/>
<path id="path50" fill="#FFFFFF" stroke="#000000" stroke-width="0.172" d="M99.57,433.955c0,0,1.981,2.703,0.744,3.472
c-1.238,0.767-71.985-54.405-100.162-31.267C0.152,406.16,19.335,378.12,99.57,433.955z"/>
<path id="path54" fill="#FFFFFF" stroke="#000000" d="M95.668,436.985c0.888,10.678,2.632,22.275,5.703,27.783
c0,0-6.356,21.895,9.181,45.2c0,0-0.707,12.712,2.119,18.362c0,0,7.063,14.832,15.538,16.244c6.858,1.143,22.26,6.561,39.67,9.04
c0,0,30.249,24.859,24.599,47.461c0,0-0.706,28.956-7.063,31.781c0,0,20.481-19.775,3.531,9.888l-7.769,33.192
c0,0,45.201-38.138,17.657-5.648l-17.657,45.906c0,0,34.607-32.487,21.894-17.656l-5.65,15.538c0,0,76.276-48.025,21.894,4.237
c0,0,14.125-6.356,21.894-1.412c0,0,12.006-2.119,10.594,0.706c0,0-36.726,18.361-43.082,50.851c0,0,14.831-17.657,9.181,1.412
l0.706,20.48c0,0,7.063-38.138,6.356,28.25c0,0,33.9-31.78,13.419,4.944v29.662c0,0,26.838-28.956,15.538-6.354
c0,0,17.656-15.538,10.594,11.3c0,0-1.413,18.361,6.356-1.412c0,0,28.25-54.029,17.656-7.771c0,0-1.412,33.9,7.063,7.771
c0,0,0.706,18.362,16.95,31.075c0,0-2.119-89.695,20.48-26.133l7.063,28.957c0,0,4.943-16.244,4.237-25.426
c0,0,26.132-28.957,14.125,14.125c0,0,26.838-40.257,21.188-16.95c0,0-13.419,28.251-10.594,36.727c0,0,29.663-61.444,31.782-64.271
c0,0-3.531,74.865,15.537,11.3c0,0,9.888,21.188,4.943,28.957c0,0,14.125-14.125,12.712-19.774c0,0,8.122-14.479,13.066,9.534
c0,0,3.178,16.598,6.003,10.946c0,0,7.063,42.377,9.182,2.119c0,0,2.825-24.013-9.888-44.494c0,0,1.412-5.649-3.531-12.713
c0,0,24.014,38.139,11.3-12.713c0,0,19.777,14.125,21.896,14.125c0,0-24.015-40.963-8.477-32.487c0,0-9.183-18.362,22.602,2.825
c0,0-28.252-28.251,2.825-11.301c0,0,14.125,11.301,0.706-6.356c0,0-25.428-28.25,13.419,3.532c0,0,20.48,28.956,21.895,33.9
c0,0-17.655-51.559-25.426-56.501c0,0,14.832-64.271,87.576-36.727c0,0,12.007,30.369,19.774-2.118c0,0,22.602-11.301,42.375,37.432
c0,0,7.063-24.013,5.65-28.956c0,0,12.007,2.119,10.594,0c0,0,23.308,7.769,25.427,6.356c0,0,12.006,12.006,12.712,5.648
c0,0,16.244,4.944,12.713-1.412c0,0,15.538,27.544,16.244,33.9l4.236-24.719l3.531,4.942c0,0,2.825-13.419,1.413-15.537
c-1.413-2.119,35.313,12.006,43.787,48.731l3.531,14.831c0,0,10.594-26.131,7.77-33.193c0,0,9.181,1.412,9.888,9.181
c0,0,7.063-40.963-1.412-51.557c0,0,7.769-1.412,9.888,4.944V714.78c0,0,12.713,1.411,12.713-2.825c0,0,7.769-7.063,11.3,1.412
c0,0-21.894-62.15,10.594-28.25c0,0,12.714,19.068,6.356-14.125c-6.357-33.194-13.419-36.021-4.943-36.727
c0,0,1.412-6.355-2.118-9.181c-3.531-2.825,2.118,0,2.118,0s8.476,7.063-0.707-31.782c0,0,11.302,2.825-9.888-48.73
c0,0,4.944-4.237-2.118-19.069c0,0,14.125,7.77,19.069,4.944c0,0-0.707-2.825-6.356-9.889c0,0-38.139-96.759-2.118-57.913
c0,0,20.923,23.925,9.623-16.332c0,0-16.088-42.394-14.716-49.979L95.668,436.985z"/>
<path id="path58" fill="#CC7226" stroke="#000000" d="M854.095,396.693c1.108,0.32,5.004,2.304,7.211,5.217
c0,0,12.006,19.068,2.825-13.418c0,0-16.244-50.851-0.707-31.076c0,0,10.594,12.713,4.944-11.3
c-6.824-29.004-11.301-40.257-11.301-40.257s20.48,8.475-26.837-61.444l15.536,6.356c0,0-34.605-69.919-72.743-79.101
l-14.125-10.594c0,0,67.8-67.094,45.199-132.07c0,0-12.007-9.182-28.957,7.063c0,0-11.3,8.475-21.894,5.65
c0,0-54.382,2.119-57.913,2.119S630.359-21.844,514.533,9.231c0,0-9.183,3.531-16.95,1.413c0,0-32.489-28.25-118.653,12.006
c0,0-17.655,3.531-20.48,3.531s-7.77,0-21.895,11.3c-14.125,11.3-14.832,12.712-18.362,15.538c0,0-28.957,19.775-37.432,21.188
c0,0-20.481,11.3-28.25,28.957l-6.356,2.119c0,0-2.825,12.713-3.532,14.832c0,0-8.475,6.356-9.887,16.244
c0,0-15.538,10.594-14.832,18.362c0,0-2.825,9.182-4.238,17.657c0,0-12.712,8.475-11.3,13.419c0,0-13.419,24.719-11.3,36.725
c0,0-11.3-0.706-16.244,3.531c0,0-1.413,8.475-4.238,9.182c0,0-4.944,2.119-0.706,9.181c0,0-2.825,4.944-3.531,7.769
c0,0,1.412,4.944-6.356,14.831c0,0-11.3,33.194-7.769,42.375c0,0,0.707,8.475-4.237,11.3c0,0-6.356-0.707,8.475,20.481
c0,0,1.413,2.119-4.238,6.356c0,0-30.369,6.356-34.606,35.313c0,0-24.013,26.131-24.013,35.313c0,4.069,0.479,9.626,1.713,17.771
c0,0-1.007,14.718,47.725,16.131C191.772,453.469,854.095,396.693,854.095,396.693z"/>
<path id="path62" fill="#CC7226" d="M120.793,436.164c-44.141-69.566-18.716,30.018-18.716,30.018
c15.538,60.738,244.365-5.649,244.365-5.649s298.042-53.677,317.816-60.739c19.775-7.063,187.864,4.237,187.864,4.237l-9.888-29.663
c-114.414-81.926-148.314-40.963-172.327-48.025c-24.013-7.062-19.774,9.888-25.425,11.3c-5.651,1.412-74.863-42.375-86.163-40.963
c-11.301,1.413-56.045-40.523-29.663,15.538c28.25,60.032-103.115,69.213-132.778,49.438
c-29.663-19.775,12.713,32.488,12.713,32.488c32.487,35.313-28.25,5.65-28.25,5.65c-60.737-22.601-103.114,22.6-108.764,24.013
c-5.65,1.412-14.125,7.063-15.538-4.237c-1.412-11.301-14.672-40.789-70.625,5.649c-35.313,29.313-59.679-9.534-59.679-9.534
L120.793,436.164z"/>
<path id="path66" fill="#E87F3A" d="M560.632,299.761c-11.3,1.413-56.089-40.502-29.662,15.538
c29.311,62.151-103.113,69.213-132.775,49.438c-29.665-19.775,12.712,32.488,12.712,32.488c32.488,35.313-28.252,5.649-28.252,5.649
c-60.737-22.6-103.113,22.601-108.763,24.013c-5.65,1.413-14.125,7.063-15.538-4.236c-1.413-11.301-14.441-40.494-70.626,5.649
c-37.495,30.627-61.315-7.255-61.315-7.255l-5.65,17.849c-44.141-70.271-17.529,32.682-17.529,32.682
c15.54,60.739,245.521-7.962,245.521-7.962s298.043-53.676,317.817-60.738c19.774-7.062,186.325,4.109,186.325,4.109l-9.762-30.563
c-114.413-81.926-146.9-39.935-170.914-46.998c-24.013-7.063-19.774,9.888-25.425,11.3
C641.146,342.136,571.933,298.349,560.632,299.761z"/>
<path id="path70" fill="#EA8C4D" d="M562.943,302.842c-11.301,1.413-54.973-41.014-29.663,15.538
c28.604,63.918-103.113,69.215-132.776,49.44c-29.662-19.775,12.713,32.488,12.713,32.488c32.488,35.313-28.25,5.649-28.25,5.649
c-60.738-22.6-103.115,22.601-108.766,24.013c-5.65,1.413-14.125,7.063-15.538-4.236c-1.413-11.301-14.21-40.198-70.625,5.649
c-39.68,31.942-62.952-4.976-62.952-4.976l-6.356,15.216c-42.022-68.86-16.341,35.345-16.341,35.345
c15.538,60.738,246.678-10.271,246.678-10.271s298.04-53.677,317.814-60.738c19.775-7.063,184.783,3.979,184.783,3.979l-9.63-31.46
c-114.415-81.926-145.49-38.909-169.503-45.972c-24.014-7.063-19.775,9.888-25.427,11.302
C643.457,345.219,574.243,301.429,562.943,302.842z"/>
<path id="path74" fill="#EC9961" d="M565.255,305.925c-11.301,1.413-54.963-41.02-29.663,15.538
c29.663,66.311-104.057,68.586-132.775,49.438c-29.663-19.775,12.713,32.488,12.713,32.488c32.486,35.313-28.25,5.649-28.25,5.649
c-60.738-22.6-103.114,22.601-108.764,24.013c-5.65,1.413-14.125,7.063-15.538-4.236c-1.413-11.301-13.979-39.9-70.627,5.649
c-41.862,33.259-64.591-2.696-64.591-2.696l-7.063,12.584c-38.491-64.976-15.151,38.012-15.151,38.012
c15.538,60.736,247.833-12.586,247.833-12.586s298.04-53.677,317.817-60.738c19.773-7.063,183.24,3.853,183.24,3.853l-9.502-32.358
c-114.414-81.928-144.076-37.882-168.09-44.945c-24.015-7.063-19.775,9.888-25.427,11.3
C645.766,348.301,576.555,304.512,565.255,305.925z"/>
<path id="path78" fill="#EEA575" d="M567.567,309.008c-11.303,1.412-54.07-41.412-29.664,15.538
c29.664,69.213-103.114,69.213-132.776,49.438c-29.663-19.775,12.713,32.487,12.713,32.487c32.487,35.313-28.251,5.65-28.251,5.65
c-60.738-22.6-103.113,22.601-108.763,24.013c-5.65,1.412-14.125,7.063-15.538-4.237s-13.746-39.604-70.626,5.649
c-44.046,34.575-66.229-0.418-66.229-0.418l-7.769,9.953c-34.96-61.446-13.964,40.673-13.964,40.673
c15.538,60.74,248.989-14.895,248.989-14.895s298.043-53.677,317.816-60.738c19.775-7.063,181.701,3.724,181.701,3.724
l-9.374-33.259c-114.414-81.926-142.664-36.853-166.677-43.915c-24.014-7.062-19.775,9.888-25.426,11.3
C648.081,351.383,578.868,307.595,567.567,309.008z"/>
<path id="path82" fill="#F1B288" d="M569.879,312.089c-11.3,1.412-57.144-39.994-29.663,15.538
c33.9,68.507-103.115,69.213-132.778,49.438c-29.661-19.775,12.714,32.487,12.714,32.487c32.487,35.313-28.25,5.65-28.25,5.65
c-60.738-22.6-103.114,22.601-108.764,24.013c-5.65,1.412-14.125,7.063-15.538-4.237c-1.413-11.3-13.514-39.309-70.626,5.649
c-46.228,35.893-67.866,1.863-67.866,1.863l-8.475,7.317c-31.782-58.619-12.776,43.341-12.776,43.341
C123.394,553.887,358,475.94,358,475.94s298.042-53.677,317.817-60.738c19.774-7.063,180.158,3.595,180.158,3.595l-9.244-34.156
c-114.413-81.926-141.251-35.827-165.265-42.889c-24.013-7.062-19.774,9.888-25.426,11.3
C650.393,354.464,581.179,310.676,569.879,312.089z"/>
<path id="path86" fill="#F3BF9C" d="M572.19,315.169c-11.303,1.413-57.813-39.656-29.665,15.538
c36.021,70.627-103.113,69.214-132.776,49.439s12.713,32.488,12.713,32.488c32.487,35.313-28.25,5.65-28.25,5.65
c-60.738-22.601-103.114,22.6-108.764,24.013c-5.65,1.412-14.125,7.063-15.538-4.237c-1.412-11.301-13.283-39.014-70.625,5.649
c-48.412,37.208-69.503,4.141-69.503,4.141l-9.181,4.688c-28.25-53.322-11.59,46.004-11.59,46.004
c15.538,60.738,251.301-19.519,251.301-19.519s298.041-53.677,317.816-60.738c19.775-7.063,178.619,3.466,178.619,3.466
l-9.117-35.055c-114.414-81.926-139.84-34.799-163.853-41.862c-24.014-7.064-19.774,9.888-25.425,11.3
C652.702,357.546,583.49,313.757,572.19,315.169z"/>
<path id="path90" fill="#F5CCB0" d="M574.501,318.252c-11.3,1.413-59.753-38.624-29.662,15.538
c38.844,69.92-103.115,69.213-132.778,49.438c-29.662-19.775,12.714,32.488,12.714,32.488c32.486,35.313-28.251,5.65-28.251,5.65
c-60.737-22.602-103.113,22.6-108.764,24.013c-5.65,1.412-14.125,7.063-15.538-4.237c-1.413-11.301-13.05-38.716-70.626,5.649
c-50.594,38.524-71.14,6.422-71.14,6.422l-9.887,2.054c-25.427-50.145-10.401,48.668-10.401,48.668
c15.538,60.74,252.455-21.829,252.455-21.829s298.043-53.677,317.816-60.738c19.775-7.063,177.078,3.339,177.078,3.339
l-8.987-35.956c-114.414-81.926-138.428-33.771-162.439-40.834c-24.013-7.063-19.774,9.888-25.425,11.3
C655.015,360.628,585.802,316.84,574.501,318.252z"/>
<path id="path94" fill="#F8D8C4" d="M576.813,321.335c-11.3,1.413-59.753-38.625-29.662,15.538
c38.845,69.919-103.113,69.213-132.776,49.438c-29.662-19.775,12.713,32.488,12.713,32.488c32.488,35.313-28.25,5.65-28.25,5.65
c-60.74-22.602-103.115,22.6-108.766,24.013c-5.65,1.412-14.125,7.063-15.538-4.238c-1.413-11.3-12.817-38.42-70.625,5.65
c-52.777,39.84-72.776,8.701-72.776,8.701l-10.594-0.579c-24.015-46.615-9.213,51.332-9.213,51.332
c15.538,60.738,253.609-24.143,253.609-24.143s298.042-53.675,317.817-60.736c19.775-7.063,175.538,3.21,175.538,3.21l-8.859-36.854
c-114.416-81.926-137.016-32.744-161.027-39.807c-24.013-7.063-19.775,9.888-25.427,11.3
C657.326,363.711,588.112,319.923,576.813,321.335z"/>
<path id="path98" fill="#FAE5D7" d="M579.124,324.417c-11.301,1.413-59.068-38.998-29.663,15.538
c38.844,72.038-103.113,69.213-132.776,49.438c-29.662-19.775,12.714,32.488,12.714,32.488c32.486,35.313-28.251,5.65-28.251,5.65
c-60.737-22.602-103.113,22.6-108.764,24.013c-5.652,1.412-14.127,7.063-15.54-4.238c-1.412-11.3-12.585-38.123-70.625,5.65
c-54.959,41.157-74.413,10.979-74.413,10.979l-11.302-3.212c-22.954-42.375-8.025,53.999-8.025,53.999
c15.538,60.738,254.769-26.455,254.769-26.455s298.04-53.675,317.814-60.736c19.775-7.063,173.997,3.082,173.997,3.082
l-8.732-37.752c-114.413-81.928-135.602-31.718-159.613-38.781c-24.014-7.063-19.774,9.888-25.426,11.3
S590.424,323.004,579.124,324.417z"/>
<path id="path102" fill="#FCF2EB" d="M581.435,327.498c-11.3,1.412-57.161-39.981-29.661,15.538
c37.432,75.571-103.114,69.215-132.776,49.439c-29.663-19.775,12.713,32.488,12.713,32.488c32.487,35.313-28.251,5.649-28.251,5.649
c-60.738-22.601-103.113,22.601-108.763,24.013c-5.65,1.413-14.125,7.063-15.538-4.237c-1.413-11.3-12.354-37.827-70.626,5.65
c-57.145,42.473-76.053,13.258-76.053,13.258l-12.006-5.842c-22.6-40.964-6.836,56.661-6.836,56.661
c15.538,60.736,255.921-28.766,255.921-28.766s298.043-53.676,317.817-60.737c19.775-7.063,172.454,2.951,172.454,2.951
l-8.604-38.65c-114.415-81.926-134.188-30.688-158.2-37.751c-24.014-7.064-19.775,9.887-25.426,11.3
C661.948,369.875,592.735,326.085,581.435,327.498z"/>
<path id="path106" fill="#FFFFFF" d="M120.44,466.182c-22.601-38.846-5.65,59.325-5.65,59.325
c15.538,60.738,257.078-31.075,257.078-31.075s298.042-53.677,317.816-60.738c19.775-7.063,170.914,2.823,170.914,2.823
l-8.475-39.55c-114.414-81.926-132.776-29.663-156.789-36.726c-24.013-7.063-19.775,9.888-25.426,11.3
c-5.649,1.413-74.862-42.375-86.163-40.963c-11.3,1.412-55.829-40.623-29.663,15.538c39.245,84.232-107.28,66.436-132.777,49.438
c-29.663-19.775,12.712,32.488,12.712,32.488c32.488,35.313-28.25,5.65-28.25,5.65c-60.737-22.602-103.113,22.602-108.764,24.014
c-5.65,1.413-14.125,7.063-15.538-4.237c-1.413-11.302-12.121-37.532-70.625,5.65c-59.326,43.788-77.688,15.537-77.688,15.537
L120.44,466.182z"/>
<path id="path110" d="M193.891,519.15c0,0-12.713,20.48,24.013,43.788c0,0,2.472,2.473-29.31-4.943c0,0-10.947-3.531-13.771-21.896
c0,0-8.475-7.769-16.95-17.655C149.397,508.557,193.891,519.15,193.891,519.15z"/>
<path id="path114" fill="#CCCCCC" d="M441.08,435.104c0,0,31.249,47.356,30.193,55.797c-2.297,18.362-2.648,35.313,3.001,42.376
c5.651,7.063,21.188,65.682,21.188,65.682s-0.706,2.119,21.188-64.976c0,0,20.48-28.25-14.831-60.738
C501.82,473.244,439.668,422.392,441.08,435.104z"/>
<path id="path118" d="M229.204,566.47c0,0,19.775,12.713-5.65,67.802l11.3-4.237c0,0-1.413,19.774-7.063,24.013l12.712-5.65
c0,0,8.475,14.127,1.413,22.602c0,0,29.663,14.125,28.25,25.425c0,0,11.3-14.125,4.237-25.425s-19.775-4.237-18.363-36.727
l-15.538,5.65c0,0,9.888-15.538,9.888-26.838l-14.125,4.237c0,0,27.313-46.928,8.475-49.438
C234.147,566.47,229.204,566.47,229.204,566.47z"/>
<path id="path122" fill="#CCCCCC" d="M286.41,596.133c0,0,4.944-7.769,0-6.355c-4.944,1.413-60.032,27.544-70.625,44.494
C215.785,634.271,276.522,591.189,286.41,596.133z"/>
<path id="path126" fill="#CCCCCC" d="M304.773,610.258c0,0,4.944-7.769,0-6.355s-60.032,27.544-70.625,44.494
C234.147,648.396,294.885,605.314,304.773,610.258z"/>
<path id="path130" fill="#CCCCCC" d="M328.079,583.42c0,0,4.944-7.769,0-6.355c-4.943,1.412-60.032,27.545-70.625,44.494
C257.454,621.559,318.191,578.477,328.079,583.42z"/>
<path id="path134" fill="#CCCCCC" d="M287.117,660.402c0,0,0-10.595-4.944-9.183c-4.944,1.413-68.507,32.488-79.101,49.438
C203.072,700.659,277.229,655.458,287.117,660.402z"/>
<path id="path138" fill="#CCCCCC" d="M289.235,641.333c0,0,2.119-8.475-2.825-7.063c-3.531,0-50.144,20.481-60.738,37.433
C225.672,671.702,277.935,633.564,289.235,641.333z"/>
<path id="path142" fill="#CCCCCC" d="M263.81,725.378l-17.656,13.419c0,0,18.362-13.419,24.719-11.3
c0,0-12.006,19.774-13.419,28.956c0,0,18.363-22.602,28.25-21.895c0,0,13.419,0.706,13.419,19.774c0,0,9.888-18.362,15.537-17.656
c0,0,2.119,11.302,0,23.308c0,0,7.063-13.419,14.125-10.595c0,0,11.301-3.53,9.888,16.95c0,0,0,18.362-1.412,23.308
c0,0,9.889-46.613,14.125-47.319c0,0,14.125-2.119,22.602,13.419c0,0-7.063-13.419,1.412-9.888c0,0,19.068,2.824,24.719,14.831
c0,0-12.006-21.188-2.118-15.537c0,0,12.006,0,14.125,11.3c0,0,14.831,37.432,18.362,40.257c0,0-13.419-38.138-10.595-38.138
c0,0-3.53-21.188,5.65,4.942c0,0-5.65-24.719,4.237-23.307c9.888,1.413,17.655,19.069,32.487,14.832
c0,0,16.952,9.888,20.483-112.295L263.81,725.378z"/>
<path id="path146" d="M272.285,561.526c0,0,26.131-10.595,96.757,0c0,0,12.713,0.706,24.72-14.831
c12.006-15.538,59.325-28.251,70.625-24.721l16.952,11.302l1.413,2.118c0,0,21.895,18.362,22.6,31.781
c0.706,13.418-25.425,98.169-42.377,126.42c-16.949,28.25-33.899,50.145-67.801,45.906c0,0-36.726-7.063-81.926,0
c0,0-51.557-2.825-56.5-16.95s19.775-40.963,19.775-40.963s7.769-14.831,5.65-40.257C280.054,615.908,280.76,566.47,272.285,561.526
z"/>
<path id="path150" fill="#E5668C" d="M311.129,565.058c14.832,32.487-37.431,147.607-37.431,147.607
c-3.531,2.825,22.353,13.499,40.256,9.182c19.327-4.657,90.401,2.825,90.401,2.825c41.669-27.544,64.27-105.938,64.27-105.938
s18.364-42.376-12.713-48.025C424.837,565.058,311.129,565.058,311.129,565.058z"/>
<path id="path154" fill="#B23259" d="M307.543,619.608c5.873-22.582,8.67-43.419,3.586-54.552c0,0,110.177,11.301,129.951-25.426
c7.488-13.904,33.55,40.257,32.842,57.207c0,0-111.236,25.426-137.367,5.65L307.543,619.608z"/>
<path id="path158" fill="#A5264C" d="M315.367,648.396c0,0,3.531,12.713-0.707,19.774c0,0-2.824,1.413-4.943,2.119
c0,0,2.119,6.356,12.713,9.182c0,0,3.531,7.77,7.77,8.476s12.713,10.594,19.774,8.475c7.063-2.118,26.839-9.181,26.839-9.181
s9.888-5.65,25.425,0.706c0,0,4.192-1.416,4.942-8.476c0.884-8.299,6.356-14.832,9.889-18.362
c3.531-3.531,20.48-26.133,18.362-26.838C433.313,633.564,315.367,648.396,315.367,648.396z"/>
<path id="path162" fill="#FF727F" stroke="#000000" d="M307.598,562.938c0,0-4.943,39.552,0.707,54.383
c5.649,14.832,4.237,18.362,2.824,25.426c-1.412,7.063,6.356,24.719,16.244,35.313l21.188,2.825c0,0,26.839-6.355,43.082-1.412
c0,0,15.881,2.371,21.895-24.014c0,0,8.476-11.3,21.188-16.243c12.713-4.943,25.426-78.395,18.362-92.52
c-7.063-14.126-32.488-21.896-60.738,5.648S360.567,550.227,307.598,562.938z"/>
<path id="path166" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M310.423,695.009c0,0-1.412-3.531-9.181-4.237
c0,0-39.55-6.355-54.382-28.25c0,0-12.006-9.888-4.238,10.595c0,0,18.363,36.019,30.369,40.963
C272.991,714.078,301.948,721.141,310.423,695.009z"/>
<path id="path170" fill="#CC3F4C" d="M451.572,582.058c1.163-13.96,4.61-29.169,1.515-35.361
c-11.382-22.768-41.35-13.253-60.738,5.648c-28.25,27.544-31.78-2.118-84.751,10.595c0,0-3.081,24.653-1.598,42.332
c0,0,65.867-20.438,67.28-10.551c0,0,2.823-5.649,19.067-5.649S448.747,587.001,451.572,582.058z"/>
<path id="path174" stroke="#A51926" stroke-width="2" d="M375.398,564.352c0,0,8.476,8.476,2.118,25.426
c0,0-25.426,28.25-21.895,52.97"/>
<path id="path178" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M290.648,714.078c0,0-7.769-22.602,7.769-10.594
c0,0,8.475,3.53,6.356,6.354C302.654,712.665,292.767,719.729,290.648,714.078z"/>
<path id="path182" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M299.547,716.196c0,0-6.215-18.08,6.215-8.476
c0,0,7.806,4.322,5.084,5.085C302.795,715.066,310.847,719.587,299.547,716.196z"/>
<path id="path186" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M308.021,716.196c0,0-6.215-18.08,6.215-8.476
c0,0,7.725,4.078,5.086,5.085C313.39,715.066,319.322,719.587,308.021,716.196z"/>
<path id="path190" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M319.675,716.55c0,0-6.215-18.08,6.215-8.476
c0,0,7.739,4.118,5.087,5.085C325.749,715.066,330.977,719.939,319.675,716.55z"/>
<path id="path194" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M331.116,716.408c0,0-6.215-18.08,6.217-8.476
c0,0,6.78,2.825,5.085,5.085C340.723,715.278,342.418,719.799,331.116,716.408z"/>
<path id="path198" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M342.911,717.609c0,0-8.477-21.896,7.769-10.595
c0,0,8.476,3.531,6.356,6.355C354.917,716.196,357.036,721.847,342.911,717.609z"/>
<path id="path202" stroke="#A5264C" stroke-width="2" d="M292.767,687.24c0,0,23.307-4.944,33.9,0.706
c0,0,10.594,2.119,12.713,1.412c2.118-0.706,7.77-1.412,7.77-1.412"/>
<path id="path206" stroke="#A5264C" stroke-width="2" d="M352.799,702.777c0,0,21.188-24.014,42.375-16.243
c12.389,4.543,10.594-1.413,12.006-6.356c1.413-4.943,1.768-12.358,10.596-17.656"/>
<path id="path210" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M383.168,674.527c0,0-7.063-19.069-12.007,3.53
c-4.944,22.602-10.594,28.957-13.419,33.9c0,0,0,9.182,14.831,8.476c0,0,19.068-0.707,19.774-5.649
C393.055,709.84,390.23,689.358,383.168,674.527z"/>
<path id="path214" stroke="#A5264C" stroke-width="2" d="M407.887,687.24c0,0,6.356-4.237,10.594-2.119"/>
<path id="path218" stroke="#A5264C" stroke-width="2" d="M419.363,658.283c0,0,5.12-8.651,13.596-10.063"/>
<path id="path222" fill="#B2B2B2" d="M279.348,723.259c0,0,31.781,5.65,39.551,2.825c0,0,15.536,0,0.706,3.531
c0,0-22.602,0-36.727-2.118C282.879,727.497,262.397,717.609,279.348,723.259z"/>
<path id="path226" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M304.066,558.701c0,0,31.075,0,34.606,1.412
c0,0,12.713,54.382,6.356,67.801c0,0-2.118,4.944-7.063-4.943c0,0-32.488-57.913-38.138-61.443
C294.177,557.996,301.948,558.701,304.066,558.701z"/>
<path id="path230" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M167.936,553.934c0,0,15.714,3.002,37.961,7.594
c0,0,8.475,39.551,14.125,48.024c5.65,8.475-0.706,8.476-7.063,3.531s-32.488-29.663-36.019-37.432
C173.409,567.882,167.936,553.934,167.936,553.934z"/>
<path id="path234" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M206.534,561.909c0,0,10.241,2.732,12.022,6.645
c1.78,3.909-2.123,9.73-2.123,9.73s-1.766,5.835-3.888,2.018C210.424,576.483,205.353,562.958,206.534,561.909z"/>
<path id="path238" d="M206.603,561.526c0,0,6.356,9.182,12.713,9.182c6.356,0,7.031-0.729,12.006,0.353
c8.122,1.767,7.416-1.766,19.069,0.354c4.661,0.848,9.181-0.706,14.125,1.412c4.944,2.119,10.594,0.706,12.713-2.825
s10.594-10.946,10.594-10.946s-22.6,3.179-27.544,4.591C260.279,563.645,220.729,565.764,206.603,561.526z"/>
<path id="path242" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M285.351,561.879c0,0-11.389,6.182-12.095,10.418
c-0.707,4.237,9.27,10.771,9.27,10.771s4.855,8.122,5.915,3.884C289.5,582.714,286.763,562.586,285.351,561.879z"/>
<path id="path246" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M219.166,571.527c0,0,12.372,19.754,12.755-0.041
c0,0,0.983-2.223-2.124-2.261C219.07,569.092,221.756,561.85,219.166,571.527z"/>
<path id="path250" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M231.839,571.967c0,0,13.986,19.752,12.863-0.164
c0,0,0.012-0.587-3.083-0.855C233.238,570.215,233.847,562.238,231.839,571.967z"/>
<path id="path254" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M244.575,571.98c0,0,14.054,18.766,12.873,1.697
c0,0,0.21-2.177-2.71-2.708C247.866,569.725,247.494,563.987,244.575,571.98z"/>
<path id="path258" fill="#FFFFCC" stroke="#000000" stroke-width="0.5" d="M256.716,572.122c0,0,13.948,20.412,14.563,3.143
c0,0,2.903-2.433-0.18-2.824C260.826,571.133,262.235,563.269,256.716,572.122z"/>
<path id="path262" fill="#E5E5B2" d="M192.845,578.354l-13.521-2.702c-4.591-8.828-8.299-19.688-8.299-19.688
s11.212,1.767,33.282,6.709c0,0,1.547,5.858,4.146,16.091L192.845,578.354z"/>
<path id="path266" fill="#E5E5B2" d="M307.732,570.123c-2.942-4.425-5.268-7.528-6.416-8.245c-5.32-3.325,1.995-2.659,3.989-2.659
c0,0,29.258,0,32.583,1.329c0,0,0.926,3.959,2.134,9.946C340.022,570.494,322.21,566.945,307.732,570.123z"/>
<path id="path270" fill="#CC7226" d="M402.378,326.201c48.945,6.992,94.004-55.936,97.112-73.028
c3.106-17.092-14.762-38.067-14.762-38.067c2.33-5.438-6.216-30.298-15.537-46.613c-9.322-16.314-37.398-14.595-68.367-16.314
c-27.968-1.554-60.599,39.621-62.928,42.729c-2.331,3.108,8.546,70.698,10.876,80.798s-2.33,56.712-2.33,56.712
C406.897,316.349,353.434,319.209,402.378,326.201z"/>
<path id="path274" fill="#EA8E51" d="M339.182,196.051c-2.288,3.051,8.392,69.413,10.68,79.328
c2.288,9.916-2.288,55.682-2.288,55.682c57.687-15.679,6.864-12.967,54.918-6.102c48.056,6.865,92.296-54.918,95.347-71.701
c3.051-16.781-14.492-37.375-14.492-37.375c2.288-5.339-6.103-29.748-15.255-45.766c-9.153-16.018-36.717-14.328-67.125-16.018
C373.506,152.573,341.47,193,339.182,196.051z"/>
<path id="path278" fill="#EFAA7C" d="M340.467,197.195c-2.245,2.995,8.235,68.127,10.481,77.859s-2.246,54.65-2.246,54.65
c55.448-16.173,6.737-12.727,53.9-5.989c47.166,6.738,90.587-53.901,93.581-70.373c2.994-16.47-14.224-36.683-14.224-36.683
c2.245-5.24-5.989-29.197-14.973-44.918c-8.984-15.721-36.037-14.063-65.882-15.721C374.155,154.522,342.713,194.2,340.467,197.195z
"/>
<path id="path282" fill="#F4C6A8" d="M341.753,198.339c-2.204,2.938,8.079,66.842,10.282,76.391
c2.204,9.548-2.203,53.619-2.203,53.619c51.974-15.961,6.61-12.487,52.885-5.876c46.275,6.611,88.877-52.884,91.815-69.043
c2.938-16.161-13.956-35.993-13.956-35.993c2.203-5.142-5.876-28.646-14.69-44.07c-8.813-15.425-35.355-13.799-64.638-15.425
C374.806,156.472,343.956,195.401,341.753,198.339z"/>
<path id="path286" fill="#F9E2D3" d="M343.038,199.483c-2.161,2.881,7.924,65.557,10.085,74.921
c2.161,9.365-2.161,52.588-2.161,52.588c49.205-15.75,6.483-12.246,51.868-5.763c45.386,6.483,87.168-51.868,90.049-67.718
c2.882-15.849-13.687-35.299-13.687-35.299c2.161-5.042-5.765-28.095-14.408-43.223c-8.646-15.128-34.677-13.534-63.396-15.128
C375.455,158.421,345.199,196.602,343.038,199.483z"/>
<path id="path290" fill="#FFFFFF" d="M402.942,319.984c44.493,6.356,85.459-50.85,88.283-66.388
c2.825-15.538-13.419-34.606-13.419-34.606c2.119-4.944-5.65-27.544-14.127-42.375c-8.475-14.831-33.995-13.267-62.149-14.831
c-25.427-1.413-55.088,36.019-57.207,38.844c-2.119,2.825,7.769,64.27,9.888,73.451c2.119,9.182-2.119,51.557-2.119,51.557
C397.116,310.45,358.448,313.628,402.942,319.984z"/>
<path id="path294" fill="#CCCCCC" d="M484.87,259.953c0,0-49.087,13.419-69.568,10.594c0,0-27.896-11.653-43.435,26.838
c0,0-6.356,12.713-9.889,16.244C358.447,317.16,484.87,259.953,484.87,259.953z"/>
<path id="path298" d="M491.58,256.068c0,0-51.206,21.541-68.862,20.834c0,0-28.956-8.122-43.788,17.656
c0,0-14.831,16.244-20.48,19.069c0,0-0.706,2.825,10.594-4.238l18.363,9.182c0,0,26.131,16.95,43.081-11.3
c0,0,7.063-19.775,7.063-23.307c0-3.532,37.433-13.419,40.259-14.125C480.633,269.134,492.286,261.718,491.58,256.068z"/>
<path id="path302" fill="#99CC32" d="M407.887,319.479c-12.134,0-26.918-6.824-26.918-17.857c0-11.032,14.784-22.094,26.918-22.094
c12.138,0,21.976,8.943,21.976,19.975C429.861,310.537,420.023,319.479,407.887,319.479z"/>
<path id="path306" fill="#659900" d="M401.489,290.021c-8.557,1.275-17.541,3.929-17.414,3.547
c2.719-8.156,13.95-14.041,23.812-14.041c7.585,0,14.273,3.493,18.222,8.807C426.107,288.335,416.722,287.753,401.489,290.021z"/>
<path id="path310" fill="#FFFFFF" d="M422.718,289.616c0,0-7.769-5.65-7.769-1.766C414.949,287.85,421.306,295.619,422.718,289.616z
"/>
<path id="path314" d="M405.063,303.963c-4.412,0-7.989-3.577-7.989-7.991c0-4.412,3.577-7.989,7.989-7.989
c4.413,0,7.99,3.577,7.99,7.989C413.053,300.386,409.476,303.963,405.063,303.963z"/>
<path id="path318" fill="#CC7226" d="M221.435,280.434c0,0-5.65-37.432-1.413-45.2c0,0,19.069-17.657,18.363-24.013
c0,0-0.706-31.782-2.825-33.194c-2.119-1.413-15.538-12.006-26.131-0.706c0,0-18.363,31.781-16.95,43.082v3.531
c0,0-13.419-0.706-16.244,2.825c0,0-2.119,9.181-4.238,9.888c0,0-4.944,4.237-1.413,9.181c0,0-3.531,4.237-2.825,11.3l13.419,7.063
c0,0,3.531,25.425,22.601,34.606C212.317,302.909,217.903,291.028,221.435,280.434z"/>
<path id="path322" fill="#FFFFFF" d="M219.669,277.186c0,0-5.085-33.688-1.271-40.681c0,0,17.162-15.891,16.527-21.611
c0,0-0.636-28.604-2.543-29.875c-1.907-1.271-13.984-10.806-23.518-0.636c0,0-16.526,28.604-15.255,38.773v3.178
c0,0-12.077-0.636-14.62,2.542c0,0-1.907,8.263-3.813,8.899c0,0-4.45,3.813-1.271,8.263c0,0-3.178,3.813-2.542,10.17l12.077,6.356
c0,0,3.178,22.883,20.34,31.146C211.462,297.411,216.491,286.72,219.669,277.186z"/>
<path id="path326" fill="#EB955C" d="M234.765,179.775c-1.924-1.519-15.149-11.706-25.478-0.688c0,0-17.904,30.987-16.526,42.004
v3.443c0,0-13.083-0.688-15.838,2.754c0,0-2.066,8.952-4.132,9.641c0,0-4.82,4.132-1.377,8.952c0,0-3.443,4.132-2.754,11.018
l13.083,6.886c0,0,3.443,24.79,22.035,33.741c8.323,4.008,13.772-7.574,17.215-17.903c0,0-5.509-36.496-1.377-44.07
c0,0,18.592-17.215,17.903-23.413C237.52,212.139,236.831,181.152,234.765,179.775z"/>
<path id="path330" fill="#F2B892" d="M233.971,181.523c-1.73-1.625-14.761-11.406-24.825-0.671c0,0-17.444,30.192-16.103,40.927
v3.355c0,0-12.748-0.671-15.432,2.684c0,0-2.013,8.722-4.026,9.394c0,0-4.696,4.025-1.342,8.722c0,0-3.354,4.025-2.684,10.735
l12.748,6.709c0,0,3.354,24.154,21.47,32.876c8.111,3.906,13.419-7.38,16.773-17.445c0,0-5.368-35.56-1.342-42.94
c0,0,18.115-16.773,17.444-22.812C236.654,213.057,235.983,182.865,233.971,181.523z"/>
<path id="path334" fill="#F8DCC8" d="M233.176,183.271c-1.536-1.73-14.373-11.106-24.172-0.653c0,0-16.985,29.398-15.679,39.851
v3.266c0,0-12.413-0.653-15.026,2.613c0,0-1.96,8.493-3.919,9.146c0,0-4.573,3.92-1.307,8.493c0,0-3.267,3.92-2.613,10.453
l12.413,6.533c0,0,3.266,23.518,20.905,32.011c7.897,3.803,13.065-7.186,16.332-16.985c0,0-5.227-34.624-1.307-41.811
c0,0,17.639-16.332,16.985-22.211C235.789,213.976,235.136,184.578,233.176,183.271z"/>
<path id="path338" fill="#FFFFFF" d="M219.669,277.009c0,0-5.085-33.512-1.271-40.504c0,0,17.162-15.891,16.527-21.611
c0,0-0.636-28.604-2.543-29.875c-1.342-1.836-13.984-10.806-23.518-0.636c0,0-16.526,28.604-15.255,38.773v3.178
c0,0-12.077-0.636-14.62,2.542c0,0-1.907,8.263-3.813,8.899c0,0-4.45,3.813-1.271,8.263c0,0-3.178,3.813-2.542,10.17l12.077,6.356
c0,0,3.178,22.883,20.34,31.146C211.462,297.411,216.491,286.543,219.669,277.009z"/>
<path id="path342" fill="#CCCCCC" d="M214.195,265.956c0,0-38.138-18.01-39.727-19.422c0,0,16.067,14.479,17.48,14.479
C193.361,261.013,214.195,265.956,214.195,265.956z"/>
<path id="path346" d="M184.003,255.009c0,0,32.488,6.356,32.488,14.125c0,5.141-0.429,28.834-9.888,26.131
C191.772,291.028,198.128,265.603,184.003,255.009z"/>
<path id="path350" fill="#99CC32" d="M198.834,261.718c0,0,15.852,2.603,17.656,7.416c1.06,2.825,2.23,17.494-7.416,19.422
C201.038,290.165,197.101,272.118,198.834,261.718z"/>
<path id="path354" d="M350.671,336.845c-0.878-3.076,1.438-2.845,4.601-3.794c3.53-1.06,25.071-7.769,26.483-12.359
c1.413-4.591,24.719,3.178,24.719,3.178c3.18,1.412,10.947,6.003,10.947,6.003c8.476,2.119,20.128,2.825,20.128,2.825
c4.238,1.766,10.241,6.709,10.241,6.709c25.778,18.009,47.674,5.297,47.674,5.297c35.313-11.653,24.72-42.022,24.72-42.022
c-5.298-15.891,0.354-21.894,0.354-21.894c0.354-6.709,13.064,4.591,13.064,4.591c4.592,7.416,6.005,16.244,6.005,16.244
c14.125,19.775,8.122-11.653,8.122-11.653c0.353-1.766-4.592-8.122-4.592-10.241s-3.179-8.122-3.179-8.122
c-5.297-6.003-1.06-18.363-1.06-18.363c3.179-24.366-0.706-21.188-0.706-21.188c-2.118-3.178-18.362,14.478-18.362,14.478
c-3.885,6.003-14.479,8.828-14.479,8.828c-4.942,3.178-10.946,0.707-10.946,0.707c-4.59-0.707-14.479,11.653-14.479,11.653
c4.943-0.354,9.182,7.416,13.419,7.769c4.237,0.354,7.415-4.237,10.24-5.297c2.825-1.059,7.769,9.182,7.769,9.182
c0.707,4.59-9.181,13.065-9.181,13.065c-0.707,8.122-3.531,5.297-3.531,5.297c-5.297-1.059-7.415,5.65-9.182,13.772
c-1.766,8.122-9.182,8.829-9.182,8.829c-2.825,13.065-4.945,7.769-4.945,7.769c-0.354-9.888-10.947,0.353-10.947,0.353
c-2.118,3.531-10.239-0.353-10.239-0.353c-12.008-3.531-7.77-7.063-7.77-7.063c3.178-3.884,22.953,0,22.953,0
c3.884-2.825-10.241-9.888-10.241-9.888c-1.06-3.178,0.706-10.947,0.706-10.947c2.119-5.65,14.126-15.538,14.126-15.538
c16.599-2.119,11.654-4.944,11.654-4.944c-10.946-9.182-21.189,4.237-21.189,4.237c-3.884,10.947-34.605,37.432-34.605,37.432
c-8.476,6.003-3.884-6.003-10.947,0c-7.063,6.003-43.435-9.888-43.435-9.888c-20.414-2.106-25.238,25.688-31.47,20.18
C343.93,331.689,353.496,346.732,350.671,336.845z"/>
<path id="path358" d="M694.629,43.132c0,0-45.201,14.125-50.145,47.319c0,0-4.237,40.256,31.78,71.332c0,0,0.707,11.3,4.238,16.95
c0,0-2.825,8.475,30.368-4.944l48.025-14.832c0,0,11.301-4.238,20.481-19.775c9.181-15.538,36.019-48.731,29.662-93.226
c0,0,2.119-19.775-8.475-20.481c0,0-14.832-2.825-27.544,10.594c0,0-12.008,5.65-16.244,4.944L694.629,43.132z"/>
<path id="path362" d="M791.069,41.384c0,0,3.708-15.767-4.837-7.222c0,0-12.432,10.1-25.641,10.1c0,0-25.637,3.884-33.404,27.191
c0,0-6.992,47.39,6.99,57.489c0,0,8.546,13.207,20.978,1.554C767.587,118.843,794.954,65.467,791.069,41.384z"/>
<path id="path366" fill="#323232" d="M790.409,42.016c0,0,3.689-15.438-4.7-7.048c0,0-12.204,9.916-25.173,9.916
c0,0-25.171,3.814-32.798,26.697c0,0-6.865,46.528,6.863,56.444c0,0,8.392,12.967,20.596,1.525
C767.403,118.108,794.224,65.661,790.409,42.016z"/>
<path id="path370" fill="#666666" d="M789.749,42.648c0,0,3.673-15.11-4.563-6.875c0,0-11.978,9.732-24.705,9.732
c0,0-24.705,3.743-32.191,26.202c0,0-6.738,45.667,6.737,55.399c0,0,8.234,12.727,20.213,1.497
C767.22,117.374,793.492,65.855,789.749,42.648z"/>
<path id="path374" fill="#999999" d="M789.089,43.28c0,0,3.654-14.782-4.425-6.703c0,0-11.752,9.549-24.24,9.549
c0,0-24.239,3.672-31.584,25.708c0,0-6.609,44.805,6.61,54.354c0,0,8.08,12.487,19.832,1.469
C767.036,116.639,792.762,66.05,789.089,43.28z"/>
<path id="path378" fill="#CCCCCC" d="M788.429,43.912c0,0,3.638-14.454-4.287-6.529c0,0-11.527,9.365-23.773,9.365
c0,0-23.772,3.602-30.978,25.213c0,0-6.482,43.943,6.483,53.309c0,0,7.924,12.247,19.45,1.441
C766.851,115.904,792.03,66.244,788.429,43.912z"/>
<path id="path382" fill="#FFFFFF" d="M787.767,44.544c0,0,3.619-14.125-4.148-6.356c0,0-11.301,9.181-23.308,9.181
c0,0-23.307,3.531-30.368,24.719c0,0-6.356,43.082,6.355,52.263c0,0,7.77,12.006,19.069,1.412
C766.667,115.17,791.298,66.438,787.767,44.544z"/>
<path id="path386" fill="#992600" d="M414.243,403.323c0,0-36.021-33.901-50.146-35.313c0,0-60.738-7.063-86.87,24.719
c0,0,31.076-36.019,79.807-26.131c0,0-38.138-7.769-60.032-2.119c0,0-29.663,0-46.613,24.719l-4.944,8.475
c0,0,7.063-26.131,39.55-36.726c0,0,40.256-8.475,59.326,0c0,0-38.138-12.006-55.794-8.475c0,0-53.675-4.237-76.275,42.375
c0,0,7.063-25.425,33.194-38.138c0,0,24.013-15.538,60.032-10.594c0,0,25.425,5.65,34.607,9.888
c9.182,4.237,7.063-0.707-7.769-9.182c0,0-9.889-17.656-34.607-16.95c0,0-75.57,6.356-93.932,27.544
c0,0,24.013-19.775,42.375-24.719c0,0,39.55-14.125,54.381-12.713c0,0,43.788,1.766,57.207-5.297c0,0-19.775,8.828-14.125,14.479
c5.649,5.65,17.656,19.069,17.656,21.188s42.729,41.14,49.085,48.908L414.243,403.323z"/>
<path id="path390" fill="#CCCCCC" d="M658.607,745.857c0,0-27.367-64.445-49.438-81.221c0,0,45.906,28.251,52.086,60.032
C661.256,724.67,661.256,742.326,658.607,745.857z"/>
<path id="path394" fill="#CCCCCC" d="M741.593,759.1c0,0-46.789-97.109-79.454-139.484c0,0,76.807,66.212,85.635,113.001
l0.883,9.711l-5.297-4.414C743.358,737.912,742.476,753.803,741.593,759.1z"/>
<path id="path398" fill="#CCCCCC" d="M841.352,673.466c0,0-110.353-105.056-113.001-109.47c0,0,106.821,116.533,112.118,129.775
C840.469,693.771,836.938,677.88,841.352,673.466z"/>
<path id="path402" fill="#CCCCCC" d="M508.528,750.271c0,0,34.43-91.813,67.977-52.087c0,0,26.485,17.656,25.604,22.953
c0,0-7.063-11.477-38.846-10.594C563.263,710.545,529.716,705.248,508.528,750.271z"/>
<path id="path406" fill="#CCCCCC" d="M844.883,525.152c0,0-79.454-50.321-92.695-52.971c-20.848-4.168,87.398,51.204,96.228,69.743
C848.414,541.926,851.945,537.512,844.883,525.152z"/>
<path id="path410" d="M578.803,713.371c0,0,36.02-3.531,48.025-15.537l7.769,6.356l31.075-67.802l6.356,9.183
c0,0,25.426-26.132,24.013-40.257c-1.412-14.125,22.601,10.594,22.601,10.594s-1.413-20.481,11.301-8.477
c0,0-4.237-27.544,10.594-13.419c0,0-18.604-53.246,21.188-7.769c9.889,11.3,2.119-0.706,2.119-0.706s-45.905-84.751-7.769-59.325
c0,0,3.531-40.257,1.412-48.026c-2.118-7.769-5.649-47.319-14.125-56.502c-8.477-9.182,0.706-12.006,10.594-2.824
c0,0-19.775-42.375,3.531-21.188c0,0-6.356-26.838-14.125-31.782c0,0-9.889-30.369,16.949-11.3c0,0-7.769-21.894-13.419-27.544
c0,0-20.48-48.732-7.769-40.257l7.769,6.356c0,0-12.007-24.719-0.706-16.95s11.301,7.063,11.301,7.063s-37.433-58.62-1.412-27.544
c0,0-14.406-24.574-20.481-36.726c0,0-33.193-36.019-7.77-24.719l8.476,2.825c0,0-15.538-17.656-29.663-20.481
c-14.125-2.825,4.237-14.125,15.538-10.594c11.3,3.531,38.844,16.95,38.844,16.95s22.602,33.194,29.663,33.9
c0,0-35.313-13.419-24.719,0.706c0,0,25.425,24.719,12.712,24.013c0,0-10.594,12.713-2.118,28.25c0,0-32.592-32.472-6.355,12.712
l12.006,28.957c0,0-43.081-43.788-23.306-4.944c0,0,30.369,41.669,33.899,42.375c3.531,0.707,11.3,16.244,11.3,16.244l-7.769-3.531
l9.181,15.538c0,0-19.774-21.188-9.181,2.119l9.887,25.425c0,0-36.019-38.844-12.006,13.42c0,0-28.957-9.183-13.419,21.188
c0,0-2.825,28.252-2.119,37.434c0.707,9.183,2.825,59.325-4.942,73.451c-7.77,14.125,10.594,48.025,14.125,55.088
c3.53,7.063,9.888,26.131-5.65,9.889c-15.537-16.244-7.769-6.356-4.237,9.181c3.531,15.538,14.125,43.082,12.713,52.97
c0,0-2.118,2.119-7.769-4.236c0,0-26.132-40.258-23.307-14.832c0,0-2.119,14.125-7.77,29.663c0,0-5.649,19.068-5.649,3.53
c0,0-5.65-29.663-10.595-16.244c-4.943,13.42-11.301,24.014-16.244,28.251c-4.942,4.237-14.125-36.02-16.243-17.656
c0,0-21.188-21.895-29.662,7.063l-20.482,28.957c0,0-0.706-21.894-2.824-11.3C650.135,710.547,597.165,721.141,578.803,713.371z"/>
<path id="path414" d="M518.064,83.389c0,0-20.481-14.125-27.545-13.419c-7.063,0.706,48.731-15.538,121.477,33.194
c0,0,8.476,4.944,14.832,4.238c0,0,5.648,4.237,0.706,10.594c0,0-15.538,16.95,4.237,36.725c0,0,32.487,12.006,22.601-3.531
c0,0,19.069,7.063,23.307,14.125c4.238,7.062,2.118,0,2.118,0s-11.3-12.713-21.894-21.894c0,0-9.183-3.531-14.125-18.363
c-4.944-14.832-9.183-32.488-1.413-38.138c0,0-7.063,7.769-5.649,0.706c1.412-7.063,7.77-13.419,10.594-14.125
c2.825-0.707,31.781-28.604,43.788-29.31c0,0-16.244,2.472-21.541,0.706S617.293,23.003,606.7,20.884c0,0-29.662-11.653-8.476-8.122
c0,0,63.211,6.709,95.346,30.016c0,0-12.713-14.832-45.2-27.191c0,0-39.197-22.247-101.349-13.419c0,0-31.429,5.65-45.2,8.828
c0,0-4.591-1.06-5.65-1.766c-1.059-0.706-21.896-16.597-70.627-4.237c0,0-30.016,8.122-45.2,16.597c0,0-26.838,2.119-33.193,7.769
c0,0-32.842,25.778-36.372,27.191c-3.531,1.413-23.66,14.831-25.072,15.538c0,0,43.435-11.653,47.672-15.891
c4.238-4.237,34.96-8.828,39.197-6.356c4.238,2.472,19.069,1.413,2.119,2.472c0,0,133.483,26.132,134.896,29.663
C511.002,85.507,518.064,83.389,518.064,83.389z"/>
<path id="path418" fill="#CC7226" d="M644.131,67.145c0,0-18.009-13.066-21.54-13.066c-3.532,0-25.426-18.009-32.842-17.303
c-7.415,0.707-28.956-16.95-77.335-2.472c0,0-1.061-3.531,5.297-4.944c0,0,11.301-3.884,12.007-4.944c0,0,35.666-7.416,48.378-1.06
c0,0,16.244,4.591,27.191,15.538c0,0,19.775,5.65,25.425,3.885c0,0,15.538,3.884,16.244,7.063c0,0,10.241,5.297,7.063,9.888
C654.019,59.729,654.725,62.554,644.131,67.145z"/>
<path id="path422" fill="#CC7226" d="M622.112,63.421c1.425,1.116,3.224,1.289,4.292,2.717c0.413,0.554-0.099,1.13-0.653,1.301
c-1.842,0.56-3.706-0.447-5.723,0.591c-0.71,0.366-1.844,0.044-2.819-0.219c-2.882-0.779-6.111-0.823-9.097,0.392
c-3.505-1.994-7.672-0.962-11.348-2.73c-0.102-0.047-0.493,0.563-0.625,0.516c-5.378-2.021-11.985-1.522-16.278-5.555
c-4.286-0.728-8.448-1.543-12.735-2.744c-3.21-0.899-5.697-2.645-8.558-4.114c-2.433-1.25-5.004-2.171-7.713-2.828
c-3.289-0.798-6.521-0.601-9.864-1.519c-0.164-0.044-0.503,0.563-0.648,0.516c-0.57-0.191-1.084-1.22-1.386-1.127
c-2.968,0.922-5.595-0.794-8.533-0.19c-2.08-2.161-5.131-1.729-7.859-2.509c-5.233-1.498-10.804,0.745-16.152-1.022
c7.262-3.252,15.538-1.077,22.71-4.73c4.11-2.094,8.811-0.148,13.348-1.49c0.86-0.254,2.08-0.611,2.786,0.57
c0.237-0.239,0.56-0.661,0.661-0.611c4.325,2.042,8.413,4.292,12.795,6.174c0.604,0.258,1.542-0.152,1.986,0.205
c2.684,2.147,6.114,1.965,8.569,4.119c2.998-0.886,6.164-0.215,9.218-1.317c0.137-0.048,0.55,0.554,0.606,0.516
c1.995-1.321,4.035-0.842,5.609-0.306c0.597,0.203,1.768,0.639,2.307,0.77c1.987,0.487,3.499,1.335,5.581,1.658
c0.201,0.032,0.527-0.568,0.655-0.519c1.982,0.773,3.822,0.674,4.979,2.729c0.238-0.238,0.529-0.658,0.676-0.611
c1.813,0.597,2.959,1.93,4.901,2.355c0.856,0.187,1.938,1.292,2.954,1.603c4.224,1.291,7.479,3.991,11.353,5.571
C619.447,62.132,620.994,62.545,622.112,63.421z"/>
<path id="path426" fill="#CC7226" d="M486.804,38.296c-4.445-3.046-8.627-4.999-12.938-8.152c-0.32-0.235-0.955,0.065-1.313-0.15
c-1.776-1.075-3.346-2.101-5.079-3.33c-0.952-0.674-2.4-0.655-3.299-1.11c-4.491-2.281-9.134-3.267-13.56-5.375
c1.204-1.126,3.185-0.695,4.236-2.119c0.346,0.495,0.766,0.996,1.389,0.659c2.963-1.596,6.229-1.866,9.188-1.708
c3.01,0.163,6.046,0.701,9.181,1.181c0.542,0.083,0.894,1.006,1.464,1.178c3.934,1.171,8.15,0.244,11.894,1.723
c2.81,1.111,5.581,2.564,7.77,4.815c0.444,0.459-0.13,0.991-0.623,1.333c0.685-0.193,1.167,0.171,1.361,0.724
c0.148,0.422,0.148,0.955,0,1.377c-0.196,0.551-0.689,0.729-1.351,0.819c-2.484,0.336,0.645-2.101-0.591-1.31
c-2.248,1.438-0.932,3.92-2.246,6.159c-0.494-0.342-0.9-0.728-0.706-1.413c0.413,0.922-0.65,1.434-0.947,1.992
C489.953,36.869,488.366,39.367,486.804,38.296z"/>
<path id="path430" fill="#CC7226" d="M429.424,51.27c-5.568-1.402-10.954-1.199-16.279-3.452c-0.117-0.049-0.512,0.563-0.625,0.516
c-2.411-1.049-4.032-2.754-5.933-4.602c-1.612-1.568-4.539-0.884-6.789-1.744c-0.572-0.219-0.931-1.123-1.462-1.192
c-2.152-0.277-3.789-1.953-5.634-2.961c4.124-1.404,8.381-1.349,12.729-2.027c0.199-0.031,0.455,0.535,0.69,0.535
c0.24,0,0.47-0.39,0.706-0.627c0.345,0.495,0.878,1.07,1.331,0.622c0.968-0.953,1.949-0.618,2.902-0.547
c0.255,0.018,0.476,0.553,0.709,0.553c0.24,0,0.473-0.549,0.707-0.549c0.239,0.001,0.472,0.549,0.706,0.549
c0.24,0,0.471-0.39,0.706-0.627c1.223,1.381,2.784,0.403,4.235,0.719c1.833,0.401,2.305,2.428,4.201,2.954
c8.324,2.302,15.629,6.09,23.333,9.774c0.542,0.26,0.912,0.698,0.719,1.384c0.471,0,1.023-0.155,1.359,0.078
c1.867,1.292,3.706,2.26,4.937,4.199c0.381,0.599-0.199,1.317-0.61,1.226C444.243,54.292,437.17,53.219,429.424,51.27z"/>
<path id="path434" fill="#CC7226" d="M404.952,129.332c-2.813-2.152-3.842-5.738-5.834-8.902c-0.378-0.6,0.105-1.154,0.666-1.312
c0.987-0.281,1.946,0.563,2.669,0.92c3.081,1.522,5.792,3.715,9.316,3.96c3.515,3.945,11.036,4.625,11.049,10.594
c0.002,1.517-2.521-0.104-3.278,1.412c-4.328-1.771-8.546-1.589-12.748-4.179C405.702,131.152,406.285,130.353,404.952,129.332z"/>
<path id="path438" fill="#CC7226" d="M356.33,36.5c0.238,0.002,12.652,0.413,12.622,0.614c-0.079,0.546-13.729,2.398-14.37,2.098
c-0.29-0.134-13.554,4.156-13.79,3.92C341.266,42.894,355.86,36.5,356.33,36.5z"/>
<path id="path442" d="M383.521,53.726c0,0-26.133,3.178-33.9,5.297c-7.77,2.119-40.609,15.538-45.907,19.069
c0,0-23.66,9.535-53.675,44.848c0,0,13.419-6.003,17.303-10.947c0,0,24.013-22.247,23.66-17.656c0,0,21.541-15.185,20.481-11.3
c0,0,43.082-19.775,39.551-14.125c0,0,38.138-8.122,36.372-4.591c0,0,33.192,7.769,28.25,8.122c0,0-10.241,2.119,1.06,8.475
c0,0-6.003,7.769-15.538,0.707c-9.534-7.063-4.236-3.178-13.064-1.413c0,0-4.592,1.413-12.713-5.65c0,0-9.889-8.122-25.426-1.766
c0,0-54.029,22.247-57.56,23.307c0,0-6.356,4.944-10.594,11.3c0,0-10.241,7.769-15.538,10.241c0,0-22.6,20.481-24.719,22.953
c0,0-6.003,9.181-7.416,9.888c0,0,11.3-6.709,14.831-10.241c0,0,24.719-17.656,34.253-19.069c0,0,7.769-5.297,9.182-7.769
c0,0,25.425-16.244,32.84-16.244c0,0,16.244,9.181,20.482-3.178c0,0,10.239-3.178,20.128-1.06c0,0,5.649-4.591,4.236-8.475
c0,0,2.825-3.178,4.592,3.531c0,0,6.003,6.356,14.479,2.825c0,0,7.063-0.353,3.531,3.884c0,0-7.77,6.709-28.604,7.063
c0,0-21.895,1.06-50.851,14.479c0,0-52.616,18.363-68.86,36.725c0,0-11.3,15.538-20.834,17.657c0,0-10.241,1.412-20.834,14.478
c0,0,17.303-10.241,33.194-10.241c0,0,7.063-4.237,0.353,2.119c0,0-6.356,13.418-3.531,22.953c0,0-1.06,9.181-2.472,12.006
c0,0-13.772,22.6-13.772,26.838c0,4.237,2.119,21.541,2.825,22.6c0.706,1.06-1.766-2.825,4.944,1.413
c6.709,4.237,11.653,7.063,13.065,12.006c1.413,4.944-3.531-9.535-3.884-12.713c-0.353-3.178-7.769-15.891-6.356-20.128
c0,0,1.766,1.766,3.178,4.237c0,0-1.059-1.06,0-7.416c0,0,1.413-9.182,3.885-14.832s6.003-12.359,6.709-13.772
c0.707-1.413,0.707-11.653,3.178-7.063l6.003,4.59c0,0-4.944-4.59-1.06-8.475c0,0-1.766-9.888,1.413-14.479
c0,0,12.359-14.832,15.185-16.597c2.826-1.765,0.353-1.059,0.353-1.059s10.594-7.416,0.353-4.591c0,0-7.063,2.825-12.359,2.825
c0,0-13.419,3.531-6.356-3.885s24.719-16.95,31.429-16.597l1.413,2.825l19.775-4.237l-2.119,1.413c0,0-0.353-0.354,7.063-1.06
s17.656,1.766,20.128-1.413c2.473-3.178,8.477-4.944,7.771-2.472c-0.706,2.472-1.061,6.003-1.061,6.003s8.828-10.241,7.77-6.356
c-1.061,3.884-15.537,13.065-18.011,24.013l18.363-14.479l6.356-5.297c0,0,6.355,3.884,6.709,1.06
c0.354-2.825,8.476-13.066,10.594-12.713c2.119,0.353,5.649-4.591,5.297,0c-0.353,4.591,13.066,14.125,13.066,14.125
s5.648-3.178,8.122-0.706c2.472,2.472,9.887-34.96,9.887-34.96l44.142-18.716l76.983-6.003l-30.017-12.006L383.521,53.726z"/>
<path id="path446" stroke="#4C0000" stroke-width="2" d="M415.655,405.089c0,0-26.484-29.663-41.316-34.254
c0,0-23.659-12.006-67.094,1.766"/>
<path id="path450" stroke="#4C0000" stroke-width="2" d="M368.689,368.363c0,0-44.494-14.125-71.687-6.709
c0,0-32.488,3.531-47.319,27.897"/>
<path id="path454" stroke="#4C0000" stroke-width="2" d="M362.333,366.245c0,0-30.016-12.713-56.147-16.597
c0,0-29.31-4.591-58.62,8.122c0,0-21.541,10.594-31.075,28.603"/>
<path id="path458" stroke="#4C0000" stroke-width="2" d="M364.099,366.951c0,0-27.19-19.422-28.957-21.894
c0,0-12.358-19.422-35.313-20.128c0,0-37.785,1.413-68.154,15.538"/>
<path id="path462" d="M361.794,351.072c2.723,2.583,50.33,53.664,50.33,53.664c62.15,64.624,12.713,4.236,12.713,4.236
c-13.419-8.475-29.663-41.669-29.663-41.669c-2.119-4.944,24.719,12.713,24.719,12.713c7.063,1.412,31.075,35.313,31.075,35.313
c-12.006-4.237-3.53,8.476-3.53,8.476c4.943,3.531,40.965,31.077,40.965,31.077c6.355,7.063,13.419,9.888,13.419,9.888
c24.719-9.182,13.419,14.125,13.419,14.125c4.236,12.007,14.125-8.476,14.125-8.476c19.774-29.664-9.182-25.425-9.182-25.425
c-52.972,4.942-64.978-23.31-64.978-23.31c-4.238-4.236,11.3,0,11.3,0c14.833,3.531-12.713-21.894-12.713-21.894
c4.237,0,20.481,12.006,20.481,12.006c18.363,16.244,21.896,12.713,21.896,12.713c31.782-15.538,50.146-2.119,50.146-2.119
c3.53,2.825-6.356,14.832-3.531,24.016c2.825,9.182,11.3,31.075,11.3,31.075c-4.237,2.824-3.531,21.895-3.531,21.895
c29.663,40.963,12.713,37.432,12.713,37.432c-27.544-0.707-1.411,12.712-1.411,12.712c5.648,3.531,21.188,16.244,21.188,16.244
c-4.944-2.119-7.769,7.063-7.769,7.063c8.475,7.063,3.53,15.538,3.53,15.538c-10.594,2.118-12.713,9.181-12.713,9.181
c12.006,14.126-5.649,14.832-5.649,14.832c6.355,7.769-2.118,28.956-2.118,28.956c-8.477,0-19.775,9.888-19.775,9.888
c4.237,8.477-14.125,18.363-14.125,18.363c-14.832,2.824-9.888,14.831-9.888,14.831c-14.125,10.594-18.363,38.844-18.363,38.844
c-1.412,18.363-5.648,24.014,3.531,20.481c9.182-3.531,7.77-25.425,7.77-25.425c-8.476-27.545,67.095-55.795,67.095-55.795
c7.063-2.824,8.476-12.007,8.476-12.007c3.531,0.706,19.069,14.125,19.069,14.125c13.418,19.775,14.125,3.531,14.125,3.531
c2.118-6.356-0.707-16.95-0.707-16.95c10.595-38.138-14.125-49.438-14.125-49.438c-17.656-59.326,7.063-44.494,7.063-44.494
c4.944,9.888,24.014,19.068,24.014,19.068l6.355-4.237c-2.824-8.477,12.007-19.069,12.007-19.069
c4.943,11.301,15.537-2.824,15.537-2.824c6.356-43.082,28.251-17.656,28.251-17.656c7.063,2.119,9.182-9.889,9.182-9.889
c6.355-18.361,0-42.375,0-42.375c6.355-0.706,23.307,9.889,23.307,9.889c4.944-6.356-11.3-36.021-4.237-31.781
c7.063,4.237,14.831,7.063,14.831,7.063c1.413-3.53-16.243-25.426-16.243-25.426c-7.77-4.945-16.949-40.965-16.949-40.965
c12.712,6.356-4.944-20.481-4.944-20.481c0-5.65,10.594-25.425,10.594-25.425c-1.412-12.006,0-11.3,0-11.3
c4.944,2.119,19.069,4.944,7.063-6.356c-12.006-11.3,1.413-19.775,1.413-19.775c7.769-4.944-16.244-4.238-16.244-4.238
c-9.183-7.769-8.477-14.831-8.477-14.831c14.126,3.531-11.3-21.894-15.536-28.25c-4.237-6.356,12.713-15.538,12.713-15.538
c23.307-6.356,2.823-12.006,2.823-12.006c-34.605,0.706-15.536-18.363-15.536-18.363c10.594,0.707,7.769-3.531,7.769-3.531
c-9.181-2.119-26.132-13.419-26.132-13.419c-7.063-6.356-0.706-4.944-0.706-4.944c29.663,2.119-21.188-17.656-21.188-17.656
c14.125,0-17.655-18.363-17.655-18.363c-3.531-2.825-9.183-16.244-9.183-16.244c-10.594-9.182-19.067-21.188-19.067-21.188
c-0.707-7.769-9.183-16.244-9.183-16.244c-20.48-24.013-30.369-23.307-30.369-23.307c-26.132-6.356-35.313-4.944-35.313-4.944
l-93.229,7.769c-46.612,22.6-32.842,59.679-32.842,59.679c11.301,14.831,27.544,8.122,27.544,8.122
c8.122-10.947,28.604-7.063,28.604-7.063c36.021,5.65,31.431-0.706,31.431-0.706c-4.237-8.122-32.843-19.069-33.196-20.128
c-0.353-1.06-15.891-7.063-15.891-7.063c-5.297-2.119-13.065-18.363-13.065-18.363c-5.649-6.003,22.247,4.238,22.247,4.238
c-2.119,1.766,10.947,8.828,10.947,8.828c30.724-1.766,49.439,17.303,49.439,17.303c19.068,29.31,19.422,14.832,19.422,14.832
c4.943-16.597-15.892-54.029-15.892-54.029c0.706-3.531,15.186,8.122,15.186,8.122c2.472-3.531,3.885,6.709,3.885,6.709
c0.353,4.237,7.063,18.362,7.063,18.362c4.942,22.954,11.3,9.888,11.3,9.888l8.122,16.597c2.472,4.591-8.122,18.01-8.122,18.01
c-0.354,4.944,1.06,4.59-8.828,18.009s-3.885,21.188-3.885,21.188c-2.473,11.653,13.064,10.947,13.064,10.947
c4.591,3.884,10.595,3.884,10.595,3.884c3.179,3.531,7.415,2.472,7.415,2.472c2.825-6.709,13.772-3.178,13.772-3.178
c2.472-4.238,16.95-4.944,16.95-4.944c1.766-4.591,2.472-7.416,8.475-8.475c6.004-1.06-37.432-76.982-37.432-76.982
c11.301-1.413-3.179-23.307-3.179-23.307c-3.885-11.653,16.244,14.125,20.128,16.597c3.886,2.472,5.65,6.356,2.825,6.003
s-6.003,3.532-3.531,3.885c2.473,0.354,25.427,26.837,31.43,44.847c6.003,18.01,16.597,25.072,27.544,35.666
c10.947,10.594,9.534,53.322,9.534,53.322c-0.706,15.538,9.888,34.253,9.888,34.253c3.531,6.709-3.885,38.844-3.885,38.844
c-3.531,3.884-1.06,5.297-1.06,5.297c1.767,2.119,13.771,25.425,13.771,25.425c-3.178-0.353,3.179,6.003,3.179,6.003
c9.181,10.594-2.119,5.297-2.119,5.297c-10.594-2.825,1.767,14.479,1.767,14.479c2.119,3.178-13.772-4.944-13.772-4.944
c-16.243-1.06,4.238,11.653,4.238,11.653c15.185,12.713-4.944,4.943-4.944,4.943c-8.122-3.179-2.472,8.828-2.472,8.828
c5.649,2.824,36.02,15.186,36.02,15.186c0.706,6.711-4.591,15.539-4.591,15.539c0.706,7.063-3.179,13.064-3.179,13.064
c-2.118,14.479-3.178,15.891-3.178,15.891c-7.416,0.354-20.481,24.721-20.481,24.721c-3.179,4.591-21.188,25.777-21.188,25.777
c-3.531,12.359-35.313-0.354-35.313-0.354c-11.653,6.003-8.122,0-8.122,0c-0.706-3.884,7.771-14.479,7.771-14.479
c12.358-4.59,7.769-23.658,7.769-23.658c7.063-2.473-12.713-7.416-12.359-9.534c0.354-2.119,10.595-4.591,10.595-4.591
c14.125-3.531,6.355-7.77,6.355-7.77c-1.06-7.063,4.237-16.95,4.237-16.95c20.48-1.413,0-30.019,0-30.019
c-19.068-13.418-20.835-23.659-20.835-23.659c22.247-14.478,7.77-36.372,8.122-42.729c0.354-6.356,2.473-44.494,2.473-44.494
c-3.531-10.947-8.828-34.96-8.828-34.96c3.885-9.181,16.949-31.428,16.949-31.428c4.944-7.416,20.481-15.891,16.598-21.188
c-3.885-5.297-17.655-2.119-17.655-2.119c-13.772-2.472-12.713,6.709-12.713,6.709c-2.825,1.766-4.237,10.594-4.237,10.594
c-1.273,14.007-16.95,25.072-16.95,25.072c-19.775,10.947-3.531,18.01-3.531,18.01c10.595,11.653-6.71,12.006-6.71,12.006
c-19.422-3.178-4.942,14.831-4.942,14.831c19.067,22.601,13.771,27.544,13.771,27.544c-18.009,1.766,4.237,18.009,4.237,18.009
s-1.412-3.531-1.06-0.353c0.354,3.178,5.649,10.594,7.063,14.125c1.412,3.531-5.65,3.885-5.65,3.885
c1.061,16.95-26.132,9.534-26.132,9.534s0,0-2.824,0.353c-2.824,0.354-22.601-1.059-32.841-4.944
c-10.241-3.884-22.248-3.884-22.248-3.884s-7.063,3.178-20.481,2.825s-27.544,4.59-27.544,4.59
c-7.771-0.706,7.415-8.475,7.769-8.122s10.24-9.535-3.885-8.475c-38.485,2.887-57.561-15.185-57.561-15.185
c-3.53-2.472-8.122-7.416-8.122-7.416c-17.655-3.531,2.473,21.894,2.473,21.894c2.119,2.472-0.354,4.238-0.354,4.238
c-1.413-2.825-15.185-12.359-15.185-12.359C368.316,357.817,365.91,355.461,361.794,351.072z"/>
<path id="path466" fill="#4C0000" d="M319.604,330.579c0,0,20.481,9.887,25.072,14.831c4.591,4.944,29.311,25.072,29.311,25.072
s-9.535-3.531-14.125-6.709c-4.592-3.178-23.66-17.656-23.66-17.656S329.492,335.522,319.604,330.579z"/>
<path id="path470" fill="#99CC32" d="M217.181,275.496c0.595-0.261-0.33-5.05-0.69-6.008c-1.804-4.813-17.656-7.416-17.656-7.416
c-0.401,2.41-0.498,5.229-0.311,8.121C198.523,270.192,207.119,279.936,217.181,275.496z"/>
<path id="path474" fill="#659900" d="M217.181,275.143c-0.793,0.279-0.026-4.827-0.337-5.655
c-1.804-4.813-18.009-7.592-18.009-7.592c-0.401,2.41-0.498,5.228-0.311,8.12C198.523,270.015,206.06,279.053,217.181,275.143z"/>
<path id="path478" d="M209.428,275.395c-1.104,0-1.997-2.013-1.997-4.495c0-2.481,0.894-4.494,1.997-4.494
c1.104,0,1.999,2.013,1.999,4.494C211.427,273.382,210.532,275.395,209.428,275.395z"/>
<path id="path486" d="M128.915,448.525c0,0-9.888,17.655,33.9,7.063c0,0,24.719-2.119,28.957-6.355
c2.119,1.411,16.89,6.591,21.894,7.769c12.006,2.825,26.838-14.833,26.838-14.833s8.122-18.539,13.066-18.539
c4.944,0-0.707,2.825-0.707,2.825s-11.653,17.834-10.947,20.659c0,0-9.181,35.313-37.432,36.726c0,0-28.515,1.678-26.131,12.007
c0,0,15.538-4.237,19.775,0c0,0,19.069-0.707,4.944,10.595l-12.006,20.48c0,0,0.247,6.918-17.656,0.706
c-17.303-6.003-35.489-28.78-35.489-28.78S109.758,473.156,128.915,448.525z"/>
<path id="path490" fill="#E59999" d="M126.796,455.588c0,0-3.531,16.95,61.444-1.413c0,0,7.769,0,12.007,1.413
c4.237,1.412,25.425,6.356,28.957,4.237c0,0-12.713,24.013-33.194,21.188c0,0-23.307,2.825-22.6,11.302
c0,0,7.063,12.712,15.538,16.949c0,0,4.944,4.237,4.237,9.888c-0.706,5.649-5.65,8.476-9.181,9.888
c-3.531,1.413-9.181-4.237-12.006-4.237s-17.656-11.3-25.425-19.774c-7.769-8.476-22.6-29.662-21.894-34.606
C125.384,465.476,126.796,455.588,126.796,455.588z"/>
<path id="path494" fill="#B26565" d="M132.446,486.398c4.591,6.974,10.241,14.39,14.125,18.627
c7.769,8.476,22.6,19.774,25.425,19.774c2.825,0,8.475,5.65,12.006,4.237c3.531-1.412,8.475-4.237,9.181-9.888
c0.707-5.649-4.237-9.888-4.237-9.888c-5.414-2.707-10.251-8.873-13.04-12.975c0,0,0.327,4.499-8.854,3.087
c-9.181-1.413-18.363-6.356-21.188-12.007c-2.825-5.65-7.063-9.888-4.238-3.531s7.063,12.713,9.888,13.419
c2.825,0.706,2.119,2.825-2.119,2.119c-4.238-0.707-9.182-1.413-16.95-10.594L132.446,486.398L132.446,486.398z"/>
<path id="path498" fill="#992600" d="M127.855,449.231c0,0,3.178-24.016,5.297-31.077c0,0-1.413-12.007,2.825-19.422
c4.237-7.417,7.769-18.363,13.066-27.897s5.65-16.597,12.712-19.422c7.062-2.825,17.656-18.01,22.6-19.775
c4.944-1.765,4.591-0.353,4.591-0.353s12.006-26.131,36.019-19.069c0,0-28.604-4.944-0.706-21.541c0,0-8.475,1.942-2.648-10.417
c3.886-8.242,3.001,3.708-16.421,24.542c0,0-8.828,15.185-18.009,20.481c-9.181,5.297-30.369,17.657-32.488,24.366
c-2.119,6.709-7.769,16.95-11.3,19.775c-3.531,2.825-8.475,10.241-9.181,16.244c0,0-2.119,7.063-4.591,9.181
c-2.472,2.119-2.825,7.769-2.825,11.299c0,3.532-3.531,8.477-3.178,12.714c0,0,1.412,33.549,0.706,37.079L127.855,449.231z"/>
<path id="path502" fill="#FFFFFF" d="M112.671,457.354c0,0-3.531-2.472-11.3,8.122c0,0,12.889,58.267,12.889,60.738
c0,0,1.942-3.708-0.354-16.421c-2.295-12.713-3.884-35.137-3.884-35.137L112.671,457.354z"/>
<path id="path506" fill="#992600" d="M150.809,350.354c0,0-31.076,5.65-30.369,57.207l-1.413,43.79c0,0-2.119-45.202-4.238-48.026
c-2.119-2.825,4.944-22.601-0.706-12.007c0,0-24.719,24.719-10.594,62.152c0,0,2.648,5.827-2.648-2.295
c0,0-8.122-22.249-6.18-33.549c0,0,0.353-3.885,3.708-8.828c0,0,15.185-20.659,19.952-24.72c0,0,3.178-25.425,30.369-34.606
C148.69,349.471,158.754,345.41,150.809,350.354z"/>
<path id="path510" d="M396.939,233.468c1.164-0.625,1.148-2.338,2.174-2.644c2.027-0.607,2.317-2.491,3.231-3.875
c1.542-2.329,1.883-5.036,2.91-7.668c0.48-1.236,0.527-2.922-0.024-4.087c-2.072-4.381-3.313-8.705-5.858-12.988
c-0.473-0.794-0.937-2.196-1.29-3.252c-0.817-2.443-3.037-4.193-4.556-6.524c-0.51-0.779,0.419-2.412-0.847-2.56
c-1.584-0.186-4.143-1.209-4.554,0.602c-1.038,4.568,0.747,9.022,2.456,13.334c-1.381,1.222-0.791,2.848-0.522,4.202
c1.255,6.367-0.86,12.286-2.204,18.419c-0.041,0.184,0.563,0.533,0.514,0.643c-2.158,4.743-4.722,9.06-7.935,13.264
c-1.338,1.751-2.878,3.369-3.755,5.246c-0.649,1.39-1.37,3.095-0.929,4.84c-6.065,4.908-10.038,11.697-14.647,18.488
c-0.815,1.201-0.303,3.335,0.672,3.811c1.435,0.703,3.123-1.105,3.953-2.599c0.687-1.232,1.31-2.38,2.177-3.516
c0.233-0.309-0.081-1.049,0.157-1.262c4.647-4.144,7.596-9.328,11.927-13.509c3.442-0.581,6.157-2.343,9.243-4.131
c0.544-0.316,1.469,0.124,1.98-0.221c3.095-2.078,3.091-5.673,3.278-9.045C394.58,236.872,394.927,234.547,396.939,233.468z"/>
<path id="path514" d="M381.329,225.583c0.22-0.136-0.055-0.883,0.138-1.264c0.286-0.572,0.998-0.904,1.284-1.476
c0.192-0.381-0.096-1.052,0.146-1.303c4.118-4.321,4.572-9.66,2.743-14.909c1.809-1.095,1.915-3.323,1.165-4.818
c-1.506-3.002-1.847-6.402-3.567-9.127c-1.416-2.24-4.202-4.437-6.623-2.136c-0.743,0.706-1.311,2.096-0.819,3.353
c0.113,0.288,0.616,0.545,0.568,0.69c-0.188,0.572-1.152,0.967-1.163,1.448c-0.053,2.641-1.737,5.309-0.625,7.656
c1.363,2.876,2.809,6.155,4.003,9.291c-2.179,3.736-0.355,8.06-3.45,11.374c-0.24,0.258-0.225,0.939-0.009,1.296
c0.516,0.858,1.231,1.575,2.09,2.091c0.357,0.213,0.972,0.217,1.324-0.002C379.553,227.106,380.256,226.247,381.329,225.583z"/>
<path id="path518" d="M492.233,207.377c2.451,3.164,2.964,8.099-0.653,10.554c0.971,5.842,6.888,2.348,10.594,1.412
c-0.191-0.685,0.208-1.292,0.708-1.301c1.866-0.026,3.066-1.849,4.941-1.523c0.767-2.75,3.659-3.989,4.796-6.425
c3.048-6.524,2.004-14.069-2.559-19.8c-0.356-0.449,0.025-1.361-0.192-2c-1.335-3.904-4.986-4.46-8.401-5.675
c-2.078-6.842-3.245-13.959-6.354-20.481c-2.851-0.441-4.082-3.512-6.443-4.783c-2.354-1.27-3.355,1.519-3.284,3.365
c0.014,0.362,0.812,0.757,0.512,1.402c-0.136,0.29-0.595,0.486-0.595,0.722c0.002,0.238,0.394,0.47,0.629,0.707
c-1.62,1.448-4.134,2.29-4.653,4.312c-1.686,6.55,2.857,12.068,5.804,17.72c1.044,2.004-0.256,4.249-1.598,6.381
c-0.773,1.227-0.583,3.217-0.097,4.729C486.714,200.806,489.521,203.876,492.233,207.377z"/>
<path id="path522" d="M426.622,239.84c-2.626,3.268-8.65,7.804-3.5,11.208c0.343,0.228,0.996,0.234,1.302-0.002
c3.568-2.763,7.104-4.357,11.405-5.385c0.22-0.051,0.703,0.773,1.354,0.489c2.849-1.242,6.397-1.139,8.487-3.501
c6.651,0.396,12.946-1.575,18.934-3.884c2.051-0.791,4.293-1.778,6.412-2.665c2.431-1.017,4.557-2.655,6.521-4.67
c0.233-0.24,0.858-0.082,1.331-0.082c-0.07-1.523,1.628-1.748,2.063-2.846c0.163-0.41-0.102-1.109,0.133-1.289
c3.775-2.878,5.399-6.441,3.336-10.638c-0.504-1.021-0.942-2.112-1.941-2.952c-1.916-1.608-3.862-0.101-5.711-0.637
c-0.28,1.108-1.567,0.805-2.249,1.155c-1.517,0.775-3.87-0.258-5.387,0.515c-2.405,1.227-4.598,1.526-7.106,2.191
c-0.552,0.145-1.925-0.025-2.208,1.083c-0.236-0.237-0.497-0.65-0.685-0.611c-3.369,0.699-5.595,1.077-7.892,4.064
c-0.182,0.235-0.962-0.081-1.243,0.157c-1.688,1.427-2.403,3.605-4.349,4.792c-0.354,0.217-0.977-0.079-1.319,0.148
c-1.141,0.761-1.787,1.893-2.922,2.682c-0.581,0.404-1.287-0.169-1.229-0.622c0.433-3.438,1.585-6.593,0.569-9.905
c3.667-4.449,8.111-7.891,11.301-12.713c0.025-3.824,1.248-7.613,1.049-11.28c-0.019-0.341-0.526-1.635-0.748-2.248
c-0.552-1.508,1.049-3.39-0.441-4.668c-2.479-2.124-4.761-0.578-6.216,1.953c-3.245,0.688-6.893,1.912-9.679-0.267
c-1.778-1.39-2.799-2.989-4.21-4.854c-1.738-2.299-1.147-4.834-1.023-7.596c0.011-0.226-0.546-0.466-0.546-0.703
c0.002-0.238,0.391-0.47,0.627-0.706c-1.246-1.105-1.731-2.974-3.531-3.532c0.538-1.928-0.654-3.489-2.192-4.022
c-3.522-1.22-6.483,2.156-9.823,2.285c-0.908,0.034-1.732-1.799-2.878-2.373c-0.764-0.381-2.006-0.439-2.646,0.03
c-1.215,0.89-2.255,1.091-3.593,1.453c-2.854,0.77-5.11,2.701-7.725,4.211c-2.622,1.513-4.31,4.05-6.216,6.381
c-1.661,2.034-1.901,6.296,0.605,7.179c3.254,1.148,5.557-3.625,9.027-3.049c0.551,0.09,0.915,0.639,0.721,1.324
c0.688,0.193,1.071-0.212,1.412-0.706c1.515,1.799,3.57,2.394,5.227,3.936c1.714,1.596,4.796,0.858,6.589,2.619
c2.698,2.652,1.712,7.386,5.136,9.69c-1.034,2.318-2.106,4.573-2.698,7.092c-0.497,2.129,1.258,4.243,3.396,4.082
c2.222-0.166,2.684-1.506,3.54-3.406c0.472,0.472,1.3,0.996,1.228,1.377c-0.807,4.214-2.62,7.733-3.429,12.025
c-0.104,0.56-0.644,0.917-1.33,0.722c-0.826,7.326-7.98,11.553-12.475,17.141c-0.712,0.886-0.719,3.092,0.004,3.803
c2.478,2.449,5.938-0.281,8.938-1.169c0.376-2.129,1.893-3.792,4.245-3.694c0.452,0.018,0.866-0.939,1.438-1.169
c0.614-0.244,1.501,0.152,2.007-0.198c3.053-2.11,5.539-4.063,8.606-6.162c0.339-0.231,0.946,0.05,1.328-0.141
c0.574-0.286,0.904-0.969,1.475-1.296c0.614-0.353,1.041,0.159,1.383,0.653c-1.142,0.616-1.147,2.306-2.176,2.663
c-1.367,0.473-2.358,1.379-3.549,2.168c-0.516,0.341-1.68-0.097-1.862,0.219C429.966,237.508,427.875,238.281,426.622,239.84z"/>
<path id="path526" d="M328.785,152.602c0,0-16.312-5.071-36.019,40.257c0,0-4.238,9.181-8.475,12.712
c-4.238,3.531-24.013,9.888-27.544,16.95l-18.363,28.25c0,0,26.131-28.25,31.782-32.488c0,0,14.125-14.832,8.475-2.825
c0,0-24.719,19.069-22.601,35.313c0,0-9.887,25.425-11.3,28.957c0,0,28.25-56.5,32.488-58.62c4.237-2.119,6.356-2.119,4.237,4.238
c-2.119,6.357-2.825,35.313-7.769,38.844c0,0,14.125-36.02,12.712-41.669c0,0,5.65-6.356,9.888,2.825l-2.119,28.25l7.769,21.188
c0,0-4.237-19.775-1.413-47.319c0,0-3.531-18.363,3.531-8.475c7.062,9.888,24.013,20.481,24.013,28.957
c0,0-9.181-31.075-25.425-39.55l-7.063,10.594l-2.119-3.531c0,0-6.356-1.413,1.413-13.419c7.769-12.006,7.063-13.419,7.063-13.419
s11.3,12.713,14.125,12.713c0,0,23.307-13.419,25.425,29.663c0,0,12.007-25.425-4.237-37.432c0,0-26.132-3.531-24.013-12.712
l12.713-21.894c6.356-9.182,3.531-4.238,3.531-4.238L328.785,152.602z"/>
<path id="path530" d="M293.473,181.558c0,0-22.6,0-28.25,9.181l-12.713,16.95c0,0,30.369-17.656,37.432-19.775
S293.473,181.558,293.473,181.558z"/>
<path id="path534" d="M222.847,192.858c0,0-3.531,2.119-4.238,7.063c-0.706,4.944-4.944,5.65-3.531,10.594
c1.413,4.944,4.944,9.182,4.944,2.119c0-7.063,2.825-10.594,4.238-12.712C225.672,197.802,228.497,190.033,222.847,192.858z"/>
<path id="path538" d="M207.31,300.916c0,0-14.832-7.063-20.481-13.419c-5.65-6.356-4.852,2.765-13.419,2.119
c-10.324-0.779-8.475-28.957-8.475-28.957l-7.063,13.418c0,0-2.119,25.425,12.006,21.188c6.898-2.069,9.181,0.706,6.356,2.119
c-2.825,1.413,9.887,2.119,4.943,4.944c-4.943,2.825,20.481-6.356,16.244,12.006L207.31,300.916z"/>
<path id="path542" d="M185.063,326.341c0,0-27.191,7.769-33.547-9.181c0,0-8.475,4.237-4.591,9.534
c3.885,5.297,6.003,6.003,6.003,6.003s9.534,2.119,8.475,3.531c-1.06,1.413-5.297,7.416-5.297,7.416S174.115,333.05,185.063,326.341
z"/>
<path id="path546" fill="#FFFFFF" d="M588.337,464.416c-0.754,3.768-3.704,5.182-7.063,6.355c-3.386-1.69-7.973-7.176-11.301-3.53
c-0.837-0.849-2.213-0.954-2.819-2.123c-0.82-1.585-0.342-3.433-0.944-4.841c-0.962-2.246-2.214-4.658-1.886-7.161
c3.188-1.258,4.239-4.623,3.401-7.735c-0.122-0.454-0.879-0.802-0.525-1.418c0.329-0.57,0.89-0.972,1.36-1.441
c-0.237,0.237-0.493,0.648-0.689,0.613c-1.077-0.188-0.857-1.313-0.628-1.995c1.032-3.083,4.589-3.549,6.969-1.443
c0.452-0.998,1.352-0.655,2.118-0.706c-0.088-1.022,0.633-1.953,0.982-2.694c0.913-1.938,3.791,0.014,5.197-1.065
c1.899-1.457,3.776-2.691,5.681-1.628c3.193,1.789,6.212,3.93,8.327,7.004c1.017,1.473,1.439,3.733,1.338,5.426
c-0.067,1.143-2.507,0.521-3.111,2.161c-1.139,3.086,2.095,4.003,3.43,6.364c0.35,0.616-0.117,1.153-0.673,1.326
c-0.726,0.227-2.11-0.107-1.866,0.691C597.351,462.212,592.484,463.409,588.337,464.416z"/>
<path id="path550" fill="#FFFFFF" d="M571.385,499.022c-0.012-3.068-2.839-6.17-0.704-9.183c0.238,0.237,0.471,0.627,0.706,0.627
c0.238,0,0.471-0.39,0.706-0.627c2.641,3.913,9.088,5.552,8.837,10.576c-0.038,0.79-1.958,2.41-0.36,3.55
c-3.201,2.38-3.3,6.564-4.944,9.887c-2.186-0.505-4.325-1.146-6.356-2.117c0.622-2.624,0.415-5.599,1.863-7.929
C571.896,502.575,571.391,500.67,571.385,499.022z"/>
<path id="path554" fill="#CCCCCC" d="M277.935,483.132c0,0-29.765,17.896-4.944-9.182c15.538-16.95,33.194-26.838,33.194-26.838
s18.362-7.771,24.719-9.89c6.355-2.119,33.193-11.301,38.845-12.007c5.649-0.706,22.6-7.769,34.606-0.706
c12.006,7.063,26.131,14.831,26.131,14.831s-28.956-14.831-35.313-10.594c-6.356,4.237-19.069,3.531-29.663,9.182
c0,0-26.131,7.771-31.781,11.303c-5.649,3.53-24.013,24.013-26.837,22.601c-2.825-1.413,0.706-2.119,2.825-7.063
c2.119-4.943-1.412-7.77-15.538,3.531C280.054,479.601,277.935,483.132,277.935,483.132z"/>
<path id="path558" d="M291.01,472.596c0,0,2.49-23.022,17.459-20.084c0,0,14.523-7.361,19.33-10.837c0,0,14.37-3.006,16.685-4.095
c32.627-15.361,58.614-7.383,59.581-9.359c0.965-1.977,35.614,10.59,41.986,17.806c0.69,0.781-18.063-9.884-35.188-13.223
c-14.607-2.85-52.748,0.438-72.005,10.211c-5.249,2.664-21.043,12.877-25.513,12.682C308.878,455.498,291.01,472.596,291.01,472.596
z"/>
<path id="path562" fill="#CCCCCC" d="M284.292,517.738c0,0-26.838-4.237,2.825-7.063c0,0,31.782-3.531,38.844-12.713
c0,0,24.013-16.244,28.956-16.95c4.944-0.706,57.913-13.419,58.619-17.656c0.707-4.236,10.595-4.236,13.419-2.824
c2.825,1.413,1.413,3.53-3.531,4.943c-4.943,1.412-60.031,30.369-71.332,32.487c-11.3,2.119-31.781,15.538-40.256,17.656
C303.36,517.738,284.292,517.738,284.292,517.738z"/>
<path id="path566" d="M318.757,504.676c0,0-15.153-1.464,0.033-2.909c0,0,15.566-6.046,19.183-10.748c0,0,12.296-8.316,14.826-8.678
c2.531-0.362,27.18-6.872,27.542-9.04c0.362-2.17,60.51-24.384,68.314-18.751c5.14,3.709-12.343,0.748-29.354,8.535
c-2.393,1.095-62.164,26.85-67.95,27.934c-5.785,1.087-16.271,7.956-20.611,9.04C326.402,501.145,318.757,504.676,318.757,504.676z"
/>
<path id="path570" d="M304.773,508.557c0,0,9.181-0.706,7.063,2.119c-2.119,2.825-6.357,1.412-6.357,1.412L304.773,508.557z"/>
<path id="path574" d="M292.061,511.382c0,0,9.181-0.706,7.063,2.119c-2.119,2.825-6.356,1.412-6.356,1.412L292.061,511.382z"/>
<path id="path578" d="M273.698,514.207c0,0,9.181-0.706,7.063,2.119c-2.119,2.824-6.356,1.412-6.356,1.412L273.698,514.207z"/>
<path id="path582" d="M260.279,515.619c0,0,9.181-0.706,7.063,2.119c-2.118,2.825-6.356,1.412-6.356,1.412L260.279,515.619z"/>
<path id="path586" d="M328.079,445.7c0,0,7.77,0,5.649,2.825c-2.119,2.824-7.769,2.117-7.769,2.117L328.079,445.7z"/>
<path id="path590" d="M310.423,455.588c0,0,11.487-3.78,7.063,2.118c-2.118,2.825-6.356,1.413-6.356,1.413L310.423,455.588z"/>
<path id="path594" d="M290.648,464.063c0,0,9.181-0.705,7.063,2.119c-2.118,2.825-6.356,1.412-6.356,1.412L290.648,464.063z"/>
<path id="path598" d="M277.229,474.656c0,0,9.181-0.706,7.063,2.119c-2.118,2.824-6.356,1.411-6.356,1.411L277.229,474.656z"/>
<path id="path602" d="M265.223,483.132c0,0,9.181-0.706,7.063,2.118c-2.119,2.825-6.356,1.413-6.356,1.413L265.223,483.132z"/>
<path id="path606" d="M334.228,494.427c0,0,12.221-0.938,9.4,2.819c-2.82,3.761-8.461,1.881-8.461,1.881L334.228,494.427z"/>
<path id="path610" d="M352.59,485.951c0,0,12.221-0.939,9.4,2.82c-2.819,3.761-8.461,1.88-8.461,1.88L352.59,485.951z"/>
<path id="path614" d="M371.659,478.183c0,0,12.22-0.938,9.399,2.819c-2.819,3.761-8.461,1.881-8.461,1.881L371.659,478.183z"/>
<path id="path618" d="M390.021,469.708c0,0,12.221-0.939,9.399,2.819c-2.819,3.761-8.461,1.88-8.461,1.88L390.021,469.708z"/>
<path id="path622" d="M341.29,437.926c0,0,12.22-0.938,9.4,2.82c-2.82,3.761-9.874,3.293-9.874,3.293L341.29,437.926z"/>
<path id="path626" d="M358.946,432.276c0,0,12.22-0.939,9.399,2.818c-2.818,3.762-10.58,3.293-10.58,3.293L358.946,432.276z"/>
<path id="path630" d="M318.898,502.907c0,0,9.181-0.706,7.063,2.118c-2.119,2.824-6.355,1.413-6.355,1.413L318.898,502.907z"/>
<path id="path634" fill="#992600" d="M189.653,327.753c0,0-7.769,15.538-8.475,21.188c0,0,1.413-15.538,3.531-19.069
C186.828,326.341,189.653,327.753,189.653,327.753z"/>
<path id="path638" fill="#992600" d="M157.165,352.472c0,0-5.65,25.425-4.944,30.369c0,0-2.119-20.481-1.412-22.6
C151.515,358.123,157.165,352.472,157.165,352.472z"/>
<path id="path642" fill="#CCCCCC" d="M193.891,220.755l-0.353,5.65l-3.885,0.354c0,0,25.072,22.247,26.132,35.666
C215.785,262.425,217.197,247.946,193.891,220.755z"/>
<path id="path646" d="M200.925,222.989c-0.761-0.734-0.374-2.05-1.095-2.509c-1.428-0.911,2.292-1.012,1.889-2.276
c-0.676-2.129-0.346-2.167-0.562-4.419c-0.101-1.056,0.938-3.775,1.618-4.552c2.553-2.917,0.215-8.094,3.111-10.833
c0.537-0.51,1.201-1.485,1.704-2.223c1.164-1.7,3.254-2.562,4.931-4.024c0.562-0.487,0.207-1.948,1.211-1.785
c1.261,0.203,3.452-0.026,3.373,1.458c-0.2,3.743-2.546,6.78-4.806,9.725c0.796,1.243-0.013,2.364-0.514,3.348
c-2.357,4.626-2.023,9.642-2.331,14.657c-0.009,0.15-0.551,0.288-0.537,0.381c0.623,4.123,1.654,8.005,3.207,11.941
c0.646,1.642,1.478,3.222,1.743,4.859c0.196,1.211,0.378,2.682-0.343,3.927c3.593,5.103,1.282,9.783,3.346,16.018
c0.365,1.104,3.353,4.483,2.535,4.199c-4.437-1.538-4.635-2.241-4.947-3.57c-0.258-1.1-0.84-3.531-1.259-4.594
c-0.113-0.29-0.415-3.616-0.553-3.832c-2.671-4.206-0.274-3.895-2.692-8.059c-2.521-1.201-4.227-3.15-6.21-5.202
c-0.35-0.36,1.668-1.638,1.349-2.014c-1.928-2.276-3.964-3.63-3.371-6.267C201.997,226.126,202.238,224.26,200.925,222.989z"/>
<path id="path650" d="M194.597,226.052c0,0,0.707,12.006,4.944,14.832c4.238,2.825,2.119,1.413-3.531-0.706
c-5.65-2.119-3.531-3.531-3.531-3.531s-4.944,0.706-0.706,4.237c4.237,3.531,10.594,7.769,7.769,7.769s-16.244-7.063-16.244-12.006
c0-4.944-1.766-12.183-1.766-12.183s1.942-1.413,10.417-1.236C191.948,223.228,194.42,224.463,194.597,226.052z"/>
<path id="path654" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M193.184,258.894c0,0-15.043-4.928-47.672,1.059
c0,0,15.946-3.669,49.085,0.353C212.783,262.513,193.184,258.894,193.184,258.894z"/>
<path id="path658" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M196.889,258.768c0,0-14.56-6.211-47.586-3.067
c0,0,16.205-2.276,48.871,4.596C216.103,264.068,196.889,258.768,196.889,258.768z"/>
<path id="path662" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M200.045,258.932c0,0-14.058-7.276-47.226-6.596
c0,0,16.329-1.066,48.395,8.217C218.811,265.647,200.045,258.932,200.045,258.932z"/>
<path id="path666" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M202.288,259.326c0,0-12.049-7.604-41.842-9.543
c0,0,14.724,0.3,42.764,11.086C218.599,266.789,202.288,259.326,202.288,259.326z"/>
<path id="path670" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M405.838,277.894c0,0-1.642,1.137-1.264-0.948
c0.38-2.085,50.185-25.339,56.564-24.897C461.14,252.048,407.732,275.365,405.838,277.894z"/>
<path id="path674" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M399.846,279.021c0,0-1.547,1.263-1.333-0.846
c0.214-2.108,48.04-29.202,54.436-29.262C452.947,248.914,401.537,276.354,399.846,279.021z"/>
<path id="path678" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M394.044,281.449c0,0-1.462,1.363-1.388-0.755
c0.074-2.117,35.063-29.479,52.389-32.788C445.045,247.906,413.21,262.255,394.044,281.449z"/>
<path id="path682" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M388.966,284.739c0,0-1.314,1.226-1.248-0.68
c0.066-1.907,31.557-26.532,47.147-29.509C434.865,254.55,406.216,267.464,388.966,284.739z"/>
<path id="path686" fill="#CCCCCC" d="M333.023,545.988c0,0-26.838-4.237,2.824-7.063c0,0,31.781-3.531,38.845-12.712
c0,0,24.013-16.244,28.956-16.95c4.943-0.707,33.899-7.063,34.606-11.301c0.706-4.237,11.3-8.475,14.125-7.063
c2.825,1.413,2.825,17.655-2.119,19.068c-4.942,1.412-38.138,14.125-49.438,16.244c-11.301,2.118-31.782,15.537-40.257,17.656
C352.092,545.988,333.023,545.988,333.023,545.988z"/>
<path id="path690" d="M461.915,479.953c0,0-5.297,2.825-7.416,7.416c0,0-11.3,18.716-36.372,24.366c0,0-40.609,15.891-54.382,19.422
c0,0-23.659,8.828-36.727,7.416c0,0-12.358,0.353-1.411,3.178c0,0,35.666-3.531,41.669-6.709c0,0,27.544-9.182,32.841-13.772
c5.297-4.59,37.432-13.419,41.315-16.949C445.317,500.789,462.621,485.957,461.915,479.953z"/>
<path id="path694" d="M358.24,535.589c0,0,9.231-0.398,7.195,2.336c-2.034,2.737-6.356,1.193-6.356,1.193L358.24,535.589z"/>
<path id="path698" d="M345.523,537.977c0,0,9.23-0.398,7.196,2.336c-2.036,2.736-6.357,1.195-6.357,1.195L345.523,537.977z"/>
<path id="path702" d="M327.11,540.18c0,0,9.231-0.399,7.195,2.336c-2.034,2.735-6.356,1.193-6.356,1.193L327.11,540.18z"/>
<path id="path706" d="M313.631,541.141c0,0,9.232-0.398,7.197,2.336c-2.036,2.736-6.358,1.193-6.358,1.193L313.631,541.141z"/>
<path id="path710" d="M387.432,522.526c0,0,12.289-0.531,9.578,3.108c-2.708,3.642-8.463,1.59-8.463,1.59L387.432,522.526z"/>
<path id="path714" d="M405.645,514.714c0,0,10.521-5.828,9.578,3.109c-0.477,4.513-8.463,1.589-8.463,1.589L405.645,514.714z"/>
<path id="path718" d="M421.768,509.745c0,0,12.642-6.534,9.579,3.108c-1.374,4.326-8.465,1.59-8.465,1.59L421.768,509.745z"/>
<path id="path722" d="M438.566,501.226c0,0,7.695-8.652,9.578,3.109c0.717,4.481-8.464,1.59-8.464,1.59L438.566,501.226z"/>
<path id="path726" d="M372.28,530.444c0,0,9.23-0.401,7.196,2.336c-2.035,2.733-6.359,1.192-6.359,1.192L372.28,530.444z"/>
<path id="path730" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M435.138,316.105c0,0-1.282,1.174-1.284-0.717
c0-1.889,30.871-25.309,46.484-27.752C480.338,287.636,451.913,299.517,435.138,316.105z"/>
<path id="path734" d="M440.374,428.748c0,0,38.847,39.553,55.09,45.908c0,0,16.244,19.774,9.183,65.683
c0,0-5.65,13.419-11.301-23.307c0,0,5.649-44.494-14.125-16.244c0,0-14.834-17.479-3.533-16.95c0,0,5.651,3.531,6.357,0.706
c0.707-2.825-13.42-26.838-43.789-52.265C407.887,406.854,440.374,428.748,440.374,428.748z"/>
<path id="path738" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M337.261,497.257c0,0-0.354-3.178,2.825-1.766
c3.178,1.412,169.503,12.358,225.298,54.734C565.384,550.227,485.576,509.264,337.261,497.257z"/>
<path id="path742" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M355.623,489.488c0,0-0.354-3.18,2.825-1.767
c3.179,1.412,244.367-0.354,286.036,56.854C644.484,544.576,605.641,500.082,355.623,489.488z"/>
<path id="path746" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M376.104,482.426c0,0-0.353-3.179,2.825-1.766
c3.18,1.412,309.343-21.541,351.013,35.666C729.941,516.326,712.991,471.125,376.104,482.426z"/>
<path id="path750" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M393.762,473.95c0,0-0.354-3.178,2.824-1.767
c3.179,1.413,218.941-66.742,260.611-9.533C657.197,462.65,633.537,419.214,393.762,473.95z"/>
<path id="path754" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M291.354,514.207c0,0-0.353-3.178,2.825-1.766
c3.178,1.412,34.606,5.297,38.138,73.804C332.317,586.245,319.604,512.088,291.354,514.207z"/>
<path id="path758" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M275.816,517.032c0,0-0.353-3.18,2.825-1.767
c3.178,1.412,28.25-6.71,23.306,61.797C301.948,577.063,304.066,514.913,275.816,517.032z"/>
<path id="path762" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M261.691,517.738c0,0-0.354-3.179,2.825-1.767
c3.179,1.412,30.369,2.473,8.475,42.022C272.991,557.995,289.941,515.619,261.691,517.738z"/>
<path id="path766" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M345.252,439.457c0,0-0.784,3.529,1.951,1.381
c28.37-22.292,85.65-126.292,183.971-136.239C531.174,304.599,463.536,283.217,345.252,439.457z"/>
<path id="path770" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M365.027,436.278c0,0-2.406-2.106,0.892-3.21
c3.298-1.104,201.831-129.115,271.194-115.05C637.113,318.018,589.252,304.758,365.027,436.278z"/>
<path id="path774" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M328.229,447.053c0,0-0.897,2.823,2.122,1.101
c15.848-9.04,22.229-110.054,99.171-112.271C429.521,335.882,372.297,309.903,328.229,447.053z"/>
<path id="path778" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M293.053,466.521c0,0-1.902,2.271,1.546,1.821
c18.091-2.352,55.884-75.222,134.348-66.254C428.947,402.089,372.507,376.759,293.053,466.521z"/>
<path id="path782" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M312.895,455.704c0,0-1.432,2.594,1.868,1.49
c17.303-5.78,40.403-84.549,119.13-90.813C433.893,366.382,373.639,352.357,312.895,455.704z"/>
<path id="path786" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M280.623,475.559c0,0-1.542,1.841,1.252,1.478
c14.653-1.905,45.265-60.929,108.822-53.665C390.696,423.37,344.979,402.854,280.623,475.559z"/>
<path id="path790" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M267.206,485.992c0,0-1.775,1.845,1.035,1.637
c7.359-0.546,61.455-58.951,94.063-31.58C362.303,456.049,341.089,422.99,267.206,485.992z"/>
<path id="path794" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M389.974,429.627c0,0-2.12-2.392,1.291-3.071
c3.411-0.679,216.529-102.579,283.56-79.862C674.823,346.693,629.021,327.494,389.974,429.627z"/>
<path id="path798" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M330.904,543.164c0,0-0.354-3.179,2.824-1.768
c3.179,1.413,30.369,2.474,8.476,42.022C342.204,583.42,359.154,541.045,330.904,543.164z"/>
<path id="path802" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M349.268,540.339c0,0-0.354-3.179,2.824-1.766
c3.18,1.412,34.607,5.297,38.14,73.804C390.23,612.377,377.518,538.22,349.268,540.339z"/>
<path id="path806" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M361.273,537.514c0,0-0.354-3.179,2.824-1.766
c3.179,1.412,46.613,7.416,88.282,64.622C452.381,600.37,389.523,535.395,361.273,537.514z"/>
<path id="path810" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M374.736,533.931c0,0-0.771-3.104,2.564-2.125
c3.337,0.979,39.416-2.375,106.684,57.969C483.984,589.773,402.455,528.076,374.736,533.931z"/>
<path id="path814" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M393.1,526.162c0,0-0.771-3.104,2.565-2.126
c3.337,0.979,64.841,8.926,156.119,70.681C551.784,594.717,420.818,520.308,393.1,526.162z"/>
<path id="path818" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M321.723,505.732c0,0-0.353-3.18,2.825-1.767
c3.179,1.412,97.464,6.003,151.14,53.322C475.688,557.289,414.064,513.545,321.723,505.732z"/>
<path id="path822" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M304.066,512.795c0,0-0.353-3.179,2.825-1.766
c3.179,1.412,46.613,7.415,88.282,64.622C395.174,575.651,332.317,510.676,304.066,512.795z"/>
<path id="path826" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M412.306,518.021c0,0-0.997-3.037,2.403-2.308
s65.321,4.147,160.88,59.049C575.589,574.764,438.462,514.036,412.306,518.021z"/>
<path id="path830" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M427.138,513.785c0,0-0.998-3.039,2.402-2.309
c3.401,0.729,65.322,4.147,160.88,59.049C590.42,570.525,454.354,509.092,427.138,513.785z"/>
<path id="path834" fill="#FFFFFF" stroke="#000000" stroke-width="0.1" d="M444.088,504.957c0,0-0.998-3.039,2.402-2.308
c3.399,0.729,79.447,8.385,237.863,68.936C684.354,571.585,471.303,500.264,444.088,504.957z"/>
<path id="path838" d="M247.566,517.032c0,0,9.182-0.706,7.063,2.118s-6.356,1.412-6.356,1.412L247.566,517.032z"/>
<path id="path842" d="M301.948,541.751c0,0,9.181-0.706,7.063,2.119c-2.119,2.825-6.356,1.412-6.356,1.412L301.948,541.751z"/>
<path id="path846" d="M286.41,541.045c0,0,9.182-0.706,7.063,2.119c-2.119,2.824-6.356,1.412-6.356,1.412L286.41,541.045z"/>
<path id="path850" d="M118.022,520.177c0,0,8.908,2.336,5.98,4.313c-2.926,1.978-6.469-0.745-6.469-0.745L118.022,520.177z"/>
<path id="path854" d="M121.554,503.227c0,0,8.908,2.336,5.98,4.313c-2.926,1.978-6.469-0.745-6.469-0.745L121.554,503.227z"/>
<path id="path858" d="M108.841,495.458c0,0,8.908,2.336,5.98,4.312c-2.925,1.979-6.469-0.744-6.469-0.744L108.841,495.458z"/>
<path id="path862" fill="#CCCCCC" d="M249.685,627.914c0,0-2.825,0-9.888,3.531c-3.531,0-23.307,6.355-33.194,24.013
C206.603,655.458,228.497,638.508,249.685,627.914z"/>
<path id="path866" fill="#CCCCCC" d="M404.56,791.494c0.249,0.456,0.348,1.197,0.862,1.228c1.161,0.07,3.339,0.603,3.118-0.521
c-1.497-7.604-3.041-16.319-10.338-19.51c-1.129-0.493-3.675,0.235-3.806,1.797c-0.225,2.69-0.432,5.072,0.114,7.661
c0.529,2.509,4.34,2.525,5.959,0.083C402.123,785.184,402.886,788.438,404.56,791.494z"/>
<path id="path870" fill="#CCCCCC" d="M385,799.854c1.321,2.494,1.097,5.776,3.595,6.771c1.308,0.519,4.573-1.202,3.835-3.099
c-1.416-3.64-2.101-7.594-4.554-10.79c-0.353-0.463,0.071-1.403-0.212-1.982c-1.048-2.154-3.07-3.452-5.556-2.871
c-1.97,3.891,0.058,7.648,2.744,10.666C385.094,798.816,384.801,799.48,385,799.854z"/>
<path id="path874" fill="#CCCCCC" d="M315.077,790.689c-0.19-0.666-0.258-1.483,0.033-2.052c0.938-1.822,2.338-3.805,1.742-5.608
c-0.613-1.864-2.585-1.543-3.731-0.538c-2.004,1.755-2.091,4.979-3.312,7.379c-0.347,0.682-0.256,1.692-1.034,2.383
c-0.838,0.744-1.613,3.435-1.444,4.442c0.094,0.553-0.229,18.047,0.163,17.583c1.093-1.295,6.478-18.481,6.6-20.058
C314.194,792.932,315.487,792.11,315.077,790.689z"/>
<path id="path878" fill="#CCCCCC" d="M269.81,778.697c4.651-4.413,9.577-9.642,8.796-16.195c-0.205-1.723-3.339-0.792-3.669,0.701
c-1.416,6.4-5.016,11.099-9.55,15.322c-3.877,3.613-7.165,14.814-7.58,15.713C264.334,784.958,268.319,780.109,269.81,778.697z"/>
<path id="path882" fill="#CCCCCC" d="M245.843,768.167c0.923-0.653,0.39-1.521,0.773-2.106c1.683-2.574,3.979-4.773,4.012-7.844
c0.005-0.489-0.662-1.034-1.254-0.639c-0.489,0.324-1.093,0.555-1.284,0.784c-3.584,4.322-6.056,9.04-8.604,14.005
c-0.323,0.63-2.343,8.56-1.79,8.756c0.422,0.148,3.459-7.232,3.83-7.434C243.756,772.479,243.777,769.627,245.843,768.167z"/>
<path id="path886" fill="#CCCCCC" d="M275.387,802.674c0.784-1.534,3.567-3.656,3.367-5.226c-0.208-1.64,0.618-4.188-0.992-2.973
c-2.22,1.675-8.309,4.057-8.786,14.312C268.93,809.795,274.182,805.04,275.387,802.674z"/>
<path id="path890" fill="#CCCCCC" d="M300.889,772.344c0.706-1.179,1.956-0.344,2.767-0.809c1.144-0.656,2.223-1.643,2.738-2.788
c1.713-3.794,4.836-7.008,5.089-11.234c-2.634-2.479-3.831,1.121-4.944,2.825c-2.336-2.908-4.1,0.4-6.395,1.316
c-0.124,0.05-0.5-0.563-0.632-0.516c-2.078,0.776-3.279,2.687-5.041,4.064c-0.302,0.236-1.017-0.082-1.276,0.158
c-1.151,1.064-2.869,1.639-3.364,2.843c-1.959,4.78-7.504,8.479-10.835,21.795c0.672,1.604,7.966-11.728,8.826-12.959
c1.476-2.112,1.685,2.933,3.938,1.757c0.09-0.048,0.418,0.372,0.655,0.608c0.342-0.494,0.727-0.898,1.413-0.706
c0-0.706-0.237-1.688,0.118-1.969c2.184-1.726,2.036-3.61,3.413-5.801C298.166,772.324,300.039,771.055,300.889,772.344z"/>
<path id="path894" fill="#CCCCCC" d="M406.474,868.395c0,0,13.066-36.019,5.298-55.794c0,0,20.129,38.139,12.007,57.913
c0,0-0.706-18.361-7.77-27.189C416.009,843.323,408.946,865.923,406.474,868.395z"/>
<path id="path898" fill="#CCCCCC" d="M380.343,863.805c0,0,9.534-15.538-4.591-48.024c0,0-1.413,36.019-13.419,55.439
C362.333,871.22,387.405,835.554,380.343,863.805z"/>
<path id="path902" fill="#CCCCCC" d="M362.686,860.273c0,0-0.353-35.313,0.354-40.61c0,0-6.709,29.31-24.719,46.26
C338.32,865.923,363.745,844.735,362.686,860.273z"/>
<path id="path906" fill="#CCCCCC" d="M345.736,803.771c0,0,10.594,24.014-7.063,56.502c0,0,11.301-21.541,2.825-33.9
C341.498,826.373,346.089,820.369,345.736,803.771z"/>
<path id="path910" fill="#CCCCCC" d="M311.836,859.566c0,0-1.766-27.545,1.412-31.429c0,0,0.354-11.301-0.354-13.065
c0,0,7.063-10.946,7.416,2.119c0,0,2.473,13.771,7.416,21.894c0,0,6.356,9.535,6.003,20.835
C333.729,859.92,316.073,806.598,311.836,859.566z"/>
<path id="path914" fill="#CCCCCC" d="M305.479,810.835c0,0-11.653,19.069-14.831,52.616c0,0-2.472-10.947,4.237-36.372
C294.885,827.079,302.301,799.888,305.479,810.835z"/>
<path id="path918" fill="#CCCCCC" d="M266.988,845.795c0,0,8.828-9.535,11.3-18.363c0,0,6.356-27.896-4.943-12.712
c0,0,0.353,14.125-14.125,27.19C259.219,841.91,267.694,837.673,266.988,845.795z"/>
<path id="path922" fill="#CCCCCC" d="M256.748,836.967c0,0,6.003-30.723,7.416-32.135c0,0,3.178-6.003-1.766-0.354
c0,0-15.538,33.9-22.6,45.555C239.797,850.032,253.922,833.788,256.748,836.967z"/>
<path id="path926" fill="#CCCCCC" d="M246.507,807.657c0,0,20.481-39.552-18.01,6.003
C228.497,813.66,247.919,796.356,246.507,807.657z"/>
<path id="path930" fill="#CCCCCC" d="M219.316,781.879c0,0,8.475-33.193,13.065-32.842c0,0,14.479-15.891,2.825,2.825
c0,0-10.594,16.95-9.535,34.254C225.672,786.116,224.613,769.166,219.316,781.879z"/>
<path id="path934" fill="#CCCCCC" d="M802.508,761.748c0,0-21.188-17.656-25.602-23.836c0,0,23.836,32.664,23.836,45.023
C800.742,782.938,805.156,769.693,802.508,761.748z"/>
<path id="path938" fill="#CCCCCC" d="M812.219,722.904c0,0-37.078-26.484-43.259-39.728c0,0,46.79,52.086,46.79,60.031
C815.75,743.209,816.633,727.318,812.219,722.904z"/>
<path id="path942" fill="#CCCCCC" d="M842.234,450.995c0,0-21.188-14.125-23.836-10.594c0,0,18.539,11.477,22.952,26.483
C841.352,466.886,838.703,450.995,842.234,450.995z"/>
<path id="path946" fill="#CCCCCC" d="M857.242,593.13l-30.898-21.188c0,0,33.547,30.017,34.431,37.079L857.242,593.13z"/>
<path id="path950" stroke="#000000" d="M167.317,553.402l38.844,8.387"/>
<path id="path954" stroke="#000000" d="M256.041,839.438c0,0-0.883-6.181-16.773,12.358"/>
<path id="path958" stroke="#000000" d="M265.752,848.265c0,0,3.531-11.477-7.946-3.53"/>
<path id="path962" stroke="#000000" d="M361.097,863.271c0,0,2.648-19.422-17.655,3.531"/>
</svg>

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -208,4 +208,5 @@ collections {
#include "edc/efl/tab_bar.edc"
#include "edc/efl/tab_page.edc"
#include "edc/efl/item_container.edc"
#include "edc/efl/group_item.edc"
}

View File

@ -0,0 +1,115 @@
group { "efl/group_item"; nomouse; program_source: "efl";
images.image: "shadow_square_tiny.png" COMP;
images.image: "bevel_out.png" COMP;
images.image: "horizontal_separated_bar_small_glow.png" COMP;
parts {
image { "shadow_vbar";
desc { "default";
rel1.offset: -3 -2;
rel1.to: "base_vbar";
rel2.offset: 2 4;
rel2.to: "base_vbar";
image.normal: "shadow_square_tiny.png";
image.border: 6 6 6 6;
fill.smooth: 0;
}
}
image { "base_vbar";
desc { "default";
image.normal: "vgrad_med_lighter.png";
fill.smooth: 0;
min: 5 13;
TILED_HORIZ(120)
}
}
image { "bevel_vbar";
desc { "default";
rel1.to: "base_vbar";
rel2.to: "base_vbar";
image.normal: "bevel_out.png";
image.border: 1 1 1 1;
image.middle: 0;
fill.smooth: 0;
min: 5 5;
}
}
text { "efl.text";
effect: SHADOW BOTTOM;
scale;
desc { "default";
rel1.offset: 2 3;
rel1.relative: 1.0 0.0;
rel1.to_x: "efl.icon";
rel2.offset: -3 -3;
rel2.relative: 0.0 1.0;
rel2.to_x: "efl.extra";
color: FN_COL_DEFAULT;
color_class: "list_group_item";
text { font: FNBD; size: 10;
min: 1 1;
ellipsis: -1;
align: 0.0 0.5;
text_class: "list_group_item";
}
link.base: "efl,state,enabled";
}
desc { "disabled";
inherit: "default";
color: FN_COL_DISABLE;
color_class: "list_group_item_disabled";
link.base: "efl,state,disabled";
}
}
swallow { "pad"; mouse;
desc { "default";
fixed: 1 0;
align: 0.0 0.5;
rel1.offset: 2 2;
rel2.relative: 0.0 1.0;
rel2.offset: 2 -3;
}
}
swallow { "efl.icon"; mouse;
desc { "default";
fixed: 1 0;
align: 0.0 0.5;
rel1.to_x: "pad";
rel1.relative: 1.0 0.0;
rel1.offset: -1 2;
rel2.to_x: "pad";
rel2.relative: 1.0 1.0;
rel2.offset: -1 -3;
}
}
swallow { "efl.extra"; mouse;
desc { "default";
fixed: 1 0;
align: 1.0 0.5;
rel1.offset: -3 2;
rel1.relative: 1.0 0.0;
rel2.offset: -3 -3;
}
}
image { "bar";
desc { "default";
image.normal: "horizontal_separated_bar_small_glow.png";
image.border: 4 4 4 4;
fill.smooth: 0;
fixed: 0 1;
rel1.relative: 0.0 1.0;
rel1.offset: -3 -6;
rel2.offset: 2 3;
link.base: "efl,state,enabled";
}
desc { "disabled";
inherit: "default";
color: 255 255 255 64;
link.base: "efl,state,disabled";
}
}
}
}

View File

@ -121,15 +121,10 @@ group { "efl/alert_popup";
}
}
group { "efl/anchor_popup";
inherit: "efl/popup";
}
group { "efl/popup/backwall";
alias: "efl/alert_popup/backwall";
alias: "efl/scroll_alert_popup/backwall";
alias: "efl/text_alert_popup/backwall";
alias: "efl/anchor_popup/backwall";
parts {
rect { "base";
desc { "default";

View File

@ -1,5 +1,7 @@
#include <Efl_Ui.h>
static Efl_Ui_Win *win;
static Efl_Ui_Collection *collection;
static Eo *first, *last, *middle;
static int timer = 15;
static int frames = 0;
@ -60,41 +62,115 @@ _first_frame_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_event_callback_del(ev->object, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _first_frame_cb, data);
}
static void
_build_list(int items)
{
collection = efl_add(EFL_UI_LIST_CLASS, win);
efl_content_set(win, collection);
for (int i = 0; i < items; ++i)
{
Eo *il = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, collection);
double r = 10+((double)190/(double)10)*(i%10);
if (i == 0)
first = il;
else if (i == items/2)
middle = il;
else if (i == (items - 1))
last = il;
efl_gfx_color_set(il, r, 10, 10, 255);
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(40, 40+(i%2)*40));
efl_pack_end(collection, il);
}
}
static void
_build_grid(int items)
{
collection = efl_add(EFL_UI_GRID_CLASS, win);
efl_content_set(win, collection);
for (int i = 0; i < items; ++i)
{
Eo *il = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, collection);
double r = 10+((double)190/(double)10)*(i%10);
if (i == 0)
first = il;
else if (i == items/2)
middle = il;
else if (i == (items - 1))
last = il;
efl_gfx_color_set(il, r, 10, 10, 255);
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(80, 150+(i%2)*40));
efl_pack_end(collection, il);
}
}
static void
print_help(void)
{
printf("The following options are optional:\n");
printf(" --list Run the benchmark with the list position manager.\n");
printf(" --grid Run the benchmark with the list position manager.\n");
printf(" --items X Run the benchmark with X items.\n");
}
EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
Eo *win, *item_container, *list;
Eina_Accessor *cml;
const char *part;
int c;
int items = 5000;
Eina_Bool grid = EINA_FALSE;
printf("Started on pid: %d\n", getpid());
cml = efl_core_command_line_command_access(efl_main_loop_get());
EINA_ACCESSOR_FOREACH(cml, c, part)
{
if (c == 0) continue;
if (eina_streq(part, "--items"))
{
c++;
EINA_SAFETY_ON_FALSE_GOTO(eina_accessor_data_get(cml, c, (void**)&part), err);
items = atoi(part);
if (!items)
goto err;
}
else if (eina_streq(part, "--list"))
{
grid = EINA_FALSE;
}
else if (eina_streq(part, "--grid"))
{
grid = EINA_TRUE;
}
else
goto err;
}
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
efl_text_set(efl_added, "Efl.Ui.Item_Container benchmark"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE)
);
list = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS);
item_container = efl_add(EFL_UI_COLLECTION_CLASS, win,
efl_ui_collection_position_manager_set(efl_added, list));
efl_content_set(win, item_container);
printf("Building 5000 objects\n");
for (int i = 0; i < 5000; ++i)
{
Eo *il = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, item_container);
double r = 10+((double)190/(double)10)*(i%10);
if (i == 0)
first = il;
else if (i == 2500)
middle = il;
else if (i == 4999)
last = il;
efl_gfx_color_set(il, r, 10, 10, 255);
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(40, 40+(i%2)*40));
efl_pack_end(item_container, il);
}
printf("Building %d objects\n", items);
if (grid)
_build_grid(items);
else
_build_list(items);
printf("Done!\n");
efl_gfx_entity_size_set(win, EINA_SIZE2D(200, 200));
efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500));
efl_event_callback_add(evas_object_evas_get(win), EFL_CANVAS_SCENE_EVENT_RENDER_POST, _first_frame_cb, item_container);
efl_event_callback_add(evas_object_evas_get(win), EFL_CANVAS_SCENE_EVENT_RENDER_POST, _first_frame_cb, collection);
return;
err:
print_help();
efl_exit(-1);
}
EFL_MAIN()

View File

@ -7,8 +7,8 @@ benchmark('focus_widget_tree', focus_widget_tree_bench,
args: ['5'],
)
item_container = executable('item_container',
'item_container.c',
item_container = executable('collection',
'collection.c',
dependencies: [elementary, ecore_input_evas, eio],
)

View File

@ -156,9 +156,10 @@ elementary_test_src = [
'test_gesture_framework.c',
'test_ui_tab_pager.c',
'test_ui_relative_layout.c',
'test_ui_item_container.c',
'test_ui_collection.c',
'test_ui_items.c',
'test_ui_frame.c',
'test_efl_ui_animation_view.c',
'test.h'
]

View File

@ -404,6 +404,8 @@ void test_efl_ui_collection_grid(void *data, Evas_Object *obj, void *event_info)
void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info);
void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
void test_efl_ui_animation_view(void *data, Evas_Object *obj, void *event_info);
static void _list_udpate(void);
static Evas_Object *win, *tbx, *entry; // TODO: refactoring
@ -1294,6 +1296,10 @@ add_tests:
//------------------------------//
ADD_TEST_EO(NULL, "Widgets Part", "Part Background", test_part_background);
ADD_TEST_EO(NULL, "Widgets Part", "Part Shadow", test_part_shadow);
//------------------------------//
ADD_TEST_EO(NULL, "Vector Animation", "Animation View", test_efl_ui_animation_view);
#undef ADD_TEST
if (autorun)

View File

@ -0,0 +1,328 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>
#include <Efl_Ui.h>
#ifndef EFL_BETA_API_SUPPORT
#define EFL_BETA_API_SUPPORT
#endif
#ifndef EFL_EO_API_SUPPORT
#define EFL_EO_API_SUPPORT
#endif
#ifdef BUILD_VG_LOADER_JSON
static void
btn_clicked_cb(void *data , const Efl_Event *ev )
{
Evas_Object *anim_view = data;
const char *text = efl_text_get(ev->object);
if (!text) return;
if (!strcmp("Play", text))
efl_ui_animation_view_play(anim_view);
else if (!strcmp("Pause", text))
efl_ui_animation_view_pause(anim_view);
else if (!strcmp("Resume", text))
efl_ui_animation_view_resume(anim_view);
else if (!strcmp("Play Back", text))
efl_ui_animation_view_play_back(anim_view);
else if (!strcmp("Stop", text))
efl_ui_animation_view_stop(anim_view);
}
static void
check_changed_cb(void *data, const Efl_Event *event)
{
Evas_Object *anim_view = data;
efl_ui_animation_view_auto_repeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
}
static void
speed_changed_cb(void *data, const Efl_Event *event)
{
Evas_Object *anim_view = data;
double speed = 1;
if (efl_ui_selectable_selected_get(event->object)) speed = 0.25;
efl_ui_animation_view_speed_set(anim_view, speed);
}
static void
limit_frame_cb(void *data, const Efl_Event *event)
{
Evas_Object *anim_view = data;
int frame_count = efl_ui_animation_view_frame_count_get(anim_view);
printf("Total Frame Count : %d\n", frame_count);
if (efl_ui_selectable_selected_get(event->object))
{
efl_ui_animation_view_min_frame_set(anim_view, 5);
efl_ui_animation_view_max_frame_set(anim_view, 10);
printf("Frames to show 5-10 only\n");
}
else
{
efl_ui_animation_view_min_frame_set(anim_view, 0);
efl_ui_animation_view_max_frame_set(anim_view, frame_count);
printf("Showing all frames now\n");
}
}
static void
update_anim_view_state(Evas_Object *anim_view, Evas_Object *label)
{
Efl_Ui_Animation_View_State state = efl_ui_animation_view_state_get(anim_view);
switch (state)
{
case EFL_UI_ANIMATION_VIEW_STATE_NOT_READY:
efl_text_set(label, "State = Not Ready");
break;
case EFL_UI_ANIMATION_VIEW_STATE_PLAY:
efl_text_set(label, "State = Playing");
break;
case EFL_UI_ANIMATION_VIEW_STATE_PLAY_BACK:
efl_text_set(label, "State = Playing Back");
break;
case EFL_UI_ANIMATION_VIEW_STATE_PAUSE:
efl_text_set(label, "State = Paused");
break;
case EFL_UI_ANIMATION_VIEW_STATE_STOP:
efl_text_set(label, "State = Stopped");
break;
}
}
static void
_play_updated(void *data, Evas_Object *obj, void *ev EINA_UNUSED)
{
Evas_Object *slider = data;
efl_ui_range_value_set(slider, efl_ui_animation_view_progress_get(obj));
}
static void
_state_update(void *data, Evas_Object *obj, void *ev EINA_UNUSED)
{
Evas_Object *label = data;
update_anim_view_state(obj, label);
}
static void
_play_done(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
{
printf("done!\n");
}
static void
_play_repeated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
{
printf("repeated!\n");
}
static void
_slider_changed_cb(void *data, const Efl_Event *ev)
{
Evas_Object *anim_view = data;
efl_ui_animation_view_progress_set(anim_view, efl_ui_range_value_get(ev->object));
}
static void
_slider_reset(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
{
Evas_Object *slider = data;
efl_ui_range_value_set(slider, 0);
}
void
test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Eo *win, *box, *box2, *box3, *box4, *label, *anim_view, *check, *slider;
char buf[255];
win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
// Create a box in Canvas
box = efl_add(EFL_UI_BOX_CLASS, win,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
efl_content_set(win, efl_added));
//Create a label to show state of animation
label = efl_add(EFL_UI_TEXT_CLASS, win,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
efl_pack(box, efl_added));
//Create Animation View to play animation directly from JSON file
snprintf(buf, sizeof(buf), "%s/images/emoji_wink.json", elm_app_data_dir_get());
anim_view = efl_add(EFL_UI_ANIMATION_VIEW_CLASS, win,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(600, 600)),
efl_file_set(efl_added, buf),
efl_pack(box, efl_added));
// Controller Set : 0
box2 = efl_add(EFL_UI_BOX_CLASS, box,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_pack(box, efl_added));
//Loop
check = efl_add(EFL_UI_CHECK_CLASS, box2,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_pack(box2, efl_added));
efl_text_set(check, "Loop");
efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, check_changed_cb, anim_view);
//Speed: 0.5x
check = efl_add(EFL_UI_CHECK_CLASS, box2,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_pack(box2, efl_added));
efl_text_set(check, "Speed: 0.25x");
efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, speed_changed_cb, anim_view);
//Limit Frames
check = efl_add(EFL_UI_CHECK_CLASS, box2,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_pack(box2, efl_added));
efl_text_set(check, "Limit Frames");
efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, limit_frame_cb, anim_view);
//Duration Text
snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_animation_view_duration_time_get(anim_view));
efl_add(EFL_UI_TEXT_CLASS, box2,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_text_set(efl_added, buf),
efl_pack(box2, efl_added));
//Slider
slider = efl_add(EFL_UI_SLIDER_CLASS, box,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_ui_range_limits_set(efl_added, 0, 1),
efl_event_callback_add(efl_added, EFL_UI_RANGE_EVENT_CHANGED, _slider_changed_cb, anim_view),
efl_pack(box, efl_added));
//Controller Set: 1
box3 = efl_add(EFL_UI_BOX_CLASS, box,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, 1),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_pack(box, efl_added));
//Play Button
efl_add(EFL_UI_BUTTON_CLASS, box3,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_text_set(efl_added, "Play"),
efl_pack(box3, efl_added),
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
//Play Back Button
efl_add(EFL_UI_BUTTON_CLASS, box3,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_text_set(efl_added, "Play Back"),
efl_pack(box3, efl_added),
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
//Stop Button
efl_add(EFL_UI_BUTTON_CLASS, box3,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_text_set(efl_added, "Stop"),
efl_pack(box3, efl_added),
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
//Controller Set: 2
box4 = efl_add(EFL_UI_BOX_CLASS, box,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, 1),
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_pack(box, efl_added));
//Pause Button
efl_add(EFL_UI_BUTTON_CLASS, box3,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_text_set(efl_added, "Pause"),
efl_pack(box4, efl_added),
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
//Resume Button
efl_add(EFL_UI_BUTTON_CLASS, box3,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_text_set(efl_added, "Resume"),
efl_pack(box4, efl_added),
efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, btn_clicked_cb, anim_view));
evas_object_smart_callback_add(anim_view, "play,start", _state_update, label);
evas_object_smart_callback_add(anim_view, "play,stop", _state_update, label);
evas_object_smart_callback_add(anim_view, "play,pause", _state_update, label);
evas_object_smart_callback_add(anim_view, "play,resume", _state_update, label);
evas_object_smart_callback_add(anim_view, "play,repeat", _play_repeated, label);
evas_object_smart_callback_add(anim_view, "play,done", _play_done, label);
evas_object_smart_callback_add(anim_view, "play,update", _play_updated, slider);
evas_object_smart_callback_add(anim_view, "play,stop", _slider_reset, slider);
update_anim_view_state(anim_view, label);
efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 730));
}
#else
void
test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Eo *win, *box;
char buf[255];
win = efl_add_ref(EFL_UI_WIN_CLASS, NULL,
efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
// Create a box
box = efl_add(EFL_UI_BOX_CLASS, win,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
efl_content_set(win, efl_added));
efl_add(EFL_UI_TEXT_CLASS, win,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0.1),
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
efl_text_set(efl_added, "Evas Vg Json (Lottie) Loader is not supported, Only Static Vector Image is available!"),
efl_pack(box, efl_added));
//Create Vector object.
snprintf(buf, sizeof(buf), "%s/images/tiger.svg", elm_app_data_dir_get());
efl_add(EFL_CANVAS_VG_OBJECT_CLASS, win,
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(600, 600)),
efl_file_simple_load(efl_added, buf, NULL),
efl_gfx_entity_visible_set(efl_added, EINA_TRUE),
efl_pack(box, efl_added));
efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 730));
}
#endif

View File

@ -57,23 +57,23 @@ static Efl_Ui_Radio_Group *
_create_box_contents(Evas_Object *box)
{
Evas_Object *hbox;
Evas_Object *radio_group, *radio;
Evas_Object *radio;
Evas_Object *content;
Efl_Ui_Radio_Group *group;
Efl_Ui_Radio_Group *radio_group;
char buf[PATH_MAX];
unsigned int i;
group = efl_new(EFL_UI_RADIO_GROUP_IMPL_CLASS, NULL);
radio_group = efl_new(EFL_UI_RADIO_GROUP_IMPL_CLASS, NULL);
hbox = efl_add(EFL_UI_BOX_CLASS, box,
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1, 1),
efl_pack_end(box, efl_added));
radio_group = radio = efl_add(EFL_UI_RADIO_CLASS, hbox);
radio = efl_add(EFL_UI_RADIO_CLASS, hbox);
efl_gfx_hint_weight_set(radio, 0, 0);
efl_ui_radio_state_value_set(radio, 0);
efl_ui_radio_group_register(group, radio);
efl_ui_radio_group_register(radio_group, radio);
efl_pack_end(hbox, radio);
content = efl_add(EFL_UI_BOX_CLASS, hbox,
@ -96,7 +96,7 @@ _create_box_contents(Evas_Object *box)
radio = efl_add(EFL_UI_RADIO_CLASS, hbox);
efl_ui_radio_state_value_set(radio, i + 1);
efl_gfx_hint_weight_set(radio, 0, 0);
efl_ui_radio_group_register(group, radio);
efl_ui_radio_group_register(radio_group, radio);
efl_pack_end(hbox, radio);
content = efl_add(content_class[i], hbox,
@ -114,7 +114,7 @@ _create_box_contents(Evas_Object *box)
evas_object_data_set(radio, "data", content);
}
efl_ui_radio_group_selected_value_set(group, 0);
efl_ui_radio_group_selected_value_set(radio_group, 0);
return radio_group;
}

View File

@ -24,6 +24,18 @@ _change_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
elm_slider_value_set(data, val);
}
void
_drag_start_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
printf("drag,started! slider value : %d\n", (int)round(elm_slider_value_get(obj)));
}
void
_drag_stop_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
printf("drag,stopped! slider value : %d\n", (int)round(elm_slider_value_get(obj)));
}
static void
_ok_btn_clicked(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -244,6 +256,10 @@ test_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
evas_object_show(ic);
evas_object_show(sl);
evas_object_smart_callback_add(sl, "slider,drag,start", _drag_start_cb, NULL);
evas_object_smart_callback_add(sl, "slider,drag,stop", _drag_stop_cb, NULL);
// horizontally inverted slider
ic = elm_icon_add(bx);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());

View File

@ -86,7 +86,7 @@ _widget_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
}
static void
_add_item(Efl_Ui_Collection *c)
_add_item(Efl_Ui_Collection *c, Eo *cont)
{
Efl_Class *itc = efl_key_data_get(c, "__item_class");
char buf[PATH_MAX];
@ -126,7 +126,7 @@ _add_item(Efl_Ui_Collection *c)
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(100, 180));
else
efl_gfx_hint_size_min_set(il, EINA_SIZE2D(40, 40+(i%2)*40));
efl_pack_end(c, il);
efl_pack_end(cont, il);
}
static void
@ -138,7 +138,7 @@ _remove_all_cb(void *data, const Efl_Event *ev EINA_UNUSED)
static void
_add_one_item(void *data, const Efl_Event *ev EINA_UNUSED)
{
_add_item(data);
_add_item(data, data);
}
static void
@ -146,7 +146,7 @@ _add_thousend_items(void *data, const Efl_Event *ev EINA_UNUSED)
{
for (int i = 0; i < 1000; ++i)
{
_add_item(data);
_add_item(data, data);
}
}
@ -158,9 +158,9 @@ _select_value_cb(void *data, const Efl_Event *ev)
efl_ui_select_mode_set(c, efl_ui_radio_group_selected_value_get(ev->object));
}
void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl_Class *item, const char *name)
void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class *item, const char *name)
{
Efl_Ui_Win *win, *o, *tbl, *item_container, *bx;
Efl_Ui_Win *win, *o, *tbl, *item_container, *bx, *git;
Match_Content_Ctx *ctx = calloc(1, sizeof(*ctx));
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
@ -170,14 +170,28 @@ void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl
tbl = efl_add(EFL_UI_TABLE_CLASS, win);
efl_content_set(win, tbl);
item_container = o = efl_add(EFL_UI_COLLECTION_CLASS, win,
efl_ui_collection_position_manager_set(efl_added, manager));
item_container = o = efl_add(collection_class, win);
efl_key_data_set(o, "__item_class", item);
efl_event_callback_add(o, EFL_EVENT_DEL, _widget_del_cb, ctx);
for (int i = 0; i < 2000; ++i)
for (int i = 0; i < 200; ++i)
{
_add_item(o);
_add_item(o, o);
}
for (int j = 0; j < 5; ++j)
{
Eina_Strbuf *buf = eina_strbuf_new();
eina_strbuf_append_printf(buf, "Group #%d", j);
git = efl_add(EFL_UI_GROUP_ITEM_CLASS, o);
efl_text_set(git, eina_strbuf_release(buf));
efl_pack_end(o, git);
efl_gfx_hint_size_min_set(git, EINA_SIZE2D(40, 40+40));
for (int i = 0; i < 200; ++i)
{
_add_item(o, git);
}
}
efl_pack_table(tbl, o, 1, 0, 1, 12);
ctx->c = o;
@ -278,12 +292,12 @@ void test_efl_ui_collection_grid(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS), EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container Grid");
create_item_container_ui(EFL_UI_GRID_CLASS, EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Grid");
}
void test_efl_ui_collection_list(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS), EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container List");
create_item_container_ui(EFL_UI_LIST_CLASS, EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.List");
}

View File

@ -84,4 +84,13 @@ void test_efl_ui_item(void *data EINA_UNUSED,
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40));
efl_ui_widget_disabled_set(o, EINA_TRUE);
efl_pack_end(box, o);
o = _item_add(box, EFL_UI_GROUP_ITEM_CLASS, 5);
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40+40));
efl_pack_end(box, o);
o = _item_add(box, EFL_UI_GROUP_ITEM_CLASS, 6);
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40));
efl_ui_widget_disabled_set(o, EINA_TRUE);
efl_pack_end(box, o);
}

View File

@ -2,7 +2,7 @@
# include "elementary_config.h"
#endif
#define EFL_UI_ANCHOR_POPUP_BETA
#define EFL_UI_POPUP_BETA
#define EFL_UI_SCROLL_ALERT_POPUP_BETA
#include <Efl_Ui.h>
#include <Elementary.h>
@ -992,13 +992,13 @@ test_ui_text_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
static void
_anchor_set_cb(void *data, const Efl_Event *ev)
{
efl_ui_anchor_popup_anchor_set(data, ev->object);
efl_ui_popup_anchor_set(data, ev->object);
}
static void
_anchor_unset_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
efl_ui_anchor_popup_anchor_set(data, NULL);
efl_ui_popup_anchor_set(data, NULL);
}
void
@ -1021,12 +1021,12 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
efl_gfx_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
efl_content_set(win, layout);
Eo *efl_ui_popup = efl_add(EFL_UI_ANCHOR_POPUP_CLASS, win);
Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_CLASS, win);
efl_ui_popup_part_backwall_repeat_events_set(efl_part(efl_ui_popup, "backwall"), EINA_TRUE);
//Default align priority order is top, left, right, bottom, center.
efl_ui_anchor_popup_align_priority_set(efl_ui_popup, EFL_UI_POPUP_ALIGN_TOP,
efl_ui_popup_align_priority_set(efl_ui_popup, EFL_UI_POPUP_ALIGN_TOP,
EFL_UI_POPUP_ALIGN_BOTTOM,
EFL_UI_POPUP_ALIGN_LEFT,
EFL_UI_POPUP_ALIGN_RIGHT,

View File

@ -1,3 +1,5 @@
efl_version: 1 22;
collections {
group {
styles {

View File

@ -1,3 +1,5 @@
efl_version: 1 22;
collections {
styles {

View File

@ -1,3 +1,5 @@
efl_version: 1 22;
collections {
styles {

View File

@ -1,3 +1,5 @@
efl_version: 1 22;
collections {
styles {

View File

@ -1,3 +1,5 @@
efl_version: 1 22;
collections {
group {
name: "sel_group";

View File

@ -1,3 +1,5 @@
efl_version: 1 22;
collections {
styles {
style { name: "entry_style";

View File

@ -169,7 +169,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
efl_ui_property_bind(img_factory, "", "path"); //connect to "path" property
efl_ui_factory_bind(priv->bt, "icon", img_factory);
efl_future_then(win, efl_ui_factory_create(img_factory, NULL, bxr),
efl_future_then(win, efl_ui_view_factory_create_with_event(img_factory, NULL, bxr),
.success = _wait_for_image,
.data = priv);

View File

@ -604,7 +604,8 @@ _update_rle(void *data, Ector_Software_Thread *thread)
task->pd->public_shape->stroke.scale),
task->pd->public_shape->stroke.cap,
task->pd->public_shape->stroke.join,
task->pd->base->m);
task->pd->base->m,
task->pd->public_shape->stroke.miterlimit);
if (task->pd->public_shape->stroke.dash)
{

View File

@ -118,7 +118,7 @@ void ector_software_rasterizer_init(Software_Rasterizer *rasterizer);
void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread, Software_Rasterizer *rasterizer,
double width,
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m);
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style, Eina_Matrix3 *m, double miterlimit);
void ector_software_rasterizer_transform_set(Software_Rasterizer *rasterizer, Eina_Matrix3 *t);
void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a);

View File

@ -663,7 +663,7 @@ void ector_software_thread_init(Ector_Software_Thread *thread)
SW_FT_Stroker_New(&thread->stroker);
SW_FT_Stroker_Set(thread->stroker, 1 << 6,
SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER, 0x4<<16);
SW_FT_STROKER_LINECAP_BUTT, SW_FT_STROKER_LINEJOIN_MITER_FIXED, 0x4<<16);
}
void ector_software_rasterizer_init(Software_Rasterizer *rasterizer)
@ -685,15 +685,15 @@ void ector_software_thread_shutdown(Ector_Software_Thread *thread)
void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread,
Software_Rasterizer *rasterizer EINA_UNUSED, double width,
Efl_Gfx_Cap cap_style, Efl_Gfx_Join join_style,
Eina_Matrix3 *m)
Eina_Matrix3 *m, double miterlimit)
{
SW_FT_Stroker_LineCap cap;
SW_FT_Stroker_LineJoin join;
int stroke_width;
double scale_factor = 1.0;
//TODO: The interface to change the value of the miter_limit is not yet ready.
SW_FT_Fixed miter_limit = 0x4<<16;
// convert to freetype co-ordinate
SW_FT_Fixed miter_limit = miterlimit * (1<<16);
if (m)
{
@ -728,7 +728,7 @@ void ector_software_rasterizer_stroke_set(Ector_Software_Thread *thread,
join = SW_FT_STROKER_LINEJOIN_ROUND;
break;
default:
join = SW_FT_STROKER_LINEJOIN_MITER;
join = SW_FT_STROKER_LINEJOIN_MITER_FIXED;
break;
}
SW_FT_Stroker_Set(thread->stroker, stroke_width, cap, join, miter_limit);

View File

@ -300,6 +300,7 @@ _edje_file_open(const Eina_File *f, int *error_ret, time_t mtime, Eina_Bool coll
Edje_Color_Class *cc;
Edje_Text_Class *tc;
Edje_Size_Class *sc;
Edje_Style *stl;
Edje_File *edf;
Eina_List *l, *ll;
Eet_File *ef;
@ -376,6 +377,11 @@ _edje_file_open(const Eina_File *f, int *error_ret, time_t mtime, Eina_Bool coll
/* This should be done at edje generation time */
_edje_textblock_style_parse_and_fix(edf);
edf->style_hash = eina_hash_string_small_new(NULL);
EINA_LIST_FOREACH(edf->styles, l, stl)
if (stl->name)
eina_hash_direct_add(edf->style_hash, stl->name, stl);
edf->color_tree_hash = eina_hash_string_small_new(NULL);
EINA_LIST_FOREACH(edf->color_tree, l, ctn)
EINA_LIST_FOREACH(ctn->color_classes, ll, name)

View File

@ -960,6 +960,46 @@ _edje_recalc(Edje *ed)
// ed->postponed = EINA_TRUE;
}
static
#ifdef EDJE_CALC_CACHE
Eina_Bool
#else
void
#endif
_edje_recalc_table_parts(Edje *ed
#ifdef EDJE_CALC_CACHE
, Eina_Bool need_reinit_state
#endif
)
{
unsigned short i;
Edje_Real_Part *ep;
for (i = 0; i < ed->table_parts_size; i++)
{
ep = ed->table_parts[i];
ep->calculated = FLAG_NONE; // FIXME: this is dubious (see below)
ep->calculating = FLAG_NONE;
#ifdef EDJE_CALC_CACHE
if (need_reinit_state)
{
ep->state = 0;
ep->param1.state = 0;
if (ep->param2) ep->param2->state = 0;
}
#endif
}
for (i = 0; i < ed->table_parts_size; i++)
{
ep = ed->table_parts[i];
if (ep->calculated != FLAG_XY) // FIXME: this is always true (see for above)
_edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY, NULL);
}
#ifdef EDJE_CALC_CACHE
return need_reinit_state;
#endif
}
void
_edje_recalc_do(Edje *ed)
{
@ -986,31 +1026,16 @@ _edje_recalc_do(Edje *ed)
#endif
}
for (i = 0; i < ed->table_parts_size; i++)
{
Edje_Real_Part *ep;
ep = ed->table_parts[i];
ep->calculated = FLAG_NONE; // FIXME: this is dubious (see below)
ep->calculating = FLAG_NONE;
if (EINA_UNLIKELY(ed->table_parts_size > 0))
#ifdef EDJE_CALC_CACHE
if (need_reinit_state)
{
ep->state = 0;
ep->param1.state = 0;
if (ep->param2)
ep->param2->state = 0;
}
need_reinit_state =
#endif
}
for (i = 0; i < ed->table_parts_size; i++)
{
Edje_Real_Part *ep;
_edje_recalc_table_parts(ed
#ifdef EDJE_CALC_CACHE
, need_reinit_state
#endif
);
ep = ed->table_parts[i];
if (ep->calculated != FLAG_XY) // FIXME: this is always true (see for above)
_edje_part_recalc(ed, ep, (~ep->calculated) & FLAG_XY, NULL);
}
if (!ed->calc_only) ed->recalc = EINA_FALSE;
#ifdef EDJE_CALC_CACHE
ed->all_part_change = EINA_FALSE;
@ -2690,6 +2715,220 @@ _edje_part_recalc_single_filter(Edje *ed,
}
}
static void
_edje_part_recalc_single_table(Edje_Real_Part *ep,
Edje_Part_Description_Common *chosen_desc,
int *minw, int *minh)
{
Eina_Size2D lmin;
efl_canvas_group_need_recalculate_set(ep->object, 1);
efl_canvas_group_calculate(ep->object);
lmin = efl_gfx_hint_size_restricted_min_get(ep->object);
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h)
{
if (lmin.w > *minw) *minw = lmin.w;
}
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.v)
{
if (lmin.h > *minh) *minh = lmin.h;
}
}
static void
_edje_part_recalc_single_box(Edje_Real_Part *ep,
Edje_Part_Description_Common *chosen_desc,
int *minw, int *minh)
{
Eina_Size2D lmin;
efl_canvas_group_need_recalculate_set(ep->object, 1);
efl_canvas_group_calculate(ep->object);
lmin = efl_gfx_hint_size_restricted_min_get(ep->object);
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h)
{
if (lmin.w > *minw) *minw = lmin.w;
}
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.v)
{
if (lmin.h > *minh) *minh = lmin.h;
}
}
static void
_edje_part_recalc_single_image(Edje *ed, Edje_Real_Part *ep,
Edje_Part_Description_Common *chosen_desc,
FLOAT_T pos,
int *minw, int *minh, int *maxw, int *maxh)
{
Evas_Coord w, h;
/* We only need pos to find the right image that would be displayed */
/* Yes, if someone set aspect preference to SOURCE and also max,min
to SOURCE, it will be under efficient, but who cares at the
moment. */
_edje_real_part_image_set(ed, ep, NULL, pos);
evas_object_image_size_get(ep->object, &w, &h);
if (chosen_desc->min.limit)
{
if (w > *minw) *minw = w;
if (h > *minh) *minh = h;
}
if (chosen_desc->max.limit)
{
if ((*maxw <= 0) || (w < *maxw)) *maxw = w;
if ((*maxh <= 0) || (h < *maxh)) *maxh = h;
}
}
#ifdef HAVE_EPHYSICS
static void
_edje_part_recalc_single_physics(Edje_Calc_Params *params,
Edje_Part_Description_Common *desc)
{
EINA_COW_CALC_PHYSICS_BEGIN(params, params_write)
{
params_write->mass = desc->physics.mass;
params_write->restitution = desc->physics.restitution;
params_write->friction = desc->physics.friction;
params_write->damping.linear = desc->physics.damping.linear;
params_write->damping.angular = desc->physics.damping.angular;
params_write->sleep.linear = desc->physics.sleep.linear;
params_write->sleep.angular = desc->physics.sleep.angular;
params_write->material = desc->physics.material;
params_write->density = desc->physics.density;
params_write->hardness = desc->physics.hardness;
params_write->ignore_part_pos = desc->physics.ignore_part_pos;
params_write->light_on = desc->physics.light_on;
params_write->mov_freedom.lin.x = desc->physics.mov_freedom.lin.x;
params_write->mov_freedom.lin.y = desc->physics.mov_freedom.lin.y;
params_write->mov_freedom.lin.z = desc->physics.mov_freedom.lin.z;
params_write->mov_freedom.ang.x = desc->physics.mov_freedom.ang.x;
params_write->mov_freedom.ang.y = desc->physics.mov_freedom.ang.y;
params_write->mov_freedom.ang.z = desc->physics.mov_freedom.ang.z;
params_write->backcull = desc->physics.backcull;
params_write->z = desc->physics.z;
params_write->depth = desc->physics.depth;
}
EINA_COW_CALC_PHYSICS_END(params, params_write);
}
#endif
static void
_edje_part_recalc_single_fixed_info(Edje *ed, Edje_Real_Part *ep,
Eina_Bool fixedw, Eina_Bool fixedh)
{
INF("file %s, group %s has a non-fixed part '%s'. You should add "
"'fixed: %d %d'. But in order to optimize the edje calc, we "
"add it automatically.", ed->path, ed->group, ep->part->name,
fixedw, fixedh);
}
static void
_edje_part_recalc_single_image0(Edje *ed, Edje_Real_Part *ep,
Edje_Calc_Params *params,
Edje_Part_Description_Image *img_desc,
FLOAT_T pos)
{
Edje_Real_Part_Set *set;
_edje_real_part_image_set(ed, ep, &set, pos);
/* border */
_edje_calc_params_need_type_common(params);
params->type.common->spec.image.l = img_desc->image.border.l;
params->type.common->spec.image.r = img_desc->image.border.r;
params->type.common->spec.image.t = img_desc->image.border.t;
params->type.common->spec.image.b = img_desc->image.border.b;
params->type.common->spec.image.border_scale_by = img_desc->image.border.scale_by;
if (set && set->set)
{
#define SET_BORDER_DEFINED(Result, Value) Result = Value ? Value : Result;
SET_BORDER_DEFINED(params->type.common->spec.image.l, set->entry->border.l);
SET_BORDER_DEFINED(params->type.common->spec.image.r, set->entry->border.r);
SET_BORDER_DEFINED(params->type.common->spec.image.t, set->entry->border.t);
SET_BORDER_DEFINED(params->type.common->spec.image.b, set->entry->border.b);
params->type.common->spec.image.border_scale_by = NEQ(set->entry->border.scale_by, ZERO) ?
set->entry->border.scale_by : params->type.common->spec.image.border_scale_by;
}
}
static void
_edje_part_recalc_single_text0(Edje_Calc_Params *params,
Edje_Part_Description_Text *text_desc,
Edje_Color_Class *cc)
{
_edje_calc_params_need_type_text(params);
/* text.align */
params->type.text->align.x = text_desc->text.align.x;
params->type.text->align.y = text_desc->text.align.y;
params->type.text->ellipsis = text_desc->text.ellipsis;
/* text colors */
if (cc)
{
params->type.text->color2.r = (((int)cc->r2 + 1) * text_desc->common.color2.r) >> 8;
params->type.text->color2.g = (((int)cc->g2 + 1) * text_desc->common.color2.g) >> 8;
params->type.text->color2.b = (((int)cc->b2 + 1) * text_desc->common.color2.b) >> 8;
params->type.text->color2.a = (((int)cc->a2 + 1) * text_desc->common.color2.a) >> 8;
params->type.text->color3.r = (((int)cc->r3 + 1) * text_desc->text.color3.r) >> 8;
params->type.text->color3.g = (((int)cc->g3 + 1) * text_desc->text.color3.g) >> 8;
params->type.text->color3.b = (((int)cc->b3 + 1) * text_desc->text.color3.b) >> 8;
params->type.text->color3.a = (((int)cc->a3 + 1) * text_desc->text.color3.a) >> 8;
}
else
{
params->type.text->color2.r = text_desc->common.color2.r;
params->type.text->color2.g = text_desc->common.color2.g;
params->type.text->color2.b = text_desc->common.color2.b;
params->type.text->color2.a = text_desc->common.color2.a;
params->type.text->color3.r = text_desc->text.color3.r;
params->type.text->color3.g = text_desc->text.color3.g;
params->type.text->color3.b = text_desc->text.color3.b;
params->type.text->color3.a = text_desc->text.color3.a;
}
}
static void
_edje_part_recalc_single_light0(Edje_Calc_Params *params,
Edje_Part_Description_Light *light_desc)
{
_edje_calc_params_need_type_node(params);
params->type.node->data[0] = light_desc->light.orientation.data[0];
params->type.node->point.x = light_desc->light.position.point.x;
params->type.node->point.y = light_desc->light.position.point.y;
params->type.node->point.z = light_desc->light.position.point.z;
}
static void
_edje_part_recalc_single_camera0(Edje_Calc_Params *params,
Edje_Part_Description_Camera *camera_desc)
{
_edje_calc_params_need_type_node(params);
params->type.node->data[0] = camera_desc->camera.orientation.data[0];
params->type.node->point.x = camera_desc->camera.position.point.x;
params->type.node->point.y = camera_desc->camera.position.point.y;
params->type.node->point.z = camera_desc->camera.position.point.z;
}
static void
_edje_part_recalc_single_mesh0(Edje_Calc_Params *params,
Edje_Part_Description_Mesh_Node *mesh_desc)
{
_edje_calc_params_need_type_node(params);
params->type.node->frame = mesh_desc->mesh_node.mesh.frame;
params->type.node->data[0] = mesh_desc->mesh_node.orientation.data[0];
params->type.node->point.x = mesh_desc->mesh_node.position.point.x;
params->type.node->point.y = mesh_desc->mesh_node.position.point.y;
params->type.node->point.z = mesh_desc->mesh_node.position.point.z;
params->type.node->scale_3d.x = mesh_desc->mesh_node.scale_3d.x;
params->type.node->scale_3d.y = mesh_desc->mesh_node.scale_3d.y;
params->type.node->scale_3d.z = mesh_desc->mesh_node.scale_3d.z;
}
static void
_edje_part_recalc_single(Edje *ed,
Edje_Real_Part *ep,
@ -2739,7 +2978,6 @@ _edje_part_recalc_single(Edje *ed,
chosen_desc->fixed.w = 1;
fixedw = EINA_TRUE;
}
if ((rel1_to_y == rel2_to_y) &&
(EQ(desc->rel1.relative_y, desc->rel2.relative_y)) &&
(!chosen_desc->fixed.h))
@ -2748,19 +2986,13 @@ _edje_part_recalc_single(Edje *ed,
fixedh = EINA_TRUE;
}
if (fixedw || fixedh)
{
INF("file %s, group %s has a non-fixed part '%s'. You should add "
"'fixed: %d %d'. But in order to optimize the edje calc, we "
"add it automatically.", ed->path, ed->group, ep->part->name,
fixedw, fixedh);
}
_edje_part_recalc_single_fixed_info(ed, ep, fixedw, fixedh);
/* colors */
if (ep->part->type != EDJE_PART_TYPE_SPACER)
{
if ((desc->color_class) && (*desc->color_class))
cc = _edje_color_class_recursive_find(ed, desc->color_class);
if (cc)
{
params->color.r = (((int)cc->r + 1) * desc->color.r) >> 8;
@ -2799,221 +3031,63 @@ _edje_part_recalc_single(Edje *ed,
params->ext->clip_to = clip_to;
}
/* set parameters, some are required for recalc_single_text[block] */
// set parameters, some are required for recalc_single_text[block]
switch (ep->part->type)
{
case EDJE_PART_TYPE_IMAGE:
{
Edje_Real_Part_Set *set;
Edje_Part_Description_Image *img_desc = (Edje_Part_Description_Image *)desc;
_edje_real_part_image_set(ed, ep, &set, pos);
/* border */
_edje_calc_params_need_type_common(params);
params->type.common->spec.image.l = img_desc->image.border.l;
params->type.common->spec.image.r = img_desc->image.border.r;
params->type.common->spec.image.t = img_desc->image.border.t;
params->type.common->spec.image.b = img_desc->image.border.b;
params->type.common->spec.image.border_scale_by = img_desc->image.border.scale_by;
if (set && set->set)
{
#define SET_BORDER_DEFINED(Result, Value) Result = Value ? Value : Result;
SET_BORDER_DEFINED(params->type.common->spec.image.l, set->entry->border.l);
SET_BORDER_DEFINED(params->type.common->spec.image.r, set->entry->border.r);
SET_BORDER_DEFINED(params->type.common->spec.image.t, set->entry->border.t);
SET_BORDER_DEFINED(params->type.common->spec.image.b, set->entry->border.b);
params->type.common->spec.image.border_scale_by = NEQ(set->entry->border.scale_by, ZERO) ?
set->entry->border.scale_by : params->type.common->spec.image.border_scale_by;
}
break;
}
case EDJE_PART_TYPE_TEXT:
_edje_part_recalc_single_text0(params, (Edje_Part_Description_Text *)desc, cc);
// limit size if needed
_edje_part_recalc_single_text(sc, ed, ep, (Edje_Part_Description_Text *)desc, (Edje_Part_Description_Text *)chosen_desc, params, &minw, &minh, &maxw, &maxh);
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
break;
case EDJE_PART_TYPE_TEXTBLOCK:
{
Edje_Part_Description_Text *text_desc = (Edje_Part_Description_Text *)desc;
_edje_calc_params_need_type_text(params);
/* text.align */
params->type.text->align.x = text_desc->text.align.x;
params->type.text->align.y = text_desc->text.align.y;
params->type.text->ellipsis = text_desc->text.ellipsis;
/* text colors */
if (cc)
{
params->type.text->color2.r = (((int)cc->r2 + 1) * text_desc->common.color2.r) >> 8;
params->type.text->color2.g = (((int)cc->g2 + 1) * text_desc->common.color2.g) >> 8;
params->type.text->color2.b = (((int)cc->b2 + 1) * text_desc->common.color2.b) >> 8;
params->type.text->color2.a = (((int)cc->a2 + 1) * text_desc->common.color2.a) >> 8;
params->type.text->color3.r = (((int)cc->r3 + 1) * text_desc->text.color3.r) >> 8;
params->type.text->color3.g = (((int)cc->g3 + 1) * text_desc->text.color3.g) >> 8;
params->type.text->color3.b = (((int)cc->b3 + 1) * text_desc->text.color3.b) >> 8;
params->type.text->color3.a = (((int)cc->a3 + 1) * text_desc->text.color3.a) >> 8;
}
else
{
params->type.text->color2.r = text_desc->common.color2.r;
params->type.text->color2.g = text_desc->common.color2.g;
params->type.text->color2.b = text_desc->common.color2.b;
params->type.text->color2.a = text_desc->common.color2.a;
params->type.text->color3.r = text_desc->text.color3.r;
params->type.text->color3.g = text_desc->text.color3.g;
params->type.text->color3.b = text_desc->text.color3.b;
params->type.text->color3.a = text_desc->text.color3.a;
}
break;
}
case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_BOX:
_edje_part_recalc_single_text0(params, (Edje_Part_Description_Text *)desc, cc);
// limit size if needed
_edje_part_recalc_single_textblock(sc, ed, ep, (Edje_Part_Description_Text *)chosen_desc, params, &minw, &minh, &maxw, &maxh);
break;
// or table/box containers that want to do the same
case EDJE_PART_TYPE_TABLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
// limit size if needed
if (((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) ||
(((Edje_Part_Description_Table *)chosen_desc)->table.min.v)))
_edje_part_recalc_single_table(ep, chosen_desc, &minw, &minh);
break;
case EDJE_PART_TYPE_BOX:
// limit size if needed
if ((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) ||
(((Edje_Part_Description_Box *)chosen_desc)->box.min.v))
_edje_part_recalc_single_box(ep, chosen_desc, &minw, &minh);
break;
case EDJE_PART_TYPE_IMAGE:
_edje_part_recalc_single_image0(ed, ep, params, (Edje_Part_Description_Image *)desc, pos);
// limit size if needed
if (chosen_desc->min.limit || chosen_desc->max.limit)
_edje_part_recalc_single_image(ed, ep, chosen_desc, pos, &minw, &minh, &maxw, &maxh);
EINA_FALLTHROUGH;
case EDJE_PART_TYPE_PROXY:
case EDJE_PART_TYPE_SNAPSHOT:
case EDJE_PART_TYPE_VECTOR:
// image. proxy, snapshot share this filter recalc, so fall through
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
break;
case EDJE_PART_TYPE_LIGHT:
{
Edje_Part_Description_Light *light_desc = (Edje_Part_Description_Light *)desc;
_edje_calc_params_need_type_node(params);
params->type.node->data[0] = light_desc->light.orientation.data[0];
params->type.node->point.x = light_desc->light.position.point.x;
params->type.node->point.y = light_desc->light.position.point.y;
params->type.node->point.z = light_desc->light.position.point.z;
break;
}
case EDJE_PART_TYPE_CAMERA:
{
Edje_Part_Description_Camera *camera_desc = (Edje_Part_Description_Camera *)desc;
_edje_calc_params_need_type_node(params);
params->type.node->data[0] = camera_desc->camera.orientation.data[0];
params->type.node->point.x = camera_desc->camera.position.point.x;
params->type.node->point.y = camera_desc->camera.position.point.y;
params->type.node->point.z = camera_desc->camera.position.point.z;
break;
}
case EDJE_PART_TYPE_MESH_NODE:
{
Edje_Part_Description_Mesh_Node *mesh_desc = (Edje_Part_Description_Mesh_Node *)desc;
_edje_calc_params_need_type_node(params);
params->type.node->frame = mesh_desc->mesh_node.mesh.frame;
params->type.node->data[0] = mesh_desc->mesh_node.orientation.data[0];
params->type.node->point.x = mesh_desc->mesh_node.position.point.x;
params->type.node->point.y = mesh_desc->mesh_node.position.point.y;
params->type.node->point.z = mesh_desc->mesh_node.position.point.z;
params->type.node->scale_3d.x = mesh_desc->mesh_node.scale_3d.x;
params->type.node->scale_3d.y = mesh_desc->mesh_node.scale_3d.y;
params->type.node->scale_3d.z = mesh_desc->mesh_node.scale_3d.z;
break;
}
case EDJE_PART_TYPE_GRADIENT:
/* FIXME: THIS ONE SHOULD NEVER BE TRIGGERED. */
_edje_part_recalc_single_light0(params, (Edje_Part_Description_Light *)desc);
break;
case EDJE_PART_TYPE_CAMERA:
_edje_part_recalc_single_camera0(params, (Edje_Part_Description_Camera *)desc);
break;
case EDJE_PART_TYPE_MESH_NODE:
_edje_part_recalc_single_mesh0(params, (Edje_Part_Description_Mesh_Node *)desc);
break;
case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
case EDJE_PART_TYPE_VECTOR:
case EDJE_PART_TYPE_GRADIENT: // FIXME: THIS ONE SHOULD NEVER BE TRIGGERED
default:
break;
}
/* if we have text that wants to make the min size the text size... */
if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK)
_edje_part_recalc_single_textblock(sc, ed, ep, (Edje_Part_Description_Text *)chosen_desc, params, &minw, &minh, &maxw, &maxh);
else if (ep->part->type == EDJE_PART_TYPE_TEXT)
{
_edje_part_recalc_single_text(sc, ed, ep, (Edje_Part_Description_Text*) desc, (Edje_Part_Description_Text*) chosen_desc, params, &minw, &minh, &maxw, &maxh);
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
}
if ((ep->part->type == EDJE_PART_TYPE_TABLE) &&
(((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) ||
(((Edje_Part_Description_Table *)chosen_desc)->table.min.v))))
{
Eina_Size2D lmin;
efl_canvas_group_need_recalculate_set(ep->object, 1);
efl_canvas_group_calculate(ep->object);
lmin = efl_gfx_hint_size_restricted_min_get(ep->object);
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h)
{
if (lmin.w > minw) minw = lmin.w;
}
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.v)
{
if (lmin.h > minh) minh = lmin.h;
}
}
else if ((ep->part->type == EDJE_PART_TYPE_BOX) &&
((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) ||
(((Edje_Part_Description_Box *)chosen_desc)->box.min.v)))
{
Eina_Size2D lmin;
efl_canvas_group_need_recalculate_set(ep->object, 1);
efl_canvas_group_calculate(ep->object);
lmin = efl_gfx_hint_size_restricted_min_get(ep->object);
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h)
{
if (lmin.w > minw) minw = lmin.w;
}
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.v)
{
if (lmin.h > minh) minh = lmin.h;
}
}
else if (ep->part->type == EDJE_PART_TYPE_IMAGE)
{
if (chosen_desc->min.limit || chosen_desc->max.limit)
{
Evas_Coord w, h;
/* We only need pos to find the right image that would be displayed */
/* Yes, if someone set aspect preference to SOURCE and also max,min
to SOURCE, it will be under efficient, but who cares at the
moment. */
_edje_real_part_image_set(ed, ep, NULL, pos);
evas_object_image_size_get(ep->object, &w, &h);
if (chosen_desc->min.limit)
{
if (w > minw) minw = w;
if (h > minh) minh = h;
}
if (chosen_desc->max.limit)
{
if ((maxw <= 0) || (w < maxw)) maxw = w;
if ((maxh <= 0) || (h < maxh)) maxh = h;
}
}
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
}
else if (ep->part->type == EDJE_PART_TYPE_PROXY)
{
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
}
else if (ep->part->type == EDJE_PART_TYPE_SNAPSHOT)
{
_edje_part_recalc_single_filter(ed, ep, desc, chosen_desc, pos);
}
/* remember what our size is BEFORE we go limit it */
params->req.x = TO_INT(params->eval.x);
params->req.y = TO_INT(params->eval.y);
@ -3044,34 +3118,8 @@ _edje_part_recalc_single(Edje *ed,
_edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Proxy *)desc)->proxy.fill, params);
#ifdef HAVE_EPHYSICS
if (ep->part->physics_body || ep->body)
{
EINA_COW_CALC_PHYSICS_BEGIN(params, params_write)
{
params_write->mass = desc->physics.mass;
params_write->restitution = desc->physics.restitution;
params_write->friction = desc->physics.friction;
params_write->damping.linear = desc->physics.damping.linear;
params_write->damping.angular = desc->physics.damping.angular;
params_write->sleep.linear = desc->physics.sleep.linear;
params_write->sleep.angular = desc->physics.sleep.angular;
params_write->material = desc->physics.material;
params_write->density = desc->physics.density;
params_write->hardness = desc->physics.hardness;
params_write->ignore_part_pos = desc->physics.ignore_part_pos;
params_write->light_on = desc->physics.light_on;
params_write->mov_freedom.lin.x = desc->physics.mov_freedom.lin.x;
params_write->mov_freedom.lin.y = desc->physics.mov_freedom.lin.y;
params_write->mov_freedom.lin.z = desc->physics.mov_freedom.lin.z;
params_write->mov_freedom.ang.x = desc->physics.mov_freedom.ang.x;
params_write->mov_freedom.ang.y = desc->physics.mov_freedom.ang.y;
params_write->mov_freedom.ang.z = desc->physics.mov_freedom.ang.z;
params_write->backcull = desc->physics.backcull;
params_write->z = desc->physics.z;
params_write->depth = desc->physics.depth;
}
EINA_COW_CALC_PHYSICS_END(params, params_write);
}
if (EINA_UNLIKELY(ep->part->physics_body || ep->body))
_edje_part_recalc_single_physics(params, desc);
#endif
_edje_part_recalc_single_map(ed, ep, center, zoom_center, light, persp, desc, chosen_desc, params);
}

View File

@ -499,14 +499,14 @@ _edje_edit_file_import(Edje *ed, const char *path, const char *entry, int compre
_edje_edit_eet_close(eetf);
eina_file_map_free(f, fdata);
eina_file_close(f);
eina_file_close(f); // close matching open OK
return EINA_TRUE;
on_error:
if (eetf) _edje_edit_eet_close(eetf);
eina_file_map_free(f, fdata);
eina_file_close(f);
eina_file_close(f); // close matching open OK
return EINA_FALSE;
}

View File

@ -262,16 +262,18 @@ EAPI Eina_List *
edje_file_collection_list(const char *file)
{
Eina_File *f;
Eina_List *lst;
Eina_List *lst = NULL;
char *tmp;
if ((!file) || (!*file)) return NULL;
tmp = eina_vpath_resolve(file);
f = eina_file_open(tmp, EINA_FALSE);
if (!f) goto err;
lst = edje_mmap_collection_list(f);
eina_file_close(f);
eina_file_close(f); // close matching open OK
err:
free(tmp);
return lst;
}
@ -433,17 +435,21 @@ EAPI Eina_Bool
edje_file_group_exists(const char *file, const char *glob)
{
Eina_File *f;
Eina_Bool result;
Eina_Bool result = EINA_FALSE;
char *tmp;
if ((!file) || (!*file) || (!glob))
return EINA_FALSE;
f = eina_file_open(file, EINA_FALSE);
if (!f) return EINA_FALSE;
tmp = eina_vpath_resolve(file);
f = eina_file_open(tmp, EINA_FALSE);
if (!f) goto err;
result = edje_mmap_group_exists(f, glob);
eina_file_close(f);
eina_file_close(f); // close matching open OK
err:
free(tmp);
return result;
}
@ -473,20 +479,21 @@ EAPI char *
edje_file_data_get(const char *file, const char *key)
{
Eina_File *f;
char *str;
char *str = NULL, *tmp;
if (!key) return NULL;
f = eina_file_open(file, EINA_FALSE);
tmp = eina_vpath_resolve(file);
f = eina_file_open(tmp, EINA_FALSE);
if (!f)
{
ERR("File [%s] can not be opened.", file);
return NULL;
goto err;
}
str = edje_mmap_data_get(f, key);
eina_file_close(f);
eina_file_close(f); // close matching open OK
err:
free(tmp);
return str;
}
@ -2383,9 +2390,10 @@ _edje_file_free(Edje_File *edf)
if (edf->path) eina_stringshare_del(edf->path);
if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
if (edf->free_strings) eina_stringshare_del(edf->id);
eina_hash_free(edf->style_hash);
_edje_textblock_style_cleanup(edf);
if (edf->ef) eet_close(edf->ef);
if (edf->f) eina_file_close(edf->f);
if (edf->f) eina_file_close(edf->f); // close matching open (in _edje_file_open) OK
free(edf);
}

View File

@ -573,6 +573,7 @@ struct _Edje_File
unsigned int requires_count;
Eina_List *styles;
Eina_Hash *style_hash;
Eina_List *color_tree;
Eina_Hash *color_tree_hash;
@ -2813,7 +2814,7 @@ void _edje_message_del (Edje *ed);
void _edje_textblock_styles_add(Edje *ed, Edje_Real_Part *ep);
void _edje_textblock_styles_del(Edje *ed, Edje_Part *pt);
void _edje_textblock_styles_cache_free(Edje *ed, const char *text_class);
void _edje_textblock_style_all_update_text_class(Edje *ed, const char *text_class);
void _edje_textblock_style_all_update(Edje *ed);
void _edje_textblock_style_parse_and_fix(Edje_File *edf);
void _edje_textblock_style_cleanup(Edje_File *edf);

View File

@ -1,5 +1,4 @@
#include "edje_private.h"
#include <assert.h>
static Eina_Hash *signal_match = NULL;
@ -7,7 +6,7 @@ static Eina_Hash *signal_match = NULL;
static unsigned int
_edje_signal_match_key_length(const void *key EINA_UNUSED)
{
return sizeof (Edje_Signal_Callback_Matches);
return sizeof(Edje_Signal_Callback_Matches);
}
static int
@ -70,15 +69,20 @@ _edje_signal_callback_matches_dup(const Edje_Signal_Callback_Matches *src)
if (!result) return NULL;
result->hashed = EINA_FALSE;
result->matches = malloc(sizeof (Edje_Signal_Callback_Match) * src->matches_count);
result->matches = malloc
(sizeof(Edje_Signal_Callback_Match) * src->matches_count);
if (!result->matches) goto err;
result->matches_count = src->matches_count;
result->patterns = NULL;
EINA_REFCOUNT_REF(result);
if (src->free_cb)
{
result->free_cb = malloc(sizeof (Eina_Free_Cb) * src->matches_count);
if (result->free_cb) memcpy(result->free_cb, src->free_cb, sizeof (Eina_Free_Cb) * src->matches_count);
result->free_cb = malloc
(sizeof(Eina_Free_Cb) * src->matches_count);
if (!result->free_cb) goto err;
memcpy(result->free_cb, src->free_cb,
sizeof(Eina_Free_Cb) * src->matches_count);
}
for (i = 0; i < src->matches_count; i++)
@ -89,16 +93,21 @@ _edje_signal_callback_matches_dup(const Edje_Signal_Callback_Matches *src)
}
return result;
err:
ERR("Allocation error in callback matches dup");
free(result->free_cb);
free(result->matches);
free(result);
return NULL;
}
void
_edje_callbacks_patterns_clean(Edje_Signal_Callback_Group *gp)
{
Edje_Signal_Callback_Matches *tmp;
assert(EINA_REFCOUNT_GET(gp->matches) == 1);
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
Edje_Signal_Callback_Matches *tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (!tmp) return;
assert(EINA_REFCOUNT_GET(tmp) == 1);
_edje_signal_callback_patterns_unref(tmp->patterns);
tmp->patterns = NULL;
}
@ -107,23 +116,27 @@ static void
_edje_callbacks_patterns_init(Edje_Signal_Callback_Group *gp)
{
Edje_Signals_Sources_Patterns *ssp;
Edje_Signal_Callback_Matches *tmp;
Edje_Signal_Callback_Matches *tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (gp->matches->patterns) return;
if (!tmp) return;
if (tmp->patterns) return;
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
tmp->patterns = calloc(1, sizeof (Edje_Signals_Sources_Patterns));
if (!gp->matches->patterns) return;
tmp->patterns = calloc(1, sizeof(Edje_Signals_Sources_Patterns));
if (!tmp->patterns) goto err;
ssp = gp->matches->patterns;
edje_match_callback_hash_build(gp->matches->matches,
gp->matches->matches_count,
ssp = tmp->patterns;
edje_match_callback_hash_build(tmp->matches,
tmp->matches_count,
&ssp->exact_match,
&ssp->u.callbacks.globing);
ssp->signals_patterns = edje_match_callback_signal_init(&ssp->u.callbacks.globing, tmp->matches);
ssp->sources_patterns = edje_match_callback_source_init(&ssp->u.callbacks.globing, tmp->matches);
ssp->signals_patterns = edje_match_callback_signal_init
(&ssp->u.callbacks.globing, tmp->matches);
ssp->sources_patterns = edje_match_callback_source_init
(&ssp->u.callbacks.globing, tmp->matches);
EINA_REFCOUNT_REF(ssp);
return;
err:
ERR("Alloc error on patterns init");
}
void
@ -146,9 +159,12 @@ edje_signal_shutdown(void)
static void
_edje_signal_callback_unset(Edje_Signal_Callback_Group *gp, int idx)
{
Edje_Signal_Callback_Matches *tmp = (Edje_Signal_Callback_Matches *)gp->matches;
Edje_Signal_Callback_Match *m;
m = gp->matches->matches + idx;
if (!tmp) return;
if (!tmp->matches) return;
m = tmp->matches + idx;
eina_stringshare_del(m->signal);
m->signal = NULL;
eina_stringshare_del(m->source);
@ -162,42 +178,66 @@ _edje_signal_callback_set(Edje_Signal_Callback_Group *gp, int idx,
Efl_Signal_Cb func_eo, Eina_Free_Cb func_free_cb,
void *data, Edje_Signal_Callback_Flags flags)
{
Edje_Signal_Callback_Matches *tmp = (Edje_Signal_Callback_Matches *)gp->matches;
Edje_Signal_Callback_Match *m;
m = gp->matches->matches + idx;
if (!tmp) return;
if (!tmp->matches) return;
m = tmp->matches + idx;
m->signal = eina_stringshare_ref(sig);
m->source = eina_stringshare_ref(src);
if (func_legacy) m->legacy = func_legacy;
else m->eo = func_eo;
if (func_free_cb)
{
if (!gp->matches->free_cb)
((Edje_Signal_Callback_Matches *) gp->matches)->free_cb = calloc(sizeof (Eina_Free_Cb), gp->matches->matches_count);
gp->matches->free_cb[idx] = func_free_cb;
if (!tmp->free_cb)
tmp->free_cb = calloc(tmp->matches_count, sizeof(Eina_Free_Cb));
if (!tmp->free_cb) goto err;
tmp->free_cb[idx] = func_free_cb;
}
gp->custom_data[idx] = data;
gp->flags[idx] = flags;
return;
err:
ERR("Alloc err in callback set");
}
static Edje_Signal_Callback_Group *
_edje_signal_callback_grow(Edje_Signal_Callback_Group *gp)
{
Edje_Signal_Callback_Matches *tmp;
Edje_Signal_Callback_Match *m;
Eina_Free_Cb *f;
void **cd;
Edje_Signal_Callback_Flags *fl;
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (!tmp) return NULL;
tmp->matches_count++;
tmp->matches = realloc(tmp->matches, sizeof (Edje_Signal_Callback_Match) * tmp->matches_count);
// what about data in the data build by edje_match_callback_hash_build
// that this may kill by changing the tmp->matches ptr. this is handled
// in _edje_signal_callback_push() by re-initting patterns
m = realloc(tmp->matches, sizeof(Edje_Signal_Callback_Match) * tmp->matches_count);
if (!m) goto err;
tmp->matches = m;
if (tmp->free_cb)
{
tmp->free_cb = realloc(tmp->free_cb, sizeof (Eina_Free_Cb) * tmp->matches_count);
f = realloc(tmp->free_cb, sizeof(Eina_Free_Cb) * tmp->matches_count);
if (!f) goto err;
tmp->free_cb = f;
tmp->free_cb[tmp->matches_count - 1] = NULL;
}
gp->custom_data = realloc(gp->custom_data, sizeof (void *) * tmp->matches_count);
gp->flags = realloc(gp->flags, sizeof (Edje_Signal_Callback_Flags) * tmp->matches_count);
cd = realloc(gp->custom_data, sizeof(void *) * tmp->matches_count);
if (!cd) goto err;
gp->custom_data = cd;
fl = realloc(gp->flags, sizeof(Edje_Signal_Callback_Flags) * tmp->matches_count);
if (!fl) goto err;
gp->flags = fl;
return gp;
err:
ERR("Allocation error in rowing signal callback group");
tmp->matches_count--;
return NULL;
}
Eina_Bool
@ -210,6 +250,7 @@ _edje_signal_callback_push(Edje_Signal_Callback_Group *gp,
unsigned int i;
Edje_Signal_Callback_Flags flags;
Edje_Signal_Callback_Matches *tmp;
Edje_Signal_Callback_Match *m;
flags.delete_me = EINA_FALSE;
flags.just_added = EINA_TRUE;
@ -218,22 +259,30 @@ _edje_signal_callback_push(Edje_Signal_Callback_Group *gp,
// FIXME: properly handle legacy and non legacy case, including free function
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (!tmp) return EINA_FALSE;
if (tmp->hashed)
{
if (EINA_REFCOUNT_GET(tmp) == 1)
{
// special case - it's a single ref so make it private
// and move it out of the shared hash to be private
eina_hash_del(signal_match, tmp, tmp);
tmp->hashed = EINA_FALSE;
}
else
{
// already multiple refs to the match - so make a
// private copy of it we can modify
Edje_Signal_Callback_Matches *tmp_dup =
(Edje_Signal_Callback_Matches *)
_edje_signal_callback_matches_dup(tmp);
if (!tmp_dup) return EINA_FALSE;
// unreff tmp but it's > 1 ref so it'll be safe but we're not
// using it anymore here so indicate that with the unref
EINA_REFCOUNT_UNREF(tmp)
(void) 0; // do nothing because if refcount == 1 handle above.
{
(void)0; // do nothing because if refcount == 1 handle above.
}
gp->matches = tmp = tmp_dup;
}
assert(tmp->hashed == EINA_FALSE);
@ -250,11 +299,22 @@ _edje_signal_callback_push(Edje_Signal_Callback_Group *gp,
}
}
_edje_signal_callback_grow(gp);
// Set propagate and just_added flags
_edje_signal_callback_set(gp, tmp->matches_count - 1,
sig, src, func_legacy, func_eo, func_free_cb, data, flags);
m = tmp->matches;
if (_edje_signal_callback_grow(gp))
{
// Set propagate and just_added flags
_edje_signal_callback_set(gp, tmp->matches_count - 1,
sig, src, func_legacy, func_eo, func_free_cb, data, flags);
if (m != tmp->matches)
{
_edje_callbacks_patterns_clean(gp);
_edje_callbacks_patterns_init(gp);
}
}
else goto err;
return EINA_TRUE;
err:
ERR("Allocation error in pushing callback");
return EINA_TRUE;
}
@ -265,23 +325,22 @@ _edje_signal_callback_alloc(void)
Edje_Signal_Callback_Matches *m;
escg = calloc(1, sizeof (Edje_Signal_Callback_Group));
if (!escg) return NULL;
if (!escg) goto err;
m = calloc(1, sizeof (Edje_Signal_Callback_Matches));
if (!m)
{
free(escg);
return NULL;
}
if (!m) goto err;
EINA_REFCOUNT_REF(m);
escg->matches = m;
return escg;
err:
ERR("Alloc error in signal callback alloc");
free(escg);
return NULL;
}
void
_edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m, Edje_Signal_Callback_Flags *flags, void **custom_data)
_edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m,
Edje_Signal_Callback_Flags *flags,
void **custom_data)
{
unsigned int i;
@ -289,33 +348,28 @@ _edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m, Edje_Signal
{
for (i = 0; i < m->matches_count; ++i)
{
if (!flags[i].delete_me &&
m->free_cb[i])
{
m->free_cb[i](custom_data[i]);
}
if (!flags[i].delete_me && m->free_cb[i])
m->free_cb[i](custom_data[i]);
}
}
EINA_REFCOUNT_UNREF(m)
{
_edje_signal_callback_patterns_unref(m->patterns);
if (m->hashed)
{
eina_hash_del(signal_match, m, m);
m->hashed = EINA_FALSE;
}
for (i = 0; i < m->matches_count; ++i)
{
eina_stringshare_del(m->matches[i].signal);
eina_stringshare_del(m->matches[i].source);
}
free(m->matches);
m->matches = NULL;
free(m);
}
{
_edje_signal_callback_patterns_unref(m->patterns);
if (m->hashed)
eina_hash_del(signal_match, m, m);
for (i = 0; i < m->matches_count; ++i)
{
eina_stringshare_del(m->matches[i].signal);
eina_stringshare_del(m->matches[i].source);
}
free(m->matches);
free(m->free_cb);
m->hashed = EINA_FALSE;
m->matches = NULL;
m->free_cb = NULL;
free(m);
}
}
void
@ -324,12 +378,12 @@ _edje_signal_callback_free(const Edje_Signal_Callback_Group *cgp)
Edje_Signal_Callback_Group *gp = (Edje_Signal_Callback_Group *)cgp;
if (!gp) return;
_edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches, gp->flags, gp->custom_data);
gp->matches = NULL;
_edje_signal_callback_matches_unref
((Edje_Signal_Callback_Matches *)gp->matches, gp->flags, gp->custom_data);
free(gp->flags);
gp->flags = NULL;
free(gp->custom_data);
gp->matches = NULL;
gp->flags = NULL;
gp->custom_data = NULL;
free(gp);
}
@ -346,16 +400,16 @@ _edje_signal_callback_disable(Edje_Signal_Callback_Group *gp,
for (i = 0; i < gp->matches->matches_count; ++i)
{
if (sig == gp->matches->matches[i].signal &&
src == gp->matches->matches[i].source &&
!gp->flags[i].delete_me &&
((func == gp->matches->matches[i].eo &&
(!gp->matches->free_cb || func_free_cb == gp->matches->free_cb[i]) &&
gp->custom_data[i] == data &&
!gp->flags[i].legacy) ||
(func_legacy == gp->matches->matches[i].legacy &&
gp->custom_data[i] == data &&
gp->flags[i].legacy))
if ((sig == gp->matches->matches[i].signal) &&
(src == gp->matches->matches[i].source) &&
(!gp->flags[i].delete_me) &&
(((func == gp->matches->matches[i].eo) &&
((!gp->matches->free_cb) || (func_free_cb == gp->matches->free_cb[i])) &&
(gp->custom_data[i] == data) &&
(!gp->flags[i].legacy)) ||
((func_legacy == gp->matches->matches[i].legacy) &&
(gp->custom_data[i] == data) &&
(gp->flags[i].legacy)))
)
{
if (func && func_free_cb) func_free_cb(data);
@ -364,7 +418,6 @@ _edje_signal_callback_disable(Edje_Signal_Callback_Group *gp,
return EINA_TRUE;
}
}
return EINA_FALSE;
}
@ -376,13 +429,14 @@ _edje_signal_callback_move_last(Edje_Signal_Callback_Group *gp,
unsigned int j;
m = (Edje_Signal_Callback_Matches *)gp->matches;
if (!m) return;
for (j = --m->matches_count; j > i; --j)
{
if (!gp->flags[j].delete_me)
{
_edje_signal_callback_unset(gp, i);
memcpy(&m->matches[i], &m->matches[j], sizeof (Edje_Signal_Callback_Match));
memcpy(&m->matches[i], &m->matches[j], sizeof(Edje_Signal_Callback_Match));
gp->flags[i] = gp->flags[j];
gp->custom_data[i] = gp->custom_data[j];
return;
@ -401,13 +455,12 @@ _edje_signal_callback_patterns_ref(const Edje_Signal_Callback_Group *gp)
const Edje_Signal_Callback_Matches *m;
Edje_Signal_Callback_Matches *tmp;
if (gp->matches->hashed)
goto got_it;
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (!tmp) return NULL;
if (tmp->hashed) goto got_it;
m = eina_hash_find(signal_match, gp->matches);
if (!m)
{
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (!(tmp->patterns && (EINA_REFCOUNT_GET(tmp->patterns) > 1)))
{
// Let compact it and remove uneeded pattern before building it
@ -420,10 +473,8 @@ _edje_signal_callback_patterns_ref(const Edje_Signal_Callback_Group *gp)
_edje_signal_callback_move_last((Edje_Signal_Callback_Group *)gp, i);
}
}
_edje_signal_callback_patterns_unref(tmp->patterns);
tmp->patterns = NULL;
_edje_callbacks_patterns_init((Edje_Signal_Callback_Group *)gp);
eina_hash_add(signal_match, tmp, tmp);
// We should be able to use direct_add, but if I do so valgrind stack explode and
@ -433,40 +484,40 @@ _edje_signal_callback_patterns_ref(const Edje_Signal_Callback_Group *gp)
}
else
{
_edje_signal_callback_matches_unref((Edje_Signal_Callback_Matches *)gp->matches, gp->flags, gp->custom_data);
if (m == tmp)
{
ERR("Should not happen - gp->match == hash found match");
abort();
return NULL;
}
_edje_signal_callback_matches_unref
((Edje_Signal_Callback_Matches *)tmp, gp->flags, gp->custom_data);
((Edje_Signal_Callback_Group *)gp)->matches = m;
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
EINA_REFCOUNT_REF(tmp);
}
got_it:
tmp = (Edje_Signal_Callback_Matches *)gp->matches;
if (tmp->patterns) EINA_REFCOUNT_REF(tmp->patterns);
return gp->matches->patterns;
return tmp->patterns;
}
void
_edje_signal_callback_patterns_unref(const Edje_Signals_Sources_Patterns *essp)
{
Edje_Signals_Sources_Patterns *ssp;
if (!essp) return;
ssp = (Edje_Signals_Sources_Patterns *)essp;
Edje_Signals_Sources_Patterns *ssp = (Edje_Signals_Sources_Patterns *)essp;
if (!ssp) return;
EINA_REFCOUNT_UNREF(ssp)
{
_edje_signals_sources_patterns_clean(ssp);
eina_rbtree_delete(ssp->exact_match,
EINA_RBTREE_FREE_CB(edje_match_signal_source_free),
NULL);
ssp->exact_match = NULL;
eina_inarray_flush(&ssp->u.callbacks.globing);
free(ssp);
}
{
_edje_signals_sources_patterns_clean(ssp);
eina_rbtree_delete(ssp->exact_match,
EINA_RBTREE_FREE_CB(edje_match_signal_source_free),
NULL);
ssp->exact_match = NULL;
eina_inarray_flush(&ssp->u.callbacks.globing);
free(ssp);
}
}
void

View File

@ -481,8 +481,7 @@ _efl_canvas_layout_efl_observer_update(Eo *obj EINA_UNUSED, Edje *ed, Efl_Object
}
else if (obs == _edje_text_class_member)
{
_edje_textblock_styles_cache_free(ed, key);
_edje_textblock_style_all_update(ed);
_edje_textblock_style_all_update_text_class(ed, key);
#ifdef EDJE_CALC_CACHE
ed->text_part_change = EINA_TRUE;
#endif

View File

@ -52,14 +52,12 @@ _edje_format_parse(const char **s)
return NULL;
}
static char *
_edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret)
static void
_edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag *tag_ret, Eina_Strbuf *result)
{
Eina_Strbuf *txt, *tmp = NULL;
char *s2, *item, *ret;
char *s2, *item;
const char *s;
txt = eina_strbuf_new();
s = str;
while ((item = _edje_format_parse(&s)))
{
@ -77,17 +75,18 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret)
else if (!strncmp(key, "text_class", key_len))
{
if (tag_ret)
(*tag_ret)->text_class = eina_stringshare_add(val);
tag_ret->text_class = eina_stringshare_add(val);
// no need to add text_class tag to style
// as evas_textblock_style has no idea about
// text_class tag.
free(item);
continue;
}
else if (!strncmp(key, "font_size", key_len))
{
if (tag_ret)
(*tag_ret)->font_size = atof(val);
tag_ret->font_size = atof(val);
}
else if (!strncmp(key, "font", key_len)) /* Fix fonts */
{
@ -95,39 +94,31 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret)
{
if (_edje_font_is_embedded(edf, val))
{
if (!tmp)
tmp = eina_strbuf_new();
eina_strbuf_append(tmp, "edje/fonts/");
eina_strbuf_append(tmp, val);
(*tag_ret)->font = eina_stringshare_add(eina_strbuf_string_get(tmp));
eina_strbuf_reset(tmp);
char buffer[120];
snprintf(buffer, sizeof(buffer), "edje/fonts/%s", val);
tag_ret->font = eina_stringshare_add(buffer);
}
else
{
(*tag_ret)->font = eina_stringshare_add(val);
tag_ret->font = eina_stringshare_add(val);
}
}
}
s2 = eina_str_escape(item);
if (s2)
{
if (eina_strbuf_length_get(txt)) eina_strbuf_append(txt, " ");
eina_strbuf_append(txt, s2);
if (eina_strbuf_length_get(result)) eina_strbuf_append(result, " ");
eina_strbuf_append(result, s2);
free(s2);
}
}
else
{
if (eina_strbuf_length_get(txt)) eina_strbuf_append(txt, " ");
eina_strbuf_append(txt, item);
if (eina_strbuf_length_get(result)) eina_strbuf_append(result, " ");
eina_strbuf_append(result, item);
}
free(item);
}
if (tmp)
eina_strbuf_free(tmp);
ret = eina_strbuf_string_steal(txt);
eina_strbuf_free(txt);
return ret;
}
@ -160,8 +151,6 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force)
if (!txt)
txt = eina_strbuf_new();
if (_edje_fontset_append)
fontset = eina_str_escape(_edje_fontset_append);
if (ed->file->fonts)
fontsource = eina_str_escape(ed->file->path);
@ -249,19 +238,9 @@ _edje_textblock_style_all_update(Edje *ed)
static inline Edje_Style *
_edje_textblock_style_search(Edje *ed, const char *style)
{
Edje_Style *stl = NULL;
Eina_List *l;
if (!style) return NULL;
EINA_LIST_FOREACH(ed->file->styles, l, stl)
{
if ((stl->name) &&
(stl->name == style || !strcmp(stl->name, style))) break;
stl = NULL;
}
return stl;
return eina_hash_find(ed->file->style_hash, style);
}
static inline void
@ -325,16 +304,9 @@ _edje_textblock_styles_del(Edje *ed, Edje_Part *pt)
desc = (Edje_Part_Description_Text *)pt->default_desc;
style = edje_string_get(&desc->text.style);
if (style)
{
Eina_List *l;
EINA_LIST_FOREACH(ed->file->styles, l, stl)
{
if ((stl->name) && (!strcmp(stl->name, style))) break;
stl = NULL;
}
}
stl = _edje_textblock_style_search(ed, style);
if (stl)
{
Edje_Style_Tag *tag;
@ -351,16 +323,7 @@ _edje_textblock_styles_del(Edje *ed, Edje_Part *pt)
{
desc = (Edje_Part_Description_Text *)pt->other.desc[i];
style = edje_string_get(&desc->text.style);
if (style)
{
Eina_List *l;
EINA_LIST_FOREACH(ed->file->styles, l, stl)
{
if ((stl->name) && (!strcmp(stl->name, style))) break;
stl = NULL;
}
}
stl = _edje_textblock_style_search(ed, style);
if (stl)
{
Edje_Style_Tag *tag;
@ -375,8 +338,12 @@ _edje_textblock_styles_del(Edje *ed, Edje_Part *pt)
}
}
/*
* Finds all the styles having text class tag as text_class and
* updates them.
*/
void
_edje_textblock_styles_cache_free(Edje *ed, const char *text_class)
_edje_textblock_style_all_update_text_class(Edje *ed, const char *text_class)
{
Eina_List *l, *ll;
Edje_Style *stl;
@ -396,7 +363,7 @@ _edje_textblock_styles_cache_free(Edje *ed, const char *text_class)
if (!strcmp(tag->text_class, text_class))
{
stl->cache = EINA_FALSE;
_edje_textblock_style_update(ed, stl, EINA_TRUE);
break;
}
}
@ -412,77 +379,73 @@ _edje_textblock_styles_cache_free(Edje *ed, const char *text_class)
void
_edje_textblock_style_parse_and_fix(Edje_File *edf)
{
Eina_Strbuf *txt = NULL;
Eina_List *l, *ll;
Edje_Style *stl;
char *fontset = _edje_fontset_append_escaped;
Eina_Strbuf *reparseBuffer = eina_strbuf_new();
Eina_Strbuf *styleBuffer = eina_strbuf_new();
char *fontsource = edf->fonts ? eina_str_escape(edf->path) : NULL;
EINA_LIST_FOREACH(edf->styles, l, stl)
{
Edje_Style_Tag *tag;
char *fontsource = NULL, *ts;
if (stl->style) break;
stl->readonly = EINA_TRUE;
if (!txt)
txt = eina_strbuf_new();
stl->style = evas_textblock_style_new();
evas_textblock_style_set(stl->style, NULL);
if (edf->fonts)
fontsource = eina_str_escape(edf->path);
eina_strbuf_reset(styleBuffer);
/* Build the style from each tag */
EINA_LIST_FOREACH(stl->tags, ll, tag)
{
if (!tag->key) continue;
/* Add Tag Key */
eina_strbuf_append(txt, tag->key);
eina_strbuf_append(txt, "='");
eina_strbuf_reset(reparseBuffer);
ts = _edje_format_reparse(edf, tag->value, &(tag));
/* Add Tag Key */
eina_strbuf_append(styleBuffer, tag->key);
eina_strbuf_append(styleBuffer, "='");
_edje_format_reparse(edf, tag->value, tag, reparseBuffer);
/* Add and Handle tag parsed data */
if (ts)
if (eina_strbuf_length_get(reparseBuffer))
{
if (edf->allocated_strings &&
eet_dictionary_string_check(eet_dictionary_get(edf->ef), tag->value) == 0)
eina_stringshare_del(tag->value);
tag->value = eina_stringshare_add(ts);
eina_strbuf_append(txt, tag->value);
free(ts);
tag->value = eina_stringshare_add(eina_strbuf_string_get(reparseBuffer));
eina_strbuf_append(styleBuffer, tag->value);
}
if (!strcmp(tag->key, "DEFAULT"))
{
if (fontset)
{
eina_strbuf_append(txt, " font_fallbacks=");
eina_strbuf_append(txt, fontset);
eina_strbuf_append(styleBuffer, " font_fallbacks=");
eina_strbuf_append(styleBuffer, fontset);
}
if (fontsource)
{
eina_strbuf_append(txt, " ");
eina_strbuf_append(txt, "font_source=");
eina_strbuf_append(txt, fontsource);
eina_strbuf_append(styleBuffer, " font_source=");
eina_strbuf_append(styleBuffer, fontsource);
}
}
eina_strbuf_append(txt, "'");
eina_strbuf_append(styleBuffer, "'");
if (tag->text_class) stl->readonly = EINA_FALSE;
}
if (fontsource) free(fontsource);
/* Configure the style */
evas_textblock_style_set(stl->style, eina_strbuf_string_get(txt));
eina_strbuf_reset(txt);
/* Configure the style only if it will never change again*/
if (stl->readonly)
evas_textblock_style_set(stl->style, eina_strbuf_string_get(styleBuffer));
}
if (txt)
eina_strbuf_free(txt);
if (fontsource) free(fontsource);
eina_strbuf_free(styleBuffer);
eina_strbuf_free(reparseBuffer);
}
void

View File

@ -146,6 +146,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_ui_view.eo.h"
#include "interfaces/efl_ui_property_bind.eo.h"
#include "interfaces/efl_ui_factory.eo.h"
#include "interfaces/efl_ui_view_factory.eo.h"
#include "interfaces/efl_ui_factory_bind.eo.h"
#include "interfaces/efl_model_provider.eo.h"
#include "interfaces/efl_cached_item.eo.h"
@ -203,22 +204,6 @@ EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
*/
EAPI Efl_Object *efl_part(const Eo *obj, const char *name);
/**
* @brief This triggers the create method of a factory and trigger the item created event.
*
* @param[in] factory The factory that will provide the item
* @param[in] model The model to use to fetch information from
* @param[in] parent The parent of the newly created item
* @return A future that will resolve with the newly created item.
*
* @since 1.22
* @note This exists as we always want to trigger the event once all the logic
* of every factory in the chain has done what it planned to do. Basically we
* want the inverse of inheritance call like efl_super. So we do setup the future
* in this way.
*/
EAPI Eina_Future *efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Efl_Model *model, Efl_Gfx_Entity *parent);
#else
#ifndef EFL_NOLEGACY_API_SUPPORT

View File

@ -22,7 +22,8 @@ _efl_file_unload(Eo *obj, Efl_File_Data *pd)
if (!pd->file) return;
if (!pd->file_opened) return;
pd->setting = 1;
eina_file_close(pd->file);
eina_file_close(pd->file); // close matching open (dup in _efl_file_mmap_set) OK
pd->file = NULL;
efl_file_mmap_set(obj, NULL);
pd->setting = 0;
pd->loaded = pd->file_opened = EINA_FALSE;
@ -46,7 +47,7 @@ _efl_file_load(Eo *obj, Efl_File_Data *pd)
ret = efl_file_mmap_set(obj, f);
pd->setting = 0;
if (ret) pd->file_opened = EINA_FALSE;
eina_file_close(f);
eina_file_close(f); // close matching open OK
}
pd->loaded = !ret;
return ret;
@ -64,7 +65,7 @@ _efl_file_mmap_set(Eo *obj, Efl_File_Data *pd, const Eina_File *f)
file = eina_file_dup(f);
if (!file) return errno;
}
if (pd->file) eina_file_close(pd->file);
if (pd->file) eina_file_close(pd->file); // close matching open (dup above) OK
pd->file = file;
pd->loaded = EINA_FALSE;
@ -138,7 +139,10 @@ _efl_file_efl_object_destructor(Eo *obj, Efl_File_Data *pd)
{
eina_stringshare_del(pd->vpath);
eina_stringshare_del(pd->key);
eina_file_close(pd->file);
eina_file_close(pd->file); // close matching open (dup in _efl_file_mmap_set) OK
pd->vpath = NULL;
pd->key = NULL;
pd->file = NULL;
efl_destructor(efl_super(obj, EFL_FILE_MIXIN));
}

View File

@ -36,6 +36,7 @@ struct _Efl_Gfx_Property
double scale;
double w;
double centered;
double miterlimit;
Efl_Gfx_Cap c;
Efl_Gfx_Join j;
@ -57,6 +58,7 @@ _efl_gfx_property_get(const Eo *obj, Efl_Gfx_Property *property)
efl_gfx_shape_stroke_dash_get(obj, &property->dash, &property->dash_length);
property->c = efl_gfx_shape_stroke_cap_get(obj);
property->j = efl_gfx_shape_stroke_join_get(obj);
property->miterlimit = efl_gfx_shape_stroke_miterlimit_get(obj);
}
EOLIAN static Eina_Bool
@ -117,6 +119,9 @@ _efl_gfx_shape_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
interv = interpolate(property_from.centered, property_to.centered, pos_map);
efl_gfx_shape_stroke_location_set(obj, interv);
interv = interpolate(property_from.miterlimit, property_to.miterlimit, pos_map);
efl_gfx_shape_stroke_miterlimit_set(obj, interv);
efl_gfx_shape_stroke_dash_set(obj, dash, property_to.dash_length);
efl_gfx_shape_stroke_cap_set(obj, (pos_map < 0.5) ?
property_from.c : property_to.c);
@ -293,6 +298,7 @@ _efl_gfx_shape_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Shape_Data *pd,
pd->public.stroke.color.g = from->public.stroke.color.g;
pd->public.stroke.color.b = from->public.stroke.color.b;
pd->public.stroke.color.a = from->public.stroke.color.a;
pd->public.stroke.miterlimit = from->public.stroke.miterlimit;
pd->fill_rule = from->fill_rule;
_efl_gfx_shape_stroke_dash_set(obj, pd, from->public.stroke.dash,
@ -301,4 +307,19 @@ _efl_gfx_shape_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Shape_Data *pd,
efl_gfx_path_copy_from(efl_super(obj, MY_CLASS), dup_from);
}
EOLIAN static void
_efl_gfx_shape_stroke_miterlimit_set(Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd,
double miterlimit)
{
pd->public.stroke.miterlimit = miterlimit;
}
EOLIAN static double
_efl_gfx_shape_stroke_miterlimit_get(const Eo *obj EINA_UNUSED,
Efl_Gfx_Shape_Data *pd)
{
return pd->public.stroke.miterlimit;
}
#include "interfaces/efl_gfx_shape.eo.c"

View File

@ -97,6 +97,18 @@ mixin @beta Efl.Gfx.Shape extends Efl.Gfx.Path
j: Efl.Gfx.Join; [[Join style to use, default is @Efl.Gfx.Join.miter]]
}
}
@property stroke_miterlimit {
[[The stroke_miterlimit is a presentation defining a limit on the ratio of
the miter length to the stroke-width used to draw a miter join.
]]
set {
}
get {
}
values {
miterlimit: double; [[Limit value on the ratio of the miter.]]
}
}
@property fill_rule {
[[The fill rule of the given shape object.
@Efl.Gfx.Fill_Rule.winding or @Efl.Gfx.Fill_Rule.odd_even.

View File

@ -132,6 +132,7 @@ struct @beta Efl.Gfx.Stroke
dash_length: uint; [[Stroke dash length]]
cap: Efl.Gfx.Cap; [[Stroke cap]]
join: Efl.Gfx.Join; [[Stroke join]]
miterlimit: double; [[Stroke miterlimit]]
}
struct @beta Efl.Gfx.Shape_Public

View File

@ -4,6 +4,7 @@
#define EFL_UI_SCROLLBAR_PROTECTED
#define EFL_PART_PROTECTED
#define EFL_UI_FACTORY_PROTECTED
#include "eo_internal.h"
@ -67,8 +68,8 @@
#include "interfaces/efl_ui_range_interactive.eo.c"
#include "interfaces/efl_ui_autorepeat.eo.c"
#include "interfaces/efl_ui_view.eo.c"
#include "interfaces/efl_ui_property_bind.eo.c"
#include "interfaces/efl_ui_factory.eo.c"
#include "interfaces/efl_ui_property_bind.eo.c"
#include "interfaces/efl_ui_factory_bind.eo.c"
#include "interfaces/efl_ui_draggable.eo.c"
@ -119,19 +120,24 @@ static Eina_Value
_efl_ui_view_factory_item_created(Eo *factory, void *data EINA_UNUSED, const Eina_Value v)
{
Efl_Ui_Factory_Item_Created_Event event = { NULL, NULL };
int len, i;
eina_value_pget(&v, &event.item);
event.model = efl_ui_view_model_get(event.item);
EINA_VALUE_ARRAY_FOREACH(&v, len, i, event.item)
{
event.model = efl_ui_view_model_get(event.item);
efl_event_callback_call(factory, EFL_UI_FACTORY_EVENT_CREATED, &event);
efl_event_callback_call(factory, EFL_UI_FACTORY_EVENT_CREATED, &event);
}
return v;
}
EAPI Eina_Future *
efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Efl_Model *model, Efl_Gfx_Entity *parent)
static Eina_Future *
_efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Eina_Iterator *models, Efl_Gfx_Entity *parent)
{
return efl_future_then(factory, efl_ui_factory_create(factory, model, parent),
.success_type = EINA_VALUE_TYPE_OBJECT,
return efl_future_then(factory, efl_ui_factory_create(factory, models, parent),
.success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_ui_view_factory_item_created);
}
#include "efl_ui_view_factory.eo.c"

View File

@ -8,10 +8,13 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
{
[[Efl UI factory interface]]
methods {
create {
[[Create a UI object from the necessary properties in the specified model.]]
create @protected {
[[Create a UI object from the necessary properties in the specified model.
Note: This is the function you need to implement for a custom factory, but if you want to use a factory, you should rely on @Efl.Ui.View_Factory.create_with_event.]]
params {
model: Efl.Model; [[Efl model]]
models: iterator<Efl.Model>; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]]
parent: Efl.Gfx.Entity; [[Efl canvas]]
}
return: future<Efl.Gfx.Entity>; [[Created UI object]]
@ -22,6 +25,14 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
ui_view: Efl.Gfx.Entity; [[Efl canvas]]
}
}
building @const {
[[This function is called during the creation of an UI object between the @Efl.Object.constructor and @Efl.Object.finalize call.
Note: if the @Efl.Ui.Factory does keep a cache of object, this won't be called when object are pulled out of the cache.]]
params {
ui_view: Efl.Gfx.Entity; [[The UI object being created.]]
}
}
}
events {
created: Efl.Ui.Factory_Item_Created_Event; [[Event triggered when an item has been successfully created.]]

View File

@ -0,0 +1,16 @@
class @beta Efl.Ui.View_Factory
{
[[This class provide a utility function that class that wish to use @Efl.Ui.Factory.create should use.]]
data: null;
methods {
create_with_event @static {
[[Create a UI object from the necessary properties in the specified model and generate the created event on the factory when the object is done building. This function must be use by all @Efl.Ui.View that need to create object. They should not use @Efl.Ui.Factory.create directly.]]
params {
factory: Efl.Ui.Factory; [[The factory to use for requesting the new object from and generating the created event onto.]]
models: iterator<Efl.Model>; [[Efl iterator providing the model to be associated to the new item. It should remain valid until the end of the function call.]]
parent: Efl.Gfx.Entity; [[Efl canvas]]
}
return: future<Efl.Gfx.Entity>; [[Created UI object]]
}
}
}

View File

@ -83,6 +83,7 @@ pub_eo_files = [
'efl_ui_view.eo',
'efl_ui_property_bind.eo',
'efl_ui_factory.eo',
'efl_ui_view_factory.eo',
'efl_ui_factory_bind.eo',
'efl_screen.eo',
'efl_io_closer.eo',

View File

@ -81,9 +81,10 @@
* @cond LOCAL
*/
static const char EINA_MAGIC_LIST_STR[] = "Eina List";
static const char EINA_MAGIC_LIST_ITERATOR_STR[] = "Eina List Iterator";
static const char EINA_MAGIC_LIST_ACCESSOR_STR[] = "Eina List Accessor";
#ifdef EINA_LIST_MAGIC
static const char EINA_MAGIC_LIST_STR[] = "Eina List";
static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
@ -105,6 +106,16 @@ static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
} \
} while(0)
#define EINA_MAGIC_CHECK_LIST_ACCOUNTING(d) \
do { \
if (!EINA_MAGIC_CHECK(d, EINA_MAGIC_LIST_ACCOUNTING)) \
{ \
EINA_MAGIC_FAIL(d, EINA_MAGIC_LIST_ACCOUNTING); \
return; \
} \
} while(0)
#endif
#define EINA_MAGIC_CHECK_LIST_ITERATOR(d, ...) \
do { \
if (!EINA_MAGIC_CHECK(d, EINA_MAGIC_LIST_ITERATOR)) \
@ -123,14 +134,6 @@ static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
} \
} while(0)
#define EINA_MAGIC_CHECK_LIST_ACCOUNTING(d) \
do { \
if (!EINA_MAGIC_CHECK(d, EINA_MAGIC_LIST_ACCOUNTING)) \
{ \
EINA_MAGIC_FAIL(d, EINA_MAGIC_LIST_ACCOUNTING); \
return; \
} \
} while(0)
#define EINA_LIST_SORT_STACK_SIZE 32
@ -143,7 +146,6 @@ struct _Eina_Iterator_List
const Eina_List *head;
const Eina_List *current;
EINA_MAGIC
};
@ -155,7 +157,6 @@ struct _Eina_Accessor_List
const Eina_List *current;
unsigned int index;
EINA_MAGIC
};
@ -183,9 +184,9 @@ _eina_list_mempool_accounting_new(EINA_UNUSED Eina_List *list)
sizeof (Eina_List_Accounting));
if (!tmp)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_SET(tmp, EINA_MAGIC_LIST_ACCOUNTING);
#endif
return tmp;
}
@ -204,9 +205,10 @@ _eina_list_list_free(void *list)
static inline void
_eina_list_mempool_accounting_free(Eina_List_Accounting *accounting)
{
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST_ACCOUNTING(accounting);
EINA_MAGIC_SET(accounting, EINA_MAGIC_NONE);
#endif
eina_freeq_ptr_main_add(accounting, _eina_list_accounting_free, sizeof(*accounting));
}
@ -218,32 +220,35 @@ _eina_list_mempool_list_new(EINA_UNUSED Eina_List *list)
tmp = eina_mempool_malloc(_eina_list_mp, sizeof (Eina_List));
if (!tmp)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_SET(tmp, EINA_MAGIC_LIST);
#endif
return tmp;
}
static inline void
_eina_list_mempool_list_free(Eina_List *list)
{
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list);
#endif
if (list->accounting)
{
list->accounting->count--;
if (list->accounting->count == 0)
_eina_list_mempool_accounting_free(list->accounting);
}
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_SET(list, EINA_MAGIC_NONE);
#endif
eina_freeq_ptr_main_add(list, _eina_list_list_free, sizeof(*list));
}
static Eina_List *
_eina_list_setup_accounting(Eina_List *list)
{
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
list->accounting = _eina_list_mempool_accounting_new(list);
if (!list->accounting)
goto on_error;
@ -261,9 +266,10 @@ on_error:
static inline void
_eina_list_update_accounting(Eina_List *list, Eina_List *new_list)
{
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list);
EINA_MAGIC_CHECK_LIST(new_list);
#endif
list->accounting->count++;
new_list->accounting = list->accounting;
}
@ -287,7 +293,6 @@ static Eina_Bool
eina_list_iterator_next(Eina_Iterator_List *it, void **data)
{
EINA_MAGIC_CHECK_LIST_ITERATOR(it, EINA_FALSE);
if (!it->current)
return EINA_FALSE;
@ -302,7 +307,6 @@ static Eina_Bool
eina_list_iterator_prev(Eina_Iterator_List *it, void **data)
{
EINA_MAGIC_CHECK_LIST_ITERATOR(it, EINA_FALSE);
if (!it->current)
return EINA_FALSE;
@ -317,7 +321,6 @@ static Eina_List *
eina_list_iterator_get_container(Eina_Iterator_List *it)
{
EINA_MAGIC_CHECK_LIST_ITERATOR(it, NULL);
return (Eina_List *)it->head;
}
@ -325,7 +328,6 @@ static void
eina_list_iterator_free(Eina_Iterator_List *it)
{
EINA_MAGIC_CHECK_LIST_ITERATOR(it);
MAGIC_FREE(it);
}
@ -337,7 +339,6 @@ eina_list_accessor_get_at(Eina_Accessor_List *it, unsigned int idx, void **data)
unsigned int i;
EINA_MAGIC_CHECK_LIST_ACCESSOR(it, EINA_FALSE);
if (idx >= eina_list_count(it->head))
return EINA_FALSE;
@ -395,7 +396,6 @@ static Eina_List *
eina_list_accessor_get_container(Eina_Accessor_List *it)
{
EINA_MAGIC_CHECK_LIST_ACCESSOR(it, NULL);
return (Eina_List *)it->head;
}
@ -403,7 +403,6 @@ static void
eina_list_accessor_free(Eina_Accessor_List *it)
{
EINA_MAGIC_CHECK_LIST_ACCESSOR(it);
MAGIC_FREE(it);
}
@ -413,7 +412,6 @@ eina_list_accessor_clone(Eina_Accessor_List *list)
Eina_Accessor_List *ac;
EINA_MAGIC_CHECK_LIST_ACCESSOR(list, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
ac = calloc(1, sizeof (Eina_Accessor_List));
@ -429,8 +427,9 @@ eina_list_sort_rebuild_prev(Eina_List *list)
{
Eina_List *prev = NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
for (; list; list = list->next)
{
list->prev = prev;
@ -530,10 +529,12 @@ eina_list_init(void)
}
#define EMS(n) eina_magic_string_static_set(n, n ## _STR)
#ifdef EINA_LIST_MAGIC
EMS(EINA_MAGIC_LIST);
EMS(EINA_MAGIC_LIST_ACCOUNTING);
#endif
EMS(EINA_MAGIC_LIST_ITERATOR);
EMS(EINA_MAGIC_LIST_ACCESSOR);
EMS(EINA_MAGIC_LIST_ACCOUNTING);
#undef EMS
return EINA_TRUE;
@ -595,8 +596,9 @@ eina_list_append(Eina_List *list, const void *data)
return _eina_list_setup_accounting(new_l);
}
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST_GOTO(list, on_error);
#endif
l = list->accounting->last;
list->accounting->last = new_l;
@ -605,8 +607,9 @@ eina_list_append(Eina_List *list, const void *data)
_eina_list_update_accounting(list, new_l);
return list;
#ifdef EINA_LIST_MAGIC
on_error:
#endif
_eina_list_mempool_list_free(new_l);
return NULL;
}
@ -626,15 +629,18 @@ eina_list_prepend(Eina_List *list, const void *data)
if (!list)
return _eina_list_setup_accounting(new_l);
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST_GOTO(list, on_error);
#endif
list->prev = new_l;
_eina_list_update_accounting(list, new_l);
return new_l;
#ifdef EINA_LIST_MAGIC
on_error:
#endif
_eina_list_mempool_list_free(new_l);
return NULL;
}
@ -647,9 +653,10 @@ eina_list_append_relative(Eina_List *list,
Eina_List *l;
void *list_data;
#ifdef EINA_LIST_MAGIC
if (list)
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
EINA_LIST_FOREACH(list, l, list_data)
{
if (list_data == relative)
@ -669,7 +676,9 @@ eina_list_append_relative_list(Eina_List *list,
if ((!list) || (!relative))
return eina_list_append(list, data);
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(relative, NULL);
#endif
new_l = _eina_list_mempool_list_new(list);
if (!new_l) return list;
@ -699,9 +708,10 @@ eina_list_prepend_relative(Eina_List *list,
Eina_List *l;
void *list_data;
#ifdef EINA_LIST_MAGIC
if (list)
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
EINA_LIST_FOREACH(list, l, list_data)
{
if (list_data == relative)
@ -720,8 +730,9 @@ eina_list_prepend_relative_list(Eina_List *list,
if ((!list) || (!relative))
return eina_list_prepend(list, data);
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(relative, NULL);
#endif
new_l = _eina_list_mempool_list_new(list);
if (!new_l) return list;
@ -763,9 +774,10 @@ eina_list_remove(Eina_List *list, const void *data)
{
Eina_List *l;
#ifdef EINA_LIST_MAGIC
if (list)
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
l = eina_list_data_find_list(list, data);
return eina_list_remove_list(list, l);
}
@ -781,8 +793,9 @@ eina_list_remove_list(Eina_List *list, Eina_List *remove_list)
if (!remove_list)
return list;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(remove_list, NULL);
#endif
if (remove_list->next)
remove_list->next->prev = remove_list->prev;
@ -796,7 +809,9 @@ eina_list_remove_list(Eina_List *list, Eina_List *remove_list)
if (remove_list == remove_list->accounting->last)
{
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
list->accounting->last = remove_list->prev;
}
@ -812,8 +827,9 @@ eina_list_free(Eina_List *list)
if (!list)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
for (l = list; l; )
{
free_l = l;
@ -843,9 +859,10 @@ eina_list_promote_list(Eina_List *list, Eina_List *move_list)
if (move_list->next == list)
return move_list;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
EINA_MAGIC_CHECK_LIST(move_list, NULL);
#endif
/* Remove the promoted item from the list. */
if (!move_list->prev)
move_list->next->prev = NULL;
@ -883,9 +900,10 @@ eina_list_demote_list(Eina_List *list, Eina_List *move_list)
if (move_list == list->accounting->last)
return list;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
EINA_MAGIC_CHECK_LIST(move_list, NULL);
#endif
/* Update pointer list if necessary. */
if (list == move_list)
{
@ -924,9 +942,10 @@ eina_list_move(Eina_List **to, Eina_List **from, void *data)
EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
#ifdef EINA_LIST_MAGIC
if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
#endif
l = eina_list_data_find_list(*from, data);
EINA_SAFETY_ON_NULL_RETURN_VAL(l, EINA_FALSE);
@ -941,10 +960,11 @@ eina_list_move_list(Eina_List **to, Eina_List **from, Eina_List *data)
EINA_SAFETY_ON_NULL_RETURN_VAL(to, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(from, EINA_FALSE);
#ifdef EINA_LIST_MAGIC
if (*to) EINA_MAGIC_CHECK_LIST(*to, EINA_FALSE);
EINA_MAGIC_CHECK_LIST(*from, EINA_FALSE);
EINA_MAGIC_CHECK_LIST(data, EINA_FALSE);
#endif
*to = eina_list_append(*to, data->data);
*from = eina_list_remove_list(*from, data);
return EINA_TRUE;
@ -956,9 +976,10 @@ eina_list_data_find_list(const Eina_List *list, const void *data)
const Eina_List *l;
void *list_data;
#ifdef EINA_LIST_MAGIC
if (list)
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
EINA_LIST_FOREACH(list, l, list_data)
{
if (list_data == data)
@ -986,9 +1007,10 @@ eina_list_nth_list(const Eina_List *list, unsigned int n)
const Eina_List *l;
unsigned int i;
#ifdef EINA_LIST_MAGIC
if (list)
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
/* check for non-existing nodes */
if ((!list) || (n > (list->accounting->count - 1)))
return NULL;
@ -1023,8 +1045,9 @@ eina_list_reverse(Eina_List *list)
if (!list)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
l1 = list;
l2 = list->accounting->last;
while (l1 != l2)
@ -1054,8 +1077,9 @@ eina_list_reverse_clone(const Eina_List *list)
if (!list)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
lclone = NULL;
EINA_LIST_FOREACH(list, l, data)
lclone = eina_list_prepend(lclone, data);
@ -1073,8 +1097,9 @@ eina_list_clone(const Eina_List *list)
if (!list)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
lclone = NULL;
EINA_LIST_FOREACH(list, l, data)
lclone = eina_list_append(lclone, data);
@ -1095,8 +1120,9 @@ eina_list_sort(Eina_List *list, unsigned int limit, Eina_Compare_Cb func)
if (!list)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
/* if the caller specified an invalid limit, sort the whole list */
if ((limit == 0) ||
(limit > list->accounting->count))
@ -1161,8 +1187,9 @@ eina_list_shuffle(Eina_List *list, Eina_Random_Cb func)
if (!list)
return NULL;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, NULL);
#endif
accounting = list->accounting;
n = accounting->count;
shuffled_list = shuffled_last = NULL;
@ -1623,8 +1650,9 @@ eina_list_data_idx(const Eina_List *list, void *data)
int ret = 0;
if (!list) return -1;
#ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(list, -1);
#endif
EINA_LIST_FOREACH(list, l, list_data)
{
if (list_data == data)

View File

@ -23,10 +23,16 @@
#include "eina_config.h"
// magic number checks for eina list nodes - this costs extra memory and a
// few cycles for some safety = aybe during debugging/devel only?
//#define EINA_LIST_MAGIC 1
#include "eina_types.h"
#include "eina_iterator.h"
#include "eina_accessor.h"
#include "eina_magic.h"
#ifdef EINA_LIST_MAGIC
# include "eina_magic.h"
#endif
/**
* @page eina_list_01_example_page Adding elements to Eina_List
@ -323,8 +329,9 @@ struct _Eina_List
Eina_List *next; /**< Next member in the list */
Eina_List *prev; /**< Previous member in the list */
Eina_List_Accounting *accounting; /**< Private list accounting info - don't touch */
#ifdef EINA_LIST_MAGIC
EINA_MAGIC
#endif
};
/**

View File

@ -182,6 +182,8 @@ EAPI void efl_ui_focus_relation_free(Efl_Ui_Focus_Relations *rel);
# include <efl_ui_layout_part_text.eo.h>
# include <efl_ui_layout_part_table.eo.h>
# include <efl_ui_item.eo.h>
# include <efl_ui_default_item.eo.h>
# include <efl_ui_group_item.eo.h>
# include <efl_ui_win_part.eo.h>
# include <efl_ui_bg.eo.h>
# include <efl_ui_box.eo.h>
@ -268,9 +270,9 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
# include <efl_ui_alert_popup.eo.h>
# include <efl_ui_scroll_alert_popup.eo.h>
# include <efl_ui_text_alert_popup.eo.h>
# include <efl_ui_anchor_popup.eo.h>
# include <efl_ui_popup_part_backwall.eo.h>
# include <efl_ui_grid.eo.h>
# include <efl_ui_list.eo.h>
/**
* Initialize Elementary
*

View File

@ -313,7 +313,6 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_alert_popup.eo.h>
# include <efl_ui_scroll_alert_popup.eo.h>
# include <efl_ui_text_alert_popup.eo.h>
# include <efl_ui_anchor_popup.eo.h>
# include <efl_ui_popup_part_backwall.eo.h>
# include <efl_ui_text_factory_images.eo.h>
# include <efl_ui_text_factory_emoticons.eo.h>
@ -331,10 +330,6 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_slider.eo.h>
# include <efl_ui_slider_interval.eo.h>
# include <efl_ui_layout_factory.eo.h>
# include <efl_ui_item_part_text.eo.h>
# include <efl_ui_item_part_icon.eo.h>
# include <efl_ui_item_part_extra.eo.h>
# include <efl_ui_item_part_content.eo.h>
# include <efl_ui_item.eo.h>
# include <efl_ui_list_default_item.eo.h>
# include <efl_ui_list_placeholder_item.eo.h>

View File

@ -1,337 +0,0 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EFL_UI_POPUP_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_popup_private.h"
#include "efl_ui_anchor_popup_private.h"
#define MY_CLASS EFL_UI_ANCHOR_POPUP_CLASS
#define MY_CLASS_NAME "Efl.Ui.Anchor_Popup"
static void
_anchor_calc(Eo *obj)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd);
EFL_UI_ANCHOR_POPUP_DATA_GET(obj, pd);
if (!pd->anchor) return;
Eina_Position2D pos = {0, 0};
Eina_Rect a_geom = efl_gfx_entity_geometry_get(pd->anchor);
Eina_Rect o_geom = efl_gfx_entity_geometry_get(obj);
Eina_Rect p_geom = efl_gfx_entity_geometry_get(ppd->win_parent);
pd->used_align = EFL_UI_POPUP_ALIGN_NONE;
/* 1. Find align which display popup.
It enables to shifting popup from exact position.
LEFT, RIGHT - shift only y position within anchor object's height
TOP, BOTTOM - shift only x position within anchor object's width
CENTER - shift both x, y position within anchor object's area
*/
for (int idx = 0; idx < 6; idx++)
{
Efl_Ui_Popup_Align cur_align;
if (idx == 0)
cur_align = ppd->align;
else
cur_align = pd->priority[idx - 1];
if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
continue;
switch(cur_align)
{
case EFL_UI_POPUP_ALIGN_TOP:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y - o_geom.h);
if ((pos.y < 0) ||
((pos.y + o_geom.h) > p_geom.h) ||
(o_geom.w > p_geom.w))
continue;
break;
case EFL_UI_POPUP_ALIGN_LEFT:
pos.x = (a_geom.x - o_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
if ((pos.x < 0) ||
((pos.x + o_geom.w) > p_geom.w) ||
(o_geom.h > p_geom.h))
continue;
break;
case EFL_UI_POPUP_ALIGN_RIGHT:
pos.x = (a_geom.x + a_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
if ((pos.x < 0) ||
((pos.x + o_geom.w) > p_geom.w) ||
(o_geom.h > p_geom.h))
continue;
break;
case EFL_UI_POPUP_ALIGN_BOTTOM:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y + a_geom.h);
if ((pos.y < 0) ||
((pos.y + o_geom.h) > p_geom.h) ||
(o_geom.w > p_geom.w))
continue;
break;
case EFL_UI_POPUP_ALIGN_CENTER:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
if ((o_geom.w > p_geom.w) || (o_geom.h > p_geom.h))
continue;
break;
default:
continue;
}
if ((cur_align == EFL_UI_POPUP_ALIGN_TOP) ||
(cur_align == EFL_UI_POPUP_ALIGN_BOTTOM) ||
(cur_align == EFL_UI_POPUP_ALIGN_CENTER))
{
if (pos.x < 0)
pos.x = 0;
if ((pos.x + o_geom.w) > p_geom.w)
pos.x = p_geom.w - o_geom.w;
if ((pos.x > (a_geom.x + a_geom.w)) ||
((pos.x + o_geom.w) < a_geom.x))
continue;
}
if ((cur_align == EFL_UI_POPUP_ALIGN_LEFT) ||
(cur_align == EFL_UI_POPUP_ALIGN_RIGHT) ||
(cur_align == EFL_UI_POPUP_ALIGN_CENTER))
{
if (pos.y < 0)
pos.y = 0;
if ((pos.y + o_geom.h) > p_geom.h)
pos.y = p_geom.h - o_geom.h;
if ((pos.y > (a_geom.y + a_geom.h)) ||
((pos.y + o_geom.h) < a_geom.y))
continue;
}
pd->used_align = cur_align;
goto end;
}
/* 2. Move popup to fit first valid align although entire popup can't display */
for (int idx = 0; idx < 6; idx++)
{
Efl_Ui_Popup_Align cur_align;
if (idx == 0)
cur_align = ppd->align;
else
cur_align = pd->priority[idx - 1];
if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
continue;
switch(cur_align)
{
case EFL_UI_POPUP_ALIGN_TOP:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y - o_geom.h);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_LEFT:
pos.x = (a_geom.x - o_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_RIGHT:
pos.x = (a_geom.x + a_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_BOTTOM:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y + a_geom.h);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_CENTER:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
pd->used_align = cur_align;
goto end;
break;
default:
break;
}
}
end:
if (pd->used_align != EFL_UI_POPUP_ALIGN_NONE)
efl_gfx_entity_position_set(efl_super(obj, EFL_UI_POPUP_CLASS), pos);
}
static void
_anchor_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
_anchor_calc(data);
}
static void
_anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
EFL_UI_POPUP_DATA_GET_OR_RETURN(data, ppd);
EFL_UI_ANCHOR_POPUP_DATA_GET(data, pd);
efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, data);
pd->anchor = NULL;
_anchor_calc(data);
}
static void
_anchor_detach(Eo *obj)
{
EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd);
EFL_UI_ANCHOR_POPUP_DATA_GET(obj, pd);
if (!pd->anchor) return;
efl_event_callback_del(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
}
EOLIAN static void
_efl_ui_anchor_popup_anchor_set(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd, Eo *anchor)
{
EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd);
_anchor_detach(obj);
pd->anchor = anchor;
if (anchor)
{
efl_event_callback_add(ppd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
}
_anchor_calc(obj);
}
EOLIAN static Efl_Object *
_efl_ui_anchor_popup_anchor_get(const Eo *obj EINA_UNUSED, Efl_Ui_Anchor_Popup_Data *pd)
{
return pd->anchor;
}
EOLIAN static void
_efl_ui_anchor_popup_align_priority_set(Eo *obj EINA_UNUSED,
Efl_Ui_Anchor_Popup_Data *pd,
Efl_Ui_Popup_Align first,
Efl_Ui_Popup_Align second,
Efl_Ui_Popup_Align third,
Efl_Ui_Popup_Align fourth,
Efl_Ui_Popup_Align fifth)
{
pd->priority[0] = first;
pd->priority[1] = second;
pd->priority[2] = third;
pd->priority[3] = fourth;
pd->priority[4] = fifth;
}
EOLIAN static void
_efl_ui_anchor_popup_align_priority_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Anchor_Popup_Data *pd,
Efl_Ui_Popup_Align *first,
Efl_Ui_Popup_Align *second,
Efl_Ui_Popup_Align *third,
Efl_Ui_Popup_Align *fourth,
Efl_Ui_Popup_Align *fifth)
{
if (first) *first = pd->priority[0];
if (second) *second = pd->priority[1];
if (third) *third = pd->priority[2];
if (fourth) *fourth = pd->priority[3];
if (fifth) *fifth = pd->priority[4];
}
EOLIAN static void
_efl_ui_anchor_popup_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd, Eina_Position2D pos)
{
_anchor_detach(obj);
pd->anchor = NULL;
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
EOLIAN static void
_efl_ui_anchor_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Anchor_Popup_Data *pd EINA_UNUSED)
{
efl_canvas_group_need_recalculate_set(obj, EINA_FALSE);
efl_canvas_group_calculate(efl_super(obj, MY_CLASS));
_anchor_calc(obj);
}
EOLIAN static Eo *
_efl_ui_anchor_popup_efl_object_constructor(Eo *obj,
Efl_Ui_Anchor_Popup_Data *pd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "anchor_popup");
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
pd->priority[0] = EFL_UI_POPUP_ALIGN_TOP;
pd->priority[1] = EFL_UI_POPUP_ALIGN_LEFT;
pd->priority[2] = EFL_UI_POPUP_ALIGN_RIGHT;
pd->priority[3] = EFL_UI_POPUP_ALIGN_BOTTOM;
pd->priority[4] = EFL_UI_POPUP_ALIGN_CENTER;
return obj;
}
EOLIAN static void
_efl_ui_anchor_popup_efl_object_destructor(Eo *obj,
Efl_Ui_Anchor_Popup_Data *pd EINA_UNUSED)
{
_anchor_detach(obj);
efl_destructor(efl_super(obj, MY_CLASS));
}
#include "efl_ui_anchor_popup.eo.c"

View File

@ -1,42 +0,0 @@
class @beta Efl.Ui.Anchor_Popup extends Efl.Ui.Popup
{
[[EFL UI Anchor Popup class]]
methods {
@property anchor {
set {
[[Set anchor popup to follow an anchor object.
If anchor object is moved or parent window is resized, the anchor popup moves to the new position.
If anchor object is set to NULL, the anchor popup stops following the anchor object.
When the popup is moved by using gfx_position_set, anchor is set NULL.
]]
}
get {
[[Returns the anchor object which the popup is following.]]
}
values {
anchor: Efl.Canvas.Object; [[The object which popup is following.]]
}
}
@property align_priority @beta {
set {
[[Set the align priority of a popup.]]
}
get {
[[Get the align priority of a popup.]]
}
values {
first: Efl.Ui.Popup_Align; [[First align priority]]
second: Efl.Ui.Popup_Align; [[Second align priority]]
third: Efl.Ui.Popup_Align; [[Third align priority]]
fourth: Efl.Ui.Popup_Align; [[Fourth align priority]]
fifth: Efl.Ui.Popup_Align; [[Fifth align priority]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Canvas.Group.group_calculate;
Efl.Gfx.Entity.position { set; }
}
}

View File

@ -1,17 +0,0 @@
#ifndef EFL_UI_ANCHOR_POPUP_H
#define EFL_UI_ANCHOR_POPUP_H
#include "Elementary.h"
typedef struct _Efl_Ui_Anchor_Popup_Data Efl_Ui_Anchor_Popup_Data;
struct _Efl_Ui_Anchor_Popup_Data
{
Eo *anchor;
Efl_Ui_Popup_Align priority[5];
Efl_Ui_Popup_Align used_align;
};
#define EFL_UI_ANCHOR_POPUP_DATA_GET(o, sd) \
Efl_Ui_Anchor_Popup_Data * sd = efl_data_scope_get(o, EFL_UI_ANCHOR_POPUP_CLASS)
#endif

View File

@ -878,7 +878,6 @@ EOLIAN Eina_Size2D
_efl_ui_animation_view_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Animation_View_Data *pd)
{
Eina_Rect viewbox = efl_canvas_vg_object_viewbox_get(pd->vg);
return EINA_SIZE2D(viewbox.w, viewbox.h);

View File

@ -1,6 +1,7 @@
enum Efl.Ui.Animation_View_State
{
[[State of animation view]]
not_ready, [[Animation is not ready to play. (Probably, it didn't file set yet or failed to read file.]]
play, [[Animation is on playing. see @Efl.Ui.Animation_View.play]]
play_back, [[Animation is on playing back (rewinding). see @Efl.Ui.Animation_View.play_back]]

View File

@ -2,11 +2,14 @@
# include <config.h>
#endif
#define EFL_UI_FACTORY_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
typedef struct _Efl_Ui_Caching_Factory_Data Efl_Ui_Caching_Factory_Data;
typedef struct _Efl_Ui_Caching_Factory_Request Efl_Ui_Caching_Factory_Request;
typedef struct _Efl_Ui_Caching_Factory_Group_Request Efl_Ui_Caching_Factory_Group_Request;
struct _Efl_Ui_Caching_Factory_Data
{
@ -31,8 +34,13 @@ struct _Efl_Ui_Caching_Factory_Request
{
Efl_Ui_Caching_Factory_Data *pd;
Efl_Ui_Caching_Factory *factory;
Eo *parent;
Efl_Model *model;
};
struct _Efl_Ui_Caching_Factory_Group_Request
{
Eina_Value done;
};
// Clear the cache until it meet the constraint
@ -84,88 +92,180 @@ _efl_ui_caching_factory_flush(Eo *obj, Efl_Ui_Caching_Factory_Data *pd)
}
static Eina_Value
_efl_ui_caching_factory_create_then(Eo *obj EINA_UNUSED, void *data, const Eina_Value v)
_efl_ui_caching_factory_uncap_then(Eo *model EINA_UNUSED,
void *data EINA_UNUSED,
const Eina_Value v)
{
Efl_Ui_Widget *widget = NULL;
if (eina_value_array_count(&v) != 1) return eina_value_error_init(EINVAL);
eina_value_array_get(&v, 0, &widget);
return eina_value_object_init(widget);
}
static Eina_Value
_efl_ui_caching_factory_create_then(Eo *model, void *data, const Eina_Value v)
{
Efl_Ui_Caching_Factory_Request *r = data;
Efl_Ui_Widget *w;
const char *string = NULL;
const char *style = NULL;
if (!eina_value_string_get(&v, &string))
if (!eina_value_string_get(&v, &style))
return eina_value_error_init(EFL_MODEL_ERROR_NOT_SUPPORTED);
w = eina_hash_find(r->pd->lookup, string);
w = eina_hash_find(r->pd->lookup, style);
if (!w)
{
Eina_Future *f;
Eo *models[1] = { model };
// No object of that style in the cache, need to create a new one
f = efl_ui_factory_create(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS),
r->model, r->parent);
// This is not ideal, we would want to gather all the request in one swoop here,
// left for later improvement.
f = efl_ui_factory_create(efl_super(r->factory, EFL_UI_CACHING_FACTORY_CLASS),
EINA_C_ARRAY_ITERATOR_NEW(models), r->parent);
f = efl_future_then(r->factory, f,
.success = _efl_ui_caching_factory_uncap_then,
.success_type = EINA_VALUE_TYPE_ARRAY);
return eina_future_as_value(f);
}
eina_hash_del(r->pd->lookup, string, w);
_efl_ui_caching_factory_remove(r->pd, r->pd->cache, w);
eina_hash_del(r->pd->lookup, style, w);
_efl_ui_caching_factory_remove(r->pd, eina_list_data_find(r->pd->cache, w), w);
efl_parent_set(w, r->parent);
efl_ui_view_model_set(w, r->model);
efl_ui_view_model_set(w, model);
return eina_value_object_init(w);
}
static void
_efl_ui_caching_factory_create_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
_efl_ui_caching_factory_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
Efl_Ui_Caching_Factory_Request *r = data;
efl_unref(r->model);
efl_unref(r->factory);
efl_unref(r->parent);
free(r);
}
static Eina_Value
_efl_ui_caching_factory_group_create_then(Eo *obj EINA_UNUSED,
void *data,
const Eina_Value v)
{
Efl_Ui_Caching_Factory_Group_Request *gr = data;
int len, i;
Efl_Ui_Widget *widget;
EINA_VALUE_ARRAY_FOREACH(&v, len, i, widget)
eina_value_array_append(&gr->done, widget);
return eina_value_reference_copy(&gr->done);
}
static void
_efl_ui_caching_factory_group_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
Efl_Ui_Caching_Factory_Group_Request *gr = data;
eina_value_flush(&gr->done);
free(gr);
}
static Eina_Future *
_efl_ui_caching_factory_efl_ui_factory_create(Eo *obj,
Efl_Ui_Caching_Factory_Data *pd,
Efl_Model *model, Efl_Gfx_Entity *parent)
Eina_Iterator *models, Efl_Gfx_Entity *parent)
{
Efl_Ui_Caching_Factory_Group_Request *gr;
Efl_Gfx_Entity *w = NULL;
Efl_Model *model;
Eina_Future *f;
if (pd->cache)
if (pd->cache && pd->style && !pd->klass)
{
if (pd->style && !pd->klass)
Efl_Ui_Caching_Factory_Request *r;
Eina_Future **all;
int count = 0;
r = calloc(1, sizeof (Efl_Ui_Caching_Factory_Request));
if (!r) return efl_loop_future_rejected(obj, ENOMEM);
r->pd = pd;
r->parent = efl_ref(parent);
r->factory = efl_ref(obj);
all = calloc(1, sizeof (Eina_Future *));
if (!all) return efl_loop_future_rejected(obj, ENOMEM);
EINA_ITERATOR_FOREACH(models, model)
{
Efl_Ui_Caching_Factory_Request *r;
all[count++] = efl_future_then(model,
efl_model_property_ready_get(model, pd->style),
.success = _efl_ui_caching_factory_create_then,
.data = r);
r = calloc(1, sizeof (Efl_Ui_Caching_Factory_Request));
if (!r) return efl_loop_future_rejected(obj, ENOMEM);
all = realloc(all, (count + 1) * sizeof (Eina_Future *));
if (!all) return efl_loop_future_rejected(obj, ENOMEM);
}
eina_iterator_free(models);
r->pd = pd;
r->parent = efl_ref(parent);
r->model = efl_ref(model);
all[count] = EINA_FUTURE_SENTINEL;
return efl_future_then(obj, efl_model_property_ready_get(obj, pd->style),
.success = _efl_ui_caching_factory_create_then,
.data = r,
.free = _efl_ui_caching_factory_create_cleanup);
return efl_future_then(obj, eina_future_all_array(all),
.data = r,
.free = _efl_ui_caching_factory_cleanup);
}
gr = calloc(1, sizeof (Efl_Ui_Caching_Factory_Group_Request));
if (!gr) return efl_loop_future_rejected(obj, ENOMEM);
eina_value_array_setup(&gr->done, EINA_VALUE_TYPE_OBJECT, 4);
// First get as much object from the cache as possible
if (pd->cache)
EINA_ITERATOR_FOREACH(models, model)
{
w = eina_list_data_get(pd->cache);
_efl_ui_caching_factory_remove(pd, pd->cache, w);
efl_parent_set(w, parent);
efl_ui_view_model_set(w, model);
eina_value_array_append(&gr->done, w);
if (!pd->cache) break;
}
// Now create object on the fly that are missing from the cache
if (pd->klass)
{
EINA_ITERATOR_FOREACH(models, model)
{
w = efl_add(pd->klass, parent,
efl_ui_factory_building(obj, efl_added),
efl_ui_view_model_set(efl_added, model));
eina_value_array_append(&gr->done, w);
}
w = eina_list_data_get(pd->cache);
f = efl_loop_future_resolved(obj, gr->done);
_efl_ui_caching_factory_remove(pd, pd->cache, w);
eina_value_flush(&gr->done);
free(gr);
efl_parent_set(w, parent);
return f;
}
if (!w)
{
if (pd->klass) w = efl_add(pd->klass, parent);
else return efl_ui_factory_create(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS),
model, parent);
}
efl_ui_view_model_set(w, model);
return efl_loop_future_resolved(obj, eina_value_object_init(w));
f = efl_ui_factory_create(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS),
models, parent);
return efl_future_then(obj, f,
.success = _efl_ui_caching_factory_group_create_then,
.success_type = EINA_VALUE_TYPE_ARRAY,
.data = gr,
.free = _efl_ui_caching_factory_group_cleanup);
}
static void

View File

@ -263,21 +263,40 @@ _efl_ui_collection_efl_ui_multi_selectable_selected_items_get(Eo *obj EINA_UNUSE
return eina_list_iterator_new(pd->selected);
}
static int
static inline void
_fill_group_flag(Eo *item, Efl_Ui_Position_Manager_Batch_Group_State *flag)
{
if (efl_isa(item, EFL_UI_GROUP_ITEM_CLASS))
*flag = EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP;
else if (efl_ui_item_parent_get(item))
*flag = EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_PART_OF_GROUP;
else
*flag = EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_NO_GROUP;
}
static Efl_Ui_Position_Manager_Batch_Result
_size_accessor_get_at(void *data, int start_id, Eina_Rw_Slice memory)
{
Fast_Accessor *accessor = data;
size_t i;
const Eina_List *lst = _fast_accessor_get_at(accessor, start_id);
Efl_Ui_Position_Manager_Batch_Size_Access *sizes = memory.mem;
Efl_Ui_Position_Manager_Batch_Result result = {-1, 0};
EINA_SAFETY_ON_NULL_RETURN_VAL(lst, -1);
EINA_SAFETY_ON_NULL_RETURN_VAL(lst, result);
for (i = 0; i < memory.len; ++i)
{
Efl_Gfx_Entity *geom = eina_list_data_get(lst);
Efl_Gfx_Entity *geom = eina_list_data_get(lst), *parent;
Eina_Size2D size = efl_gfx_hint_size_min_get(geom);
((Eina_Size2D*)memory.mem)[i] = size;
parent = efl_ui_item_parent_get(geom);
sizes[i].size = size;
_fill_group_flag(geom, &sizes[i].group);
if (i == 0 && sizes[0].group != EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP && parent)
{
result.group_id = efl_pack_index_get(efl_ui_item_container_get(parent), parent);
}
lst = eina_list_next(lst);
if (!lst)
{
@ -285,22 +304,32 @@ _size_accessor_get_at(void *data, int start_id, Eina_Rw_Slice memory)
break;
}
}
result.filled_items = i;
return i;
return result;
}
static int
static Efl_Ui_Position_Manager_Batch_Result
_obj_accessor_get_at(void *data, int start_id, Eina_Rw_Slice memory)
{
Fast_Accessor *accessor = data;
size_t i;
const Eina_List *lst = _fast_accessor_get_at(accessor, start_id);
Efl_Ui_Position_Manager_Batch_Entity_Access *objs = memory.mem;
Efl_Ui_Position_Manager_Batch_Result result = {-1, 0};
for (i = 0; i < memory.len; ++i)
{
Efl_Gfx_Entity *geom = eina_list_data_get(lst);
Efl_Gfx_Entity *geom = eina_list_data_get(lst), *parent;
parent = efl_ui_item_parent_get(geom);
objs[i].entity = geom;
_fill_group_flag(geom, &objs[i].group);
if (i == 0 && objs[0].group != EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP && parent)
{
result.group_id = efl_pack_index_get(efl_ui_item_container_get(parent), parent);
}
((Efl_Gfx_Entity**)memory.mem)[i] = geom;
lst = eina_list_next(lst);
if (!lst)
{
@ -308,7 +337,9 @@ _obj_accessor_get_at(void *data, int start_id, Eina_Rw_Slice memory)
break;
}
}
return i;
result.filled_items = i;
return result;
}
EOLIAN static Efl_Object*
@ -846,8 +877,8 @@ _efl_ui_collection_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Collection_Data *pd
Eina_Rect element;
element = efl_gfx_entity_geometry_get(focus);
viewport = efl_gfx_entity_geometry_get(obj);
if (!eina_spans_intersect(element.x, element.x+element.w, viewport.x, viewport.x+viewport.w) &&
!eina_spans_intersect(element.y, element.y+element.h, viewport.y, viewport.y+viewport.y))
if (!eina_spans_intersect(element.x, element.w, viewport.x, viewport.w) &&
!eina_spans_intersect(element.y, element.h, viewport.y, viewport.h))
{
efl_ui_scrollable_scroll(obj, element, EINA_TRUE);
return focus;

View File

@ -0,0 +1,43 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EFL_UI_LIST_DEFAULT_ITEM_PROTECTED
#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_DEFAULT_ITEM_CLASS
#define MY_CLASS_PFX efl_ui_default_item
#define MY_CLASS_NAME "Efl.Ui.Default_Item"
ELM_PART_TEXT_DEFAULT_GET(efl_ui_default_item, "efl.text")
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_default_item, void)
ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_default_item, void)
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_default_item, "efl.icon")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_default_item, void)
EOLIAN static Efl_Object *
_efl_ui_default_item_efl_part_part_get(const Eo *obj, void *pd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "text"))
return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, "efl.text");
else if (eina_streq(part, "icon"))
return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, "efl.icon");
else if (eina_streq(part, "extra"))
return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, "efl.extra");
return efl_part_get(efl_super(obj, MY_CLASS), part);
}
#define EFL_UI_DEFAULT_ITEM_EXTRA_OPS \
ELM_PART_TEXT_DEFAULT_OPS(efl_ui_default_item), \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_default_item)
#include "efl_ui_default_item.eo.c"

View File

@ -0,0 +1,30 @@
abstract @beta Efl.Ui.Default_Item extends Efl.Ui.Item implements
Efl.Text,
Efl.Text_Markup,
Efl.Ui.L10n,
Efl.Content
{
[[Default Item Class.
This class defines the standard parts of casual efl items.
The details about placement or item layout preferences are left to the extending classes.
Every text property related changes are mirrored to the text part. Content changes are mirrored to the content part.
]]
data: null;
parts {
text: Efl.Ui.Layout_Part_Text; [[The text part for default item.
text part is the caption of the item.]]
icon: Efl.Ui.Layout_Part_Content; [[The icon content part for default item.
icon part is the main content of item.]]
extra : Efl.Ui.Layout_Part_Content; [[The extra content part for default item.]]
}
implements {
Efl.Text.text { get; set; }
Efl.Text_Markup.markup { get; set; }
Efl.Ui.L10n.l10n_text { get; set; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Part.part_get;
}
}

View File

@ -68,6 +68,8 @@ struct _Node{
} graph;
Eina_Bool on_list : 1;
Eina_Bool unused : 1;
Eina_Bool this_is_root : 1;
};
#define T(n) (n->tree)
@ -85,6 +87,19 @@ typedef struct {
Node *root;
} Efl_Ui_Focus_Manager_Calc_Data;
static Eina_Mempool *_node_mempool;
static Node*
node_mem_get(void)
{
return eina_mempool_calloc(_node_mempool, sizeof(Node));
}
static void
node_mem_free(Node *n)
{
eina_mempool_free(_node_mempool, n);
}
static Node* _request_subchild(Node *node);
static void dirty_add(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Node *dirty);
@ -195,7 +210,7 @@ node_new(Efl_Ui_Focus_Object *focusable, Efl_Ui_Focus_Manager *manager)
{
Node *node;
node = calloc(1, sizeof(Node));
node = node_mem_get();
node->focusable = focusable;
node->manager = manager;
@ -237,42 +252,49 @@ node_item_free(Node *item)
/*cleanup graph parts*/
//add all neighbors of the node to the dirty list
for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
if (!item->unused)
{
Node *partner;
for(int i = EFL_UI_FOCUS_DIRECTION_UP; i < EFL_UI_FOCUS_DIRECTION_LAST; i++)
{
Node *partner;
#define MAKE_LIST_DIRTY(node, field) \
EINA_LIST_FOREACH(DIRECTION_ACCESS(node, i).field, l, partner) \
{ \
if (partner->type != NODE_TYPE_ONLY_LOGICAL) \
EINA_LIST_FOREACH(DIRECTION_ACCESS(node, i).field, l, partner) \
{ \
dirty_add(obj, pd, partner); \
dirty_added = EINA_TRUE; \
} \
if (partner->type != NODE_TYPE_ONLY_LOGICAL) \
{ \
dirty_add(obj, pd, partner); \
dirty_added = EINA_TRUE; \
} \
}
MAKE_LIST_DIRTY(item, one_direction)
MAKE_LIST_DIRTY(item, cleanup_nodes)
border_onedirection_cleanup(item, i);
border_onedirection_set(item, i, NULL);
}
MAKE_LIST_DIRTY(item, one_direction)
MAKE_LIST_DIRTY(item, cleanup_nodes)
border_onedirection_cleanup(item, i);
border_onedirection_set(item, i, NULL);
}
//the unregistering of a item should ever result in atleast a coords_dirty call
if (!dirty_added)
if (dirty_added)
efl_event_callback_call(obj, EFL_UI_FOCUS_MANAGER_EVENT_COORDS_DIRTY, NULL);
/*cleanup manager householdings*/
//remove from the focus stack
pd->focus_stack = eina_list_remove(pd->focus_stack, item);
if (!item->unused)
pd->focus_stack = eina_list_remove(pd->focus_stack, item);
//if this is the entry for redirect, NULL them out!
if (pd->redirect_entry == item->focusable)
pd->redirect_entry = NULL;
//remove from the dirty parts
pd->dirty = eina_list_remove(pd->dirty, item);
if (item->on_list)
pd->dirty = eina_list_remove(pd->dirty, item);
item->on_list = EINA_FALSE;
/*merge tree items*/
@ -307,7 +329,7 @@ node_item_free(Node *item)
//free the safed order
ELM_SAFE_FREE(T(item).saved_order, eina_list_free);
free(item);
node_mem_free(item);
}
//FOCUS-STACK HELPERS
@ -375,7 +397,7 @@ dirty_flush_node(Efl_Ui_Focus_Manager *obj EINA_UNUSED, Efl_Ui_Focus_Manager_Cal
Efl_Ui_Focus_Graph_Calc_Result result;
efl_ui_focus_graph_calc(&pd->graph_ctx, eina_iterator_filter_new(eina_hash_iterator_data_new(pd->node_hash), _no_logical, NULL, NULL) , (Opaque_Graph_Member*) node, &result);
node->unused = EINA_FALSE;
for (int i = 0; i < 4; ++i)
{
Efl_Ui_Focus_Direction direction = -1;
@ -506,7 +528,7 @@ _register(Eo *obj, Efl_Ui_Focus_Manager_Calc_Data *pd, Efl_Ui_Focus_Object *chil
node = node_new(child, obj);
eina_hash_add(pd->node_hash, &child, node);
node->unused = EINA_TRUE;
//add the parent
if (parent)
{
@ -878,14 +900,13 @@ static void
_free_node(void *data)
{
Node *node = data;
FOCUS_DATA(node->manager);
if (node->type == NODE_TYPE_ONLY_LOGICAL)
efl_event_callback_array_del(node->focusable, logical_node(), node->manager);
else
efl_event_callback_array_del(node->focusable, regular_node(), node->manager);
if (pd->root != data)
if (!node->this_is_root)
{
node_item_free(node);
}
@ -1496,6 +1517,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U
//make sure this manager is in the chain of redirects
_manager_in_chain_set(obj, pd);
node->unused = EINA_FALSE;
node_type = node->type;
new_focusable = node->focusable;
@ -1508,6 +1530,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_U
//remove the object from the list and add it again
if (node_type == NODE_TYPE_NORMAL)
{
EINA_SAFETY_ON_TRUE_RETURN(node->unused);
pd->focus_stack = eina_list_remove(pd->focus_stack, node);
pd->focus_stack = eina_list_append(pd->focus_stack, node);
}
@ -1736,6 +1759,7 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_root_set(Eo *obj EINA_UNUSED, Ef
node = _register(obj, pd, root, NULL, NODE_TYPE_ONLY_LOGICAL, NULL);
pd->root = node;
pd->root->this_is_root = 1;
return EINA_TRUE;
}
@ -1833,6 +1857,20 @@ _efl_ui_focus_manager_calc_efl_ui_focus_manager_fetch(Eo *obj, Efl_Ui_Focus_Mana
EOLIAN static void
_efl_ui_focus_manager_calc_class_constructor(Efl_Class *c EINA_UNUSED)
{
const char *choice, *tmp;
#ifdef EINA_DEFAULT_MEMPOOL
choice = "pass_through";
#else
choice = "chained_mempool";
#endif
tmp = getenv("EINA_MEMPOOL");
if (tmp && tmp[0])
choice = tmp;
_node_mempool = eina_mempool_add
(choice, "Focus-Node mempool", NULL, sizeof(Node), 20);
_focus_log_domain = eina_log_domain_register("elementary-focus", EINA_COLOR_CYAN);
}

View File

@ -37,6 +37,10 @@ _efl_ui_focus_parent_provider_gen_container_set(Eo *obj, Efl_Ui_Focus_Parent_Pro
EINA_SAFETY_ON_NULL_RETURN(efl_parent_get(pd->container));
pd->provider = efl_provider_find(efl_parent_get(pd->container), EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE);
ELM_WIDGET_DATA_GET(pd->container, wid_pd);
((Efl_Ui_Shared_Win_Data*)wid_pd->shared_win_data)->custom_parent_provider = EINA_TRUE;
}
EOLIAN static Efl_Ui_Widget*

View File

@ -16,50 +16,16 @@
#define MY_CLASS_NAME "Efl.Ui.Grid_Default_Item"
EOLIAN static Efl_Object *
_efl_ui_grid_default_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
_efl_ui_grid_default_item_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
{
Eo *eo;
eo = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
Eina_Error theme_apply = efl_ui_layout_theme_set(obj, "grid_item", NULL, NULL);
if (theme_apply == EFL_UI_THEME_APPLY_ERROR_GENERIC)
CRI("Default Item(%p) failed to set theme [efl/grid_item]!", eo);
eo = efl_constructor(efl_super(obj, MY_CLASS));
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "grid_item");
return eo;
}
EOLIAN static void
_efl_ui_grid_default_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
}
/* Efl.Part */
ELM_PART_TEXT_DEFAULT_GET(efl_ui_grid_default_item, "efl.text")
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_grid_default_item, void)
ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_grid_default_item, void)
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_grid_default_item, "efl.icon")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_grid_default_item, void)
EOLIAN static Efl_Object *
_efl_ui_grid_default_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "text"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_TEXT_CLASS, obj, "efl.text");
else if (eina_streq(part, "icon"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_ICON_CLASS, obj, "efl.icon");
else if (eina_streq(part, "extra"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_EXTRA_CLASS, obj, "efl.extra");
return efl_part_get(efl_super(obj, MY_CLASS), part);
}
/* Efl.Part end */
/* Internal EO APIs and hidden overrides */
#define EFL_UI_GRID_DEFAULT_ITEM_EXTRA_OPS \
ELM_PART_TEXT_DEFAULT_OPS(efl_ui_grid_default_item), \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_grid_default_item)
#include "efl_ui_grid_default_item.eo.c"

View File

@ -1,33 +1,9 @@
class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Item implements
Efl.Text,
Efl.Text_Markup,
Efl.Ui.L10n,
Efl.Content
class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Default_Item
{
[[Grid Default Item class.
This class need to be sub object of list widget.
Text and contents can be set using @Efl.Text,
@Efl.Content or @Efl.Part.]]
[[Grid Default Item class.]]
data: null;
parts {
text: Efl.Ui.Item_Part_Text; [[The text part for grid default item.
text part is the caption of grid item.]]
icon: Efl.Ui.Item_Part_Icon; [[The icon content part for grid default item.
icon part is the main content of grid item.]]
end: Efl.Ui.Item_Part_Extra; [[The extra content part for grid default item.
extra part is the spare content of grid item.
you can swallow small badge widget such as check, radio.]]
}
implements {
//Efl.Object
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Text.text { get; set; }
Efl.Text_Markup.markup { get; set; }
Efl.Ui.L10n.l10n_text { get; set; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Part.part_get;
Efl.Object.constructor;
}
}

View File

@ -0,0 +1,303 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#define EFL_UI_LIST_DEFAULT_ITEM_PROTECTED
#define EFL_PART_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_GROUP_ITEM_CLASS
#define MY_CLASS_PFX efl_ui_group_item
#define MY_CLASS_NAME "Efl.Ui.Grid_Default_Item"
typedef struct {
Eina_List *registered_items;
} Efl_Ui_Group_Item_Data;
EOLIAN static Efl_Object*
_efl_ui_group_item_efl_object_constructor(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED)
{
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "group_item");
return efl_constructor(efl_super(obj, MY_CLASS));
}
EOLIAN static void
_efl_ui_group_item_efl_object_invalidate(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED)
{
efl_pack_clear(obj);
efl_invalidate(efl_super(obj, MY_CLASS));
}
static void _unregister_item(Eo *obj EINA_UNUSED, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj);
static void
_invalidate(void *data, const Efl_Event *ev)
{
Efl_Ui_Group_Item_Data *pd = efl_data_scope_safe_get(data, MY_CLASS);
if (!pd) return;
_unregister_item(data, pd, ev->object);
}
static void
_register_item(Eo *obj, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj)
{
efl_ui_item_parent_set(subobj, obj);
efl_event_callback_add(subobj, EFL_EVENT_INVALIDATE, _invalidate, obj);
pd->registered_items = eina_list_append(pd->registered_items, subobj);
}
static void
_unregister_item(Eo *obj EINA_UNUSED, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj)
{
efl_ui_item_container_set(subobj, NULL);
efl_event_callback_del(subobj, EFL_EVENT_INVALIDATE, _invalidate, obj);
pd->registered_items = eina_list_remove(pd->registered_items, subobj);
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_pack_clear(Eo *obj EINA_UNUSED, Efl_Ui_Group_Item_Data *pd)
{
Eo *item;
while(pd->registered_items)
{
item = eina_list_data_get(pd->registered_items);
efl_del(item);
}
return EINA_TRUE;
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_unpack_all(Eo *obj, Efl_Ui_Group_Item_Data *pd)
{
Eo *item;
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
EINA_LIST_FREE(pd->registered_items, item)
{
efl_pack_unpack(container, item);
}
return EINA_TRUE;
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_unpack(Eo *obj, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj)
{
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
if (!efl_pack_unpack(container, subobj))
return EINA_FALSE;
_unregister_item(obj, pd, subobj);
return EINA_TRUE;
}
#define HANDLE_REG_CALL(cond) \
if (!(cond)) \
{ \
_unregister_item(obj, pd, subobj); \
return EINA_FALSE; \
} \
return EINA_TRUE;
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_pack(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(subobj == obj, EINA_FALSE);
return efl_pack_end(obj, subobj);
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(subobj == obj, EINA_FALSE);
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
int group_index = efl_pack_index_get(container, obj);
_register_item(obj, pd, subobj);
HANDLE_REG_CALL(efl_pack_at(container, subobj, group_index + eina_list_count(pd->registered_items) + 1));
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(subobj == obj, EINA_FALSE);
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
int group_index = efl_pack_index_get(container, obj);
_register_item(obj, pd, subobj);
HANDLE_REG_CALL(efl_pack_at(container, subobj, group_index + 1));
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(subobj == obj, EINA_FALSE);
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
//FIXME, maybe we should check if existing is really part of this group
_register_item(obj, pd, subobj);
HANDLE_REG_CALL(efl_pack_before(container, subobj, existing));
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(subobj == obj, EINA_FALSE);
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
//FIXME, maybe we should check if existing is really part of this group
_register_item(obj, pd, subobj);
HANDLE_REG_CALL(efl_pack_after(container, subobj, existing));
}
EOLIAN static Eina_Bool
_efl_ui_group_item_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Group_Item_Data *pd, Efl_Gfx_Entity *subobj, int index)
{
EINA_SAFETY_ON_TRUE_RETURN_VAL(subobj == obj, EINA_FALSE);
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, EINA_FALSE);
int group_index = efl_pack_index_get(container, obj);
int count = eina_list_count(pd->registered_items);
if (index < -count)
return efl_pack_begin(obj, subobj);
if (index >= count)
return efl_pack_end(obj, subobj);
if (index < 0)
index += count;
_register_item(obj, pd, subobj);
HANDLE_REG_CALL(efl_pack_at(container, subobj, group_index + 1 + index));
}
EOLIAN static Efl_Gfx_Entity*
_efl_ui_group_item_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Group_Item_Data *pd, int index)
{
Eo *result, *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, NULL);
int group_index = efl_pack_index_get(container, obj);
int count = eina_list_count(pd->registered_items);
if (index <= -count)
index = 0;
else if (index >= count)
index = eina_list_count(pd->registered_items);
else if (index < 0)
index += count;
result = efl_pack_unpack_at(container, group_index + 1 + index);
if (result)
_unregister_item(obj, pd, result);
return result;
}
EOLIAN static int
_efl_ui_group_item_efl_pack_linear_pack_index_get(Eo *obj, Efl_Ui_Group_Item_Data *pd, const Efl_Gfx_Entity *subobj)
{
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, -1);
int first_index = efl_pack_index_get(container, obj) + 1;
int subobj_index = efl_pack_index_get(container, subobj);
if (subobj_index == -1) return -1;
EINA_SAFETY_ON_FALSE_RETURN_VAL(first_index <= subobj_index && subobj_index < (first_index + (int)eina_list_count(pd->registered_items)), -1);
return subobj_index - (first_index);
}
EOLIAN static Efl_Gfx_Entity*
_efl_ui_group_item_efl_pack_linear_pack_content_get(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED, int index)
{
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, NULL);
int group_index = efl_pack_index_get(container, obj);
int count = eina_list_count(pd->registered_items);
if (index <= -count)
return eina_list_data_get(pd->registered_items);
if (index >= count)
return eina_list_last_data_get(pd->registered_items);
if (index < 0)
index += count;
return efl_pack_content_get(container, group_index + 1 + index);
}
typedef struct {
Eina_Iterator iterator;
unsigned int current;
unsigned int max;
Eo *container;
} Efl_Ui_Group_Item_Iterator;
static Eina_Bool
_next_item(Efl_Ui_Group_Item_Iterator *it, void **data)
{
if (it->current >= it->max) return EINA_FALSE;
*data = efl_pack_content_get(it->container, it->current);
it->current++;
return EINA_TRUE;
}
EOLIAN static Eina_Iterator*
_efl_ui_group_item_efl_container_content_iterate(Eo *obj, Efl_Ui_Group_Item_Data *pd EINA_UNUSED)
{
Eo *container = efl_ui_item_container_get(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(container, NULL);
Efl_Ui_Group_Item_Iterator *it;
it = calloc(1, sizeof (Efl_Ui_Group_Item_Iterator));
if (!it) return NULL;
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
it->current = efl_pack_index_get(container, obj) + 1;
it->max = it->current + eina_list_count(pd->registered_items);
it->container = container;
it->iterator.version = EINA_ITERATOR_VERSION;
it->iterator.next = FUNC_ITERATOR_NEXT(_next_item);
it->iterator.get_container = NULL;
it->iterator.free = FUNC_ITERATOR_FREE(free);
return &it->iterator;
}
EOLIAN static int
_efl_ui_group_item_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Group_Item_Data *pd)
{
return eina_list_count(pd->registered_items);
}
#include "efl_ui_group_item.eo.c"

View File

@ -0,0 +1,22 @@
class @beta Efl.Ui.Group_Item extends Efl.Ui.Default_Item implements Efl.Pack_Linear
{
[[Group item for grids and lists]]
implements {
Efl.Object.constructor;
Efl.Object.invalidate;
Efl.Pack.pack_clear;
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
Efl.Pack_Linear.pack_end;
Efl.Pack_Linear.pack_begin;
Efl.Pack_Linear.pack_before;
Efl.Pack_Linear.pack_after;
Efl.Pack_Linear.pack_at;
Efl.Pack_Linear.pack_unpack_at;
Efl.Pack_Linear.pack_index_get;
Efl.Pack_Linear.pack_content_get;
Efl.Container.content_iterate;
Efl.Container.content_count;
}
}

View File

@ -2,6 +2,8 @@
# include "elementary_config.h"
#endif
#define EFL_UI_FACTORY_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@ -36,28 +38,29 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Ui_Image_Fa
static Eina_Value
_efl_ui_image_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value value)
{
Efl_Gfx_Entity *entity = NULL;
Efl_Ui_Image_Factory_Data *pd = data;
Efl_Gfx_Entity *entity;
int len, i;
eina_value_pget(&value, &entity);
efl_ui_property_bind(entity, "filename", pd->property);
EINA_VALUE_ARRAY_FOREACH(&value, len, i, entity)
efl_ui_property_bind(entity, "filename", pd->property);
return value;
}
EOLIAN static Eina_Future *
_efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data *pd, Efl_Model *model, Efl_Gfx_Entity *parent)
_efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data *pd,
Eina_Iterator *models, Efl_Gfx_Entity *parent)
{
Eina_Future *f;
if (!parent) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED);
if (!pd->property) return efl_loop_future_rejected(obj, EFL_FACTORY_ERROR_NOT_SUPPORTED);
f = efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), model, parent);
f = efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), models, parent);
return efl_future_then(obj, f,
.success_type = EINA_VALUE_TYPE_OBJECT,
.success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_ui_image_factory_bind,
.data = pd);
}

View File

@ -377,15 +377,15 @@ _efl_ui_image_zoomable_pan_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Imag
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
_image_place(
wd->obj, psd->wsd->pan_x, psd->wsd->pan_y,
psd->wobj, psd->wsd->pan_x, psd->wsd->pan_y,
ox - psd->wsd->g_layer_zoom.imx, oy - psd->wsd->g_layer_zoom.imy, ow,
oh);
EINA_LIST_FOREACH(psd->wsd->grids, l, g)
{
_grid_load(wd->obj, g);
_grid_load(psd->wobj, g);
_grid_place(
wd->obj, g, psd->wsd->pan_x,
psd->wobj, g, psd->wsd->pan_x,
psd->wsd->pan_y, ox - psd->wsd->g_layer_zoom.imx,
oy - psd->wsd->g_layer_zoom.imy, ow, oh);
}
@ -536,7 +536,7 @@ _tile_preloaded_cb(void *data,
"efl");
efl_event_callback_legacy_call
(wd->obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOADED_DETAIL, NULL);
(git->obj, EFL_UI_IMAGE_ZOOMABLE_EVENT_LOADED_DETAIL, NULL);
}
}
}

View File

@ -2,150 +2,24 @@
# include "elementary_config.h"
#endif
#define EFL_ACCESS_PROTECTED
#define EFL_UI_WIDGET_PART_BG_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_item_private.h"
//part
#include "efl_ui_item_part_text.eo.h"
#include "efl_ui_item_part_icon.eo.h"
#include "efl_ui_item_part_extra.eo.h"
#include "efl_ui_item_part_content.eo.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_ITEM_CLASS
#define MY_CLASS_PFX efl_ui_item
#define MY_CLASS_NAME "Efl.Ui.Item"
/* Efl.Part */
EOLIAN static void
_efl_ui_item_part_text_efl_text_text_set(Eo *obj, void *pd EINA_UNUSED, const char *text)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
efl_text_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), text);
efl_canvas_group_change(wd->obj);
}
EOLIAN static const char*
_efl_ui_item_part_text_efl_text_text_get(const Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_text_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
EOLIAN static void
_efl_ui_item_part_text_efl_text_markup_markup_set(Eo *obj, void *pd EINA_UNUSED, const char *markup)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
efl_text_markup_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), markup);
efl_canvas_group_change(obj);
}
EOLIAN static const char*
_efl_ui_item_part_text_efl_text_markup_markup_get(const Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_text_markup_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
EOLIAN static const char *
_efl_ui_item_part_text_efl_ui_l10n_l10n_text_get(const Eo *obj, void *_pd EINA_UNUSED, const char **domain)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return elm_widget_part_translatable_text_get(pd->obj, pd->part, domain);
}
EOLIAN static void
_efl_ui_item_part_text_efl_ui_l10n_l10n_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text, const char *domain)
{
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
elm_widget_part_translatable_text_set(pd->obj, pd->part, text, domain);
}
#include "efl_ui_item_part_text.eo.c"
/* Efl.Ui.List_Default_Item_Part_Icon */
Eina_Bool
_efl_ui_item_part_icon_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
}
Efl_Gfx_Entity *
_efl_ui_item_part_icon_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
Efl_Gfx_Entity *
_efl_ui_item_part_icon_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
#include "efl_ui_item_part_icon.eo.c"
Eina_Bool
_efl_ui_item_part_extra_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
}
Efl_Gfx_Entity *
_efl_ui_item_part_extra_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
Efl_Gfx_Entity *
_efl_ui_item_part_extra_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
#include "efl_ui_item_part_extra.eo.c"
Eina_Bool
_efl_ui_item_part_content_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
}
Efl_Gfx_Entity *
_efl_ui_item_part_content_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
Efl_Gfx_Entity *
_efl_ui_item_part_content_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
{
Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
#include "efl_ui_item_part_content.eo.c"
/* Efl.Part */
static void
_item_select(Eo *obj, Efl_Ui_Item_Data *pd)
{
Efl_Ui_Select_Mode m;
if (pd->parent)
if (pd->container)
{
m = efl_ui_select_mode_get(pd->parent);
m = efl_ui_select_mode_get(pd->container);
if (m == EFL_UI_SELECT_MODE_NONE || (pd->selected && m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS))
return;
}
@ -245,7 +119,7 @@ _efl_ui_item_efl_object_destructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED)
EOLIAN static int
_efl_ui_item_index_get(const Eo *obj, Efl_Ui_Item_Data *pd)
{
return efl_pack_index_get(pd->parent, obj);
return efl_pack_index_get(pd->container, obj);
}
EOLIAN static void
@ -268,15 +142,48 @@ _efl_ui_item_efl_ui_selectable_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_It
EOLIAN static void
_efl_ui_item_container_set(Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd, Efl_Ui_Widget *container)
{
pd->parent = container;
pd->container = container;
if (!pd->container)
{
pd->parent = NULL;
}
}
EOLIAN static Efl_Ui_Widget*
_efl_ui_item_container_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd)
{
return pd->container;
}
EOLIAN static void
_efl_ui_item_item_parent_set(Eo *obj, Efl_Ui_Item_Data *pd, Efl_Ui_Item *parent)
{
if (pd->parent)
{
ERR("Parent is already set on object %p", obj);
return;
}
if (efl_invalidated_get(obj) || efl_invalidating_get(obj))
{
ERR("Parent cannot be set during invalidate");
return;
}
if (pd->container)
{
ERR("Parent must be set before adding the object to the container");
return;
}
pd->parent = parent;
}
EOLIAN static Efl_Ui_Item*
_efl_ui_item_item_parent_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd)
{
return pd->parent;
}
#include "efl_ui_item.eo.c"
#include "efl_ui_selectable.eo.c"
#include "efl_ui_multi_selectable.eo.c"

View File

@ -40,6 +40,15 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectab
container : Efl.Ui.Widget; [[The container this item is in.]]
}
}
@property item_parent {
[[The parent of the item.
This property expresses a tree structure of items. If the parent is NULL the item is added in the root level of the content. The item parent can only be set once, when the object is invalidated, the item parent is set to NULL and still cannot be reset.
]]
values {
parent : Efl.Ui.Item;
}
}
}
implements {
Efl.Object.constructor;

View File

@ -1,9 +0,0 @@
class @beta Efl.Ui.Item_Part_Content extends Efl.Ui.Layout_Part implements Efl.Content
{
[[Item internal content part class]]
data: null;
implements {
Efl.Content.content { get; set; }
Efl.Content.content_unset;
}
}

View File

@ -1,9 +0,0 @@
class @beta Efl.Ui.Item_Part_Extra extends Efl.Ui.Layout_Part implements Efl.Content
{
[[Item internal content of extra part class]]
data: null;
implements {
Efl.Content.content { get; set; }
Efl.Content.content_unset;
}
}

View File

@ -1,9 +0,0 @@
class @beta Efl.Ui.Item_Part_Icon extends Efl.Ui.Layout_Part implements Efl.Content
{
[[Item internal content of icon part class]]
data: null;
implements {
Efl.Content.content { get; set; }
Efl.Content.content_unset;
}
}

View File

@ -1,11 +0,0 @@
class @beta Efl.Ui.Item_Part_Text extends Efl.Ui.Layout_Part implements
Efl.Text, Efl.Text_Markup, Efl.Ui.L10n
{
[[Item internal text part class]]
data: null;
implements {
Efl.Text.text { set; get; }
Efl.Text_Markup.markup { get; set; }
Efl.Ui.L10n.l10n_text { get; set; }
}
}

View File

@ -6,7 +6,8 @@
typedef struct _Efl_Ui_Item_Data
{
// Eo Objects
Eo *parent; /* Parent Widget */
Eo *container; /* Parent Widget */
Efl_Ui_Item *parent;
// Boolean Data
Eina_Bool selected : 1; /* State for item selected */

View File

@ -191,10 +191,11 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Elm_Layout_Data *ld)
if (ld)
{
Eina_Size2D size = efl_gfx_entity_size_get(sd->obj);
if (ld->restricted_calc_w)
rest_w = MIN(wd->w, rest_w);
rest_w = MIN(size.w, rest_w);
if (ld->restricted_calc_h)
rest_h = MIN(wd->h, rest_h);
rest_h = MIN(size.h, rest_h);
}
edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
@ -2183,15 +2184,17 @@ _content_created(Eo *obj, void *data, const Eina_Value value)
Efl_Ui_Layout_Factory_Request *request = data;
Efl_Gfx_Entity *content = NULL;
Efl_Gfx_Entity *old_content;
int len, i;
eina_value_get(&value, &content);
EINA_VALUE_ARRAY_FOREACH(&value, len, i, content)
{
// Recycle old content
old_content = efl_content_get(efl_part(obj, request->key));
if (old_content) efl_ui_factory_release(request->factory, old_content);
// Recycle old content
old_content = efl_content_get(efl_part(obj, request->key));
if (old_content) efl_ui_factory_release(request->factory, old_content);
// Set new content
efl_content_set(efl_part(obj, request->key), content);
// Set new content
efl_content_set(efl_part(obj, request->key), content);
}
return value;
}
@ -2210,10 +2213,11 @@ _clean_request(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future E
static void
_efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Data *pd, Efl_Ui_Layout_Factory_Tracking *tracking, const char *key)
{
Efl_Ui_Layout_Factory_Request *request = calloc(1, sizeof (Efl_Ui_Layout_Factory_Request));
Efl_Ui_Layout_Factory_Request *request;
Eina_Future *f;
Efl_Model *model;
Efl_Model *models[1];
request = calloc(1, sizeof (Efl_Ui_Layout_Factory_Request));
if (!request) return ;
if (tracking->in_flight) eina_future_cancel(tracking->in_flight);
@ -2223,11 +2227,13 @@ _efl_ui_layout_view_model_content_update(Efl_Ui_Layout_Data *pd, Efl_Ui_Layout_F
request->factory = efl_ref(tracking->factory);
request->tracking = tracking;
model = efl_ui_view_model_get(pd->obj);
f = efl_ui_view_factory_create_with_event(tracking->factory, model, pd->obj);
models[0] = efl_ui_view_model_get(pd->obj);
f = efl_ui_view_factory_create_with_event(tracking->factory,
EINA_C_ARRAY_ITERATOR_NEW(models),
pd->obj);
f = efl_future_then(pd->obj, f,
.success = _content_created,
.success_type = EINA_VALUE_TYPE_OBJECT,
.success_type = EINA_VALUE_TYPE_ARRAY,
.data = request,
.free = _clean_request);
}

View File

@ -2,6 +2,8 @@
# include "elementary_config.h"
#endif
#define EFL_UI_FACTORY_PROTECTED
#include <Elementary.h>
#include "elm_priv.h"
@ -73,30 +75,39 @@ _efl_ui_layout_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value va
{
Efl_Ui_Layout_Factory_Data *pd = data;
Efl_Gfx_Entity *layout;
int len, i;
eina_value_pget(&value, &layout);
EINA_VALUE_ARRAY_FOREACH(&value, len, i, layout)
{
eina_hash_foreach(pd->bind.properties, _property_bind, layout);
eina_hash_foreach(pd->bind.factories, _factory_bind, layout);
efl_ui_layout_theme_set(layout, pd->klass, pd->group, pd->style);
eina_hash_foreach(pd->bind.properties, _property_bind, layout);
eina_hash_foreach(pd->bind.factories, _factory_bind, layout);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
}
return value;
}
static void
_efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
{
if (pd->klass || pd->group || pd->style)
efl_ui_layout_theme_set(ui_view, pd->klass, pd->group, pd->style);
efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), ui_view);
}
EOLIAN static Eina_Future *
_efl_ui_layout_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Layout_Factory_Data *pd,
Efl_Model *model, Efl_Gfx_Entity *parent)
Eina_Iterator *models, Efl_Gfx_Entity *parent)
{
Eina_Future *f;
f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), model, parent);
f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), models, parent);
return efl_future_then(obj, f,
.success_type = EINA_VALUE_TYPE_OBJECT,
.success_type = EINA_VALUE_TYPE_ARRAY,
.success = _efl_ui_layout_factory_bind,
.data = pd);
}
@ -148,8 +159,8 @@ _efl_ui_layout_factory_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSED, E
}
EOLIAN static void
_efl_ui_layout_factory_theme_config(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd
, const char *klass, const char *group, const char *style)
_efl_ui_layout_factory_theme_config(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Factory_Data *pd,
const char *klass, const char *group, const char *style)
{
eina_stringshare_replace(&pd->klass, klass);
eina_stringshare_replace(&pd->group, group);

View File

@ -16,6 +16,7 @@ class @beta Efl.Ui.Layout_Factory extends Efl.Ui.Caching_Factory
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Ui.Factory.create;
Efl.Ui.Factory.building;
Efl.Ui.Property_Bind.property_bind;
Efl.Ui.Factory_Bind.factory_bind;
}

View File

@ -16,47 +16,15 @@
#define MY_CLASS_NAME "Efl.Ui.List_Default_Item"
EOLIAN static Efl_Object *
_efl_ui_list_default_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
_efl_ui_list_default_item_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
{
Eo *eo;
eo = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, NULL);
if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
CRI("Default Item(%p) failed to set theme [efl/list_item]!", eo);
eo = efl_constructor(efl_super(obj, MY_CLASS));
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "list_item");
return eo;
}
EOLIAN static void
_efl_ui_list_default_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
{
efl_destructor(efl_super(obj, MY_CLASS));
}
ELM_PART_TEXT_DEFAULT_GET(efl_ui_list_default_item, "efl.text")
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_default_item, "efl.icon")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
EOLIAN static Efl_Object *
_efl_ui_list_default_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "text"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_TEXT_CLASS, obj, "efl.text");
else if (eina_streq(part, "icon"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_ICON_CLASS, obj, "efl.icon");
else if (eina_streq(part, "extra"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_EXTRA_CLASS, obj, "efl.extra");
return efl_part_get(efl_super(obj, MY_CLASS), part);
}
/* Internal EO APIs and hidden overrides */
#define EFL_UI_LIST_DEFAULT_ITEM_EXTRA_OPS \
ELM_PART_TEXT_DEFAULT_OPS(efl_ui_list_default_item), \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_default_item)
#include "efl_ui_list_default_item.eo.c"

View File

@ -1,30 +1,9 @@
class @beta Efl.Ui.List_Default_Item extends Efl.Ui.Item implements
Efl.Text,
Efl.Text_Markup,
Efl.Content
class @beta Efl.Ui.List_Default_Item extends Efl.Ui.Default_Item
{
[[List Default Item class.
This class need to be sub object of list widget.
text and contents can be appliable by efl_text,
efl_content or efl_part APIs.]]
[[List Default Item class.]]
data: null;
parts {
text: Efl.Ui.Item_Part_Text; [[The text part for list default item.]]
icon: Efl.Ui.Item_Part_Icon; [[The icon content part for list default item.
icon part is the left-side content of list item.]]
extra: Efl.Ui.Item_Part_Extra; [[The extra content part for list default item.
extra part is the right-side content of list item.]]
}
implements {
//Efl.Object
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Text.text { get; set; }
Efl.Text_Markup.markup { get; set; }
Efl.Ui.L10n.l10n_text { get; set; }
Efl.Content.content { get; set; }
Efl.Content.content_unset;
Efl.Part.part_get;
Efl.Object.constructor;
}
}

View File

@ -44,7 +44,7 @@ _efl_ui_list_placeholder_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNU
{
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
if (eina_streq(part, "content"))
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_CONTENT_CLASS, obj, "efl.content");
return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_CONTENT_CLASS, obj, "efl.content");
return efl_part_get(efl_super(obj, MY_CLASS), part);
}

View File

@ -6,7 +6,7 @@ class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.Item implements Efl.Cont
any kind of container.]]
data: null;
parts {
content: Efl.Ui.Item_Part_Content; [[the content part for list placeholder item.
content: Efl.Ui.Layout_Part_Content; [[the content part for list placeholder item.
the content part is empty slot for user customizing.
fill the place with container widget such as layout, box, table.]]
}

View File

@ -904,9 +904,10 @@ _content_created(Eo *obj, void *data, const Eina_Value value)
Efl_Ui_List_View_Layout_Item *item = tracking->item;
Efl_Ui_List_View_Item_Event evt;
eina_value_pget(&value, &item->layout);
if (eina_value_array_count(&value) != 1) return eina_value_error_init(EINVAL);
eina_value_array_get(&value, 0, &item->layout);
evas_object_smart_member_add(item->layout, tracking->pd->pan_obj);
efl_canvas_group_member_add(tracking->pd->pan_obj, item->layout);
evas_object_event_callback_add(item->layout, EVAS_CALLBACK_MOUSE_UP, _on_item_mouse_up, item);
if (_elm_config->atspi_mode)
@ -942,6 +943,7 @@ EOLIAN static Efl_Ui_List_View_Layout_Item *
_efl_ui_list_view_efl_ui_list_view_model_realize(Eo *obj, Efl_Ui_List_View_Data *pd, Efl_Ui_List_View_Layout_Item *item)
{
Efl_Ui_List_View_Layout_Item_Tracking *tracking;
Efl_Model *childrens[1];
EINA_SAFETY_ON_NULL_RETURN_VAL(item->children, item);
if (!item->children) return item;
@ -953,11 +955,14 @@ _efl_ui_list_view_efl_ui_list_view_model_realize(Eo *obj, Efl_Ui_List_View_Data
tracking->item = item;
tracking->pd = pd;
childrens[0] = item->children;
item->layout_request = efl_ui_view_factory_create_with_event(pd->factory, item->children, obj);
item->layout_request = efl_ui_view_factory_create_with_event(pd->factory,
EINA_C_ARRAY_ITERATOR_NEW(childrens),
obj);
item->layout_request = efl_future_then(obj, item->layout_request,
.success = _content_created,
.success_type = EINA_VALUE_TYPE_OBJECT,
.success_type = EINA_VALUE_TYPE_ARRAY,
.data = tracking,
.free = _clean_request);
@ -995,8 +1000,8 @@ _efl_ui_list_view_efl_ui_list_view_model_unrealize(Eo *obj, Efl_Ui_List_View_Dat
evt.index = efl_ui_list_view_item_index_get(item);
efl_event_callback_call(obj, EFL_UI_LIST_VIEW_EVENT_ITEM_UNREALIZED, &evt);
efl_canvas_group_member_remove(obj, pd->pan_obj);
efl_ui_factory_release(pd->factory, item->layout);
evas_object_smart_member_del(item->layout);
item->layout = NULL;
}

View File

@ -6,6 +6,7 @@
#define EFL_ACCESS_WIDGET_ACTION_PROTECTED
#define EFL_UI_FOCUS_LAYER_PROTECTED
#define EFL_PART_PROTECTED
#define EFL_UI_SCROLL_MANAGER_PROTECTED
#include <Elementary.h>
@ -55,14 +56,13 @@ _mirrored_set(Evas_Object *obj,
EOLIAN static void
_efl_ui_panel_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Panel_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (sd->delete_me) return;
if (sd->delete_me) return;
if (sd->scrollable)
{
if (sd->hidden) _drawer_close(obj, wd->w, wd->h, EINA_FALSE);
else _drawer_open(obj, wd->w, wd->h, EINA_FALSE);
Eina_Size2D size = efl_gfx_entity_size_get(obj);
if (sd->hidden) _drawer_close(obj, size.w, size.h, EINA_FALSE);
else _drawer_open(obj, size.w, size.h, EINA_FALSE);
}
efl_canvas_group_calculate(efl_super(obj, MY_CLASS));
@ -255,20 +255,20 @@ _handler_open(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
switch (sd->orient)
{
case EFL_UI_PANEL_ORIENT_TOP:
elm_interface_scrollable_region_bring_in
(obj, 0, (h * sd->content_size_ratio) - sd->handler_size, w, h);
efl_ui_scrollable_scroll
(obj, EINA_RECT(0, (h * sd->content_size_ratio) - sd->handler_size, w, h), EINA_TRUE);
break;
case EFL_UI_PANEL_ORIENT_BOTTOM:
elm_interface_scrollable_region_bring_in
(obj, 0, sd->handler_size, w, h);
efl_ui_scrollable_scroll
(obj, EINA_RECT(0, sd->handler_size, w, h), EINA_TRUE);
break;
case EFL_UI_PANEL_ORIENT_LEFT:
elm_interface_scrollable_region_bring_in
(obj, (w * sd->content_size_ratio) - sd->handler_size, 0, w, h);
efl_ui_scrollable_scroll
(obj, EINA_RECT((w * sd->content_size_ratio) - sd->handler_size, 0, w, h), EINA_TRUE);
break;
case EFL_UI_PANEL_ORIENT_RIGHT:
elm_interface_scrollable_region_bring_in
(obj, sd->handler_size, 0, w, h);
efl_ui_scrollable_scroll
(obj, EINA_RECT(sd->handler_size, 0, w, h), EINA_TRUE);
break;
}
}
@ -281,8 +281,7 @@ _drawer_open(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
if (sd->freeze)
{
elm_interface_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
efl_ui_scrollable_movement_block_set(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
}
@ -305,21 +304,16 @@ _drawer_open(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
x = w * sd->content_size_ratio;
break;
}
if (anim)
elm_interface_scrollable_region_bring_in
(obj, x, y, w, h);
else
elm_interface_scrollable_content_region_show
(obj, x, y, w, h);
efl_ui_scrollable_scroll(obj, EINA_RECT(x, y, w, h), anim);
}
static void
_drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
{
EFL_UI_PANEL_DATA_GET(obj, sd);
int x = 0, y = 0, cx, cy;
int x = 0, y = 0;
Eina_Bool horizontal = EINA_FALSE;
Eina_Position2D c;
elm_widget_tree_unfocusable_set(obj, EINA_TRUE);
switch (sd->orient)
@ -344,17 +338,17 @@ _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
break;
}
elm_interface_scrollable_content_pos_get(obj, &cx, &cy);
c = efl_ui_scrollable_content_pos_get(obj);
if ((x == cx) && (y == cy))
if ((x == c.x) && (y == c.y))
{
if (!sd->freeze)
{
if (horizontal)
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
else
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
sd->freeze = EINA_TRUE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,hidden", "efl");
@ -367,23 +361,23 @@ _drawer_close(Evas_Object *obj, Evas_Coord w, Evas_Coord h, Eina_Bool anim)
{
if (sd->freeze)
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
}
elm_interface_scrollable_region_bring_in(obj, x, y, w, h);
efl_ui_scrollable_scroll(obj, EINA_RECT(x, y, w, h), anim);
}
else
{
elm_interface_scrollable_content_region_show(obj, x, y, w, h);
efl_ui_scrollable_scroll(obj, EINA_RECT(x, y, w, h), anim);
if (!sd->freeze)
{
if (horizontal)
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
else
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
sd->freeze = EINA_TRUE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,hidden", "efl");
@ -447,6 +441,7 @@ _state_sync(Evas_Object *obj)
EFL_UI_PANEL_DATA_GET(obj, sd);
Evas_Coord pos, panel_size, w, h, threshold;
Eina_Bool horizontal = EINA_FALSE, reverse = EINA_FALSE;
Eina_Position2D c;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
@ -467,12 +462,13 @@ _state_sync(Evas_Object *obj)
break;
}
c = efl_ui_scrollable_content_pos_get(obj);
if (horizontal)
{
if (w <= 0) return EINA_TRUE;
panel_size = w * sd->content_size_ratio;
elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
pos = c.x;
reverse ^= efl_ui_mirrored_get(obj);
}
else
@ -480,7 +476,7 @@ _state_sync(Evas_Object *obj)
if (h <= 0) return EINA_TRUE;
panel_size = h * sd->content_size_ratio;
elm_interface_scrollable_content_pos_get(obj, NULL, &pos);
pos = c.y;
}
threshold = (sd->hidden) ? panel_size - (panel_size / 4) : (panel_size / 4);
@ -509,7 +505,7 @@ _timer_cb(void *data)
if (sd->freeze)
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
@ -617,7 +613,7 @@ _on_mouse_move(void *data,
case EFL_UI_PANEL_ORIENT_TOP:
if (sd->timer && ((cur_y - sd->down_y) > finger_size))
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
@ -626,7 +622,7 @@ _on_mouse_move(void *data,
case EFL_UI_PANEL_ORIENT_BOTTOM:
if (sd->timer && ((sd->down_y - cur_y) > finger_size))
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
@ -636,7 +632,7 @@ _on_mouse_move(void *data,
if ((!is_mirrored && (sd->timer) && ((cur_x - sd->down_x) > finger_size)) ||
((is_mirrored) && (sd->timer) && ((sd->down_x - cur_x) > finger_size)))
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
@ -646,7 +642,7 @@ _on_mouse_move(void *data,
if ((is_mirrored && (sd->timer) && ((cur_x - sd->down_x) > finger_size)) ||
(!is_mirrored && (sd->timer) && ((sd->down_x - cur_x) > finger_size)))
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
@ -751,16 +747,6 @@ _efl_ui_panel_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Panel_Data *
return ret;
}
EOLIAN static void
_efl_ui_panel_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Position2D pos)
{
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
efl_gfx_entity_position_set(sd->hit_rect, pos);
}
static void
_scrollable_layout_resize(Eo *obj, Efl_Ui_Panel_Data *sd, Evas_Coord w, Evas_Coord h)
{
@ -794,7 +780,6 @@ _efl_ui_panel_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Size2
if (!sd->scrollable) return;
efl_gfx_entity_size_set(sd->hit_rect, sz);
_scrollable_layout_resize(obj, sd, sz.w, sz.h);
}
@ -803,7 +788,7 @@ _efl_ui_panel_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_Panel_Data *sd,
{
efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
if (sd->hit_rect) evas_object_raise(sd->hit_rect);
if (sd->scr_event) evas_object_raise(sd->scr_event);
}
EOLIAN static void
@ -924,12 +909,12 @@ _efl_ui_panel_orient_set(Eo *obj, Efl_Ui_Panel_Data *sd, Efl_Ui_Panel_Orient ori
{
case EFL_UI_PANEL_ORIENT_TOP:
case EFL_UI_PANEL_ORIENT_BOTTOM:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
break;
case EFL_UI_PANEL_ORIENT_LEFT:
case EFL_UI_PANEL_ORIENT_RIGHT:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
break;
}
@ -985,8 +970,9 @@ EOLIAN static Eina_Rect
_efl_ui_panel_efl_ui_widget_interest_region_get(const Eo *obj, Efl_Ui_Panel_Data *sd)
{
Eina_Rect r = {};
Eina_Position2D p;
elm_interface_scrollable_content_pos_get(obj, &r.x, &r.y);
p = efl_ui_scrollable_content_pos_get(obj);
evas_object_geometry_get(obj, NULL, NULL, &r.w, &r.h);
switch (sd->orient)
{
@ -1001,17 +987,21 @@ _efl_ui_panel_efl_ui_widget_interest_region_get(const Eo *obj, Efl_Ui_Panel_Data
}
if (r.w < 1) r.w = 1;
if (r.h < 1) r.h = 1;
r.x = p.x;
r.y = p.y;
return r;
}
static void
_anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
_anim_stop_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
Eo *obj = event->object;
EFL_UI_PANEL_DATA_GET(obj, sd);
Evas_Object *ao;
Evas_Coord pos, w, h, panel_size = 0;
Eina_Bool open = EINA_FALSE, horizontal = EINA_FALSE, reverse = EINA_FALSE;
Eina_Position2D c;
if (elm_widget_disabled_get(obj)) return;
@ -1030,13 +1020,14 @@ _anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
break;
}
c = efl_ui_scrollable_content_pos_get(obj);
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
if (horizontal)
{
if (w <= 0) return;
panel_size = w * sd->content_size_ratio;
elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
pos = c.x;
reverse ^= efl_ui_mirrored_get(obj);
}
else
@ -1044,7 +1035,7 @@ _anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
if (h <= 0) return;
panel_size = h * sd->content_size_ratio;
elm_interface_scrollable_content_pos_get(obj, NULL, &pos);
pos = c.y;
}
if (pos == 0) open = !reverse;
@ -1053,9 +1044,6 @@ _anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
if (open)
{
elm_interface_scrollable_single_direction_set
(obj, ELM_SCROLLER_SINGLE_DIRECTION_HARD);
//focus & access
elm_object_tree_focus_allow_set(obj, EINA_TRUE);
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
@ -1070,17 +1058,14 @@ _anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
else
{
if (horizontal)
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
else
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
sd->freeze = EINA_TRUE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,hidden", "efl");
elm_interface_scrollable_single_direction_set
(obj, ELM_SCROLLER_SINGLE_DIRECTION_NONE);
//focus & access
elm_object_tree_focus_allow_set(obj, EINA_FALSE);
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
@ -1092,63 +1077,21 @@ _anim_stop_cb(Evas_Object *obj, void *data EINA_UNUSED)
}
static void
_scroll_cb(Evas_Object *obj, void *data EINA_UNUSED)
_scroll_cb(void *data EINA_UNUSED, const Efl_Event *event_info EINA_UNUSED)
{
Eo *obj = event_info->object;
EFL_UI_PANEL_DATA_GET(obj, sd);
Efl_Ui_Panel_Scroll_Info event;
Evas_Coord x, y, w, h;
if (elm_widget_disabled_get(obj)) return;
// in the case of
// freeze_set(FALSE) -> mouse_up -> freeze_set(TRUE) -> scroll
if (sd->freeze)
{
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_NONE);
sd->freeze = EINA_FALSE;
elm_layout_signal_emit(sd->scr_ly, "efl,state,content,visible", "efl");
}
elm_interface_scrollable_content_pos_get(obj, &x, &y);
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
switch (sd->orient)
{
case EFL_UI_PANEL_ORIENT_TOP:
event.rel_x = 1;
event.rel_y = 1 - ((double) y / (double) ((sd->content_size_ratio) * h));
break;
case EFL_UI_PANEL_ORIENT_BOTTOM:
event.rel_x = 1;
event.rel_y = (double) y / (double) ((sd->content_size_ratio) * h);
break;
case EFL_UI_PANEL_ORIENT_LEFT:
if (!efl_ui_mirrored_get(obj))
{
event.rel_x = 1 - ((double) x / (double) ((sd->content_size_ratio) * w));
event.rel_y = 1;
}
else
{
event.rel_x = (double) x / (double) ((sd->content_size_ratio) * w);
event.rel_y = 1;
}
break;
case EFL_UI_PANEL_ORIENT_RIGHT:
if (efl_ui_mirrored_get(obj))
{
event.rel_x = 1 - ((double) x / (double) ((sd->content_size_ratio) * w));
event.rel_y = 1;
}
else
{
event.rel_x = (double) x / (double) ((sd->content_size_ratio) * w);
event.rel_y = 1;
}
break;
}
efl_event_callback_legacy_call
(obj, EFL_UI_EVENT_SCROLL, (void *) &event);
}
EOLIAN static void
@ -1164,13 +1107,13 @@ _efl_ui_panel_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bo
{
case ELM_PANEL_ORIENT_BOTTOM:
case ELM_PANEL_ORIENT_TOP:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
break;
case ELM_PANEL_ORIENT_RIGHT:
case ELM_PANEL_ORIENT_LEFT:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
break;
}
@ -1192,13 +1135,13 @@ _efl_ui_panel_efl_ui_widget_disabled_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bo
{
case ELM_PANEL_ORIENT_BOTTOM:
case ELM_PANEL_ORIENT_TOP:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
break;
case ELM_PANEL_ORIENT_RIGHT:
case ELM_PANEL_ORIENT_LEFT:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
break;
}
@ -1279,29 +1222,33 @@ _efl_ui_panel_scrollable_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bool scrollabl
elm_widget_resize_object_set(obj, sd->scr_edje);
if (!sd->hit_rect)
if (!sd->smanager)
{
sd->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_smart_member_add(sd->hit_rect, obj);
elm_widget_sub_object_add(obj, sd->hit_rect);
evas_object_color_set(sd->hit_rect, 0, 0, 0, 0);
evas_object_show(sd->hit_rect);
evas_object_repeat_events_set(sd->hit_rect, EINA_TRUE);
sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj));
elm_interface_scrollable_objects_set(obj, sd->scr_edje, sd->hit_rect);
elm_interface_scrollable_animate_stop_cb_set(obj, _anim_stop_cb);
elm_interface_scrollable_scroll_cb_set(obj, _scroll_cb);
efl_event_callback_add(obj, EFL_UI_EVENT_SCROLL_ANIM_STOP, _anim_stop_cb, NULL);
efl_event_callback_add(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, NULL);
}
efl_composite_attach(obj, sd->smanager);
efl_ui_scroll_connector_bind(obj, sd->smanager);
if (!sd->pan_obj)
{
sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj);
efl_ui_scroll_manager_pan_set(sd->smanager, sd->pan_obj);
efl_content_set(efl_part(sd->scr_edje, "efl.content"), sd->pan_obj);
}
if (!sd->scr_ly)
{
sd->scr_ly = efl_add(EFL_UI_LAYOUT_CLASS, obj,
elm_layout_theme_set(efl_added,
"panel",
"scrollable/left",
elm_widget_style_get(obj)));
efl_ui_layout_theme_set(efl_added,
"panel", "scrollable/left",
efl_ui_widget_style_get(obj)));
evas_object_smart_member_add(sd->scr_ly, obj);
efl_canvas_group_member_add(obj, sd->scr_ly);
elm_widget_sub_object_add(obj, sd->scr_ly);
_scrollable_layout_theme_set(obj, sd);
@ -1318,7 +1265,7 @@ _efl_ui_panel_scrollable_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bool scrollabl
elm_layout_content_set(sd->scr_ly, "event_area", sd->scr_event);
}
elm_interface_scrollable_content_set(obj, sd->scr_ly);
efl_content_set(sd->pan_obj, sd->scr_ly);
sd->freeze = EINA_TRUE;
efl_content_set(efl_part(sd->scr_ly, "efl.content"), sd->bx);
if (sd->content) elm_widget_sub_object_add(sd->scr_ly, sd->content);
@ -1327,19 +1274,16 @@ _efl_ui_panel_scrollable_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bool scrollabl
{
case EFL_UI_PANEL_ORIENT_TOP:
case EFL_UI_PANEL_ORIENT_BOTTOM:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_VERTICAL);
break;
case EFL_UI_PANEL_ORIENT_LEFT:
case EFL_UI_PANEL_ORIENT_RIGHT:
elm_interface_scrollable_movement_block_set
efl_ui_scrollable_movement_block_set
(obj, EFL_UI_SCROLL_BLOCK_HORIZONTAL);
break;
}
elm_interface_scrollable_single_direction_set
(obj, ELM_SCROLLER_SINGLE_DIRECTION_NONE);
if (!elm_widget_disabled_get(obj) && !sd->callback_added)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
@ -1357,7 +1301,8 @@ _efl_ui_panel_scrollable_set(Eo *obj, Efl_Ui_Panel_Data *sd, Eina_Bool scrollabl
}
else
{
elm_interface_scrollable_content_set(obj, NULL);
efl_ui_scroll_connector_unbind(obj);
efl_composite_detach(obj, sd->smanager);
if (sd->callback_added)
{

View File

@ -15,7 +15,7 @@ struct @beta Efl.Ui.Panel_Scroll_Info
rel_y: double; [[content scrolled position (0.0 ~ 1.0) in the panel]]
}
class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Layer, Elm.Interface_Scrollable, Efl.Content,
class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Layer, Efl.Ui.Scrollable_Interactive, Efl.Content,
Efl.Access.Widget.Action
{
[[Elementary panel class]]
@ -76,7 +76,6 @@ class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Laye
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Gfx.Entity.position { set; }
Efl.Gfx.Entity.size { set; }
Efl.Canvas.Group.group_member_add;
Efl.Canvas.Group.group_calculate;
@ -93,4 +92,7 @@ class @beta Efl.Ui.Panel extends Efl.Ui.Layout_Base implements Efl.Ui.Focus.Laye
events {
toggled: void; [[Called when the hidden state was toggled]]
}
composite {
Efl.Ui.Scrollable_Interactive;
}
}

View File

@ -31,8 +31,9 @@ struct _Efl_Ui_Panel_Data
Evas_Object *bx, *content;
Evas_Object *event;
Evas_Object *scr_ly;
Evas_Object *hit_rect, *panel_edje, *scr_edje;
Evas_Object *panel_edje, *scr_edje;
Evas_Object *scr_panel, *scr_event;
Evas_Object *smanager, *pan_obj;
Efl_Ui_Panel_Orient orient;

View File

@ -18,23 +18,6 @@
static const char PART_NAME_BACKWALL[] = "backwall";
static void
_backwall_clicked_cb(void *data,
Eo *o EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
Eo *obj = data;
efl_event_callback_call(obj, EFL_UI_POPUP_EVENT_BACKWALL_CLICKED, NULL);
}
EOLIAN static void
_efl_ui_popup_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eina_Position2D pos)
{
pd->align = EFL_UI_POPUP_ALIGN_NONE;
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
static void
_calc_align(Eo *obj)
{
@ -74,6 +57,293 @@ _calc_align(Eo *obj)
}
}
static void
_anchor_calc(Eo *obj)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, pd);
if (!pd->anchor) return;
Eina_Position2D pos = {0, 0};
Eina_Rect a_geom = efl_gfx_entity_geometry_get(pd->anchor);
Eina_Rect o_geom = efl_gfx_entity_geometry_get(obj);
Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent);
pd->used_align = EFL_UI_POPUP_ALIGN_NONE;
/* 1. Find align which display popup.
It enables to shifting popup from exact position.
LEFT, RIGHT - shift only y position within anchor object's height
TOP, BOTTOM - shift only x position within anchor object's width
CENTER - shift both x, y position within anchor object's area
*/
for (int idx = 0; idx < 6; idx++)
{
Efl_Ui_Popup_Align cur_align;
if (idx == 0)
cur_align = pd->align;
else
cur_align = pd->priority[idx - 1];
if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
continue;
switch(cur_align)
{
case EFL_UI_POPUP_ALIGN_TOP:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y - o_geom.h);
if ((pos.y < 0) ||
((pos.y + o_geom.h) > p_geom.h) ||
(o_geom.w > p_geom.w))
continue;
break;
case EFL_UI_POPUP_ALIGN_LEFT:
pos.x = (a_geom.x - o_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
if ((pos.x < 0) ||
((pos.x + o_geom.w) > p_geom.w) ||
(o_geom.h > p_geom.h))
continue;
break;
case EFL_UI_POPUP_ALIGN_RIGHT:
pos.x = (a_geom.x + a_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
if ((pos.x < 0) ||
((pos.x + o_geom.w) > p_geom.w) ||
(o_geom.h > p_geom.h))
continue;
break;
case EFL_UI_POPUP_ALIGN_BOTTOM:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y + a_geom.h);
if ((pos.y < 0) ||
((pos.y + o_geom.h) > p_geom.h) ||
(o_geom.w > p_geom.w))
continue;
break;
case EFL_UI_POPUP_ALIGN_CENTER:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
if ((o_geom.w > p_geom.w) || (o_geom.h > p_geom.h))
continue;
break;
default:
continue;
}
if ((cur_align == EFL_UI_POPUP_ALIGN_TOP) ||
(cur_align == EFL_UI_POPUP_ALIGN_BOTTOM) ||
(cur_align == EFL_UI_POPUP_ALIGN_CENTER))
{
if (pos.x < 0)
pos.x = 0;
if ((pos.x + o_geom.w) > p_geom.w)
pos.x = p_geom.w - o_geom.w;
if ((pos.x > (a_geom.x + a_geom.w)) ||
((pos.x + o_geom.w) < a_geom.x))
continue;
}
if ((cur_align == EFL_UI_POPUP_ALIGN_LEFT) ||
(cur_align == EFL_UI_POPUP_ALIGN_RIGHT) ||
(cur_align == EFL_UI_POPUP_ALIGN_CENTER))
{
if (pos.y < 0)
pos.y = 0;
if ((pos.y + o_geom.h) > p_geom.h)
pos.y = p_geom.h - o_geom.h;
if ((pos.y > (a_geom.y + a_geom.h)) ||
((pos.y + o_geom.h) < a_geom.y))
continue;
}
pd->used_align = cur_align;
goto end;
}
/* 2. Move popup to fit first valid align although entire popup can't display */
for (int idx = 0; idx < 6; idx++)
{
Efl_Ui_Popup_Align cur_align;
if (idx == 0)
cur_align = pd->align;
else
cur_align = pd->priority[idx - 1];
if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
continue;
switch(cur_align)
{
case EFL_UI_POPUP_ALIGN_TOP:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y - o_geom.h);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_LEFT:
pos.x = (a_geom.x - o_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_RIGHT:
pos.x = (a_geom.x + a_geom.w);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_BOTTOM:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = (a_geom.y + a_geom.h);
pd->used_align = cur_align;
goto end;
break;
case EFL_UI_POPUP_ALIGN_CENTER:
pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
pd->used_align = cur_align;
goto end;
break;
default:
break;
}
}
end:
if (pd->used_align != EFL_UI_POPUP_ALIGN_NONE)
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
static void
_anchor_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
_anchor_calc(data);
}
static void
_anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
EFL_UI_POPUP_DATA_GET_OR_RETURN(data, pd);
efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, data);
pd->anchor = NULL;
_anchor_calc(data);
}
static void
_anchor_detach(Eo *obj, Efl_Ui_Popup_Data *pd)
{
if (!pd->anchor) return;
efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_del(pd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
}
EOLIAN static void
_efl_ui_popup_anchor_set(Eo *obj, Efl_Ui_Popup_Data *pd, Eo *anchor)
{
_anchor_detach(obj, pd);
pd->anchor = anchor;
if (anchor)
{
efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _anchor_geom_cb, obj);
efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
_anchor_calc(obj);
}
else
_calc_align(obj);
}
EOLIAN static Efl_Object *
_efl_ui_popup_anchor_get(const Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
{
return pd->anchor;
}
EOLIAN static void
_efl_ui_popup_align_priority_set(Eo *obj EINA_UNUSED,
Efl_Ui_Popup_Data *pd,
Efl_Ui_Popup_Align first,
Efl_Ui_Popup_Align second,
Efl_Ui_Popup_Align third,
Efl_Ui_Popup_Align fourth,
Efl_Ui_Popup_Align fifth)
{
pd->priority[0] = first;
pd->priority[1] = second;
pd->priority[2] = third;
pd->priority[3] = fourth;
pd->priority[4] = fifth;
}
EOLIAN static void
_efl_ui_popup_align_priority_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Popup_Data *pd,
Efl_Ui_Popup_Align *first,
Efl_Ui_Popup_Align *second,
Efl_Ui_Popup_Align *third,
Efl_Ui_Popup_Align *fourth,
Efl_Ui_Popup_Align *fifth)
{
if (first) *first = pd->priority[0];
if (second) *second = pd->priority[1];
if (third) *third = pd->priority[2];
if (fourth) *fourth = pd->priority[3];
if (fifth) *fifth = pd->priority[4];
}
static void
_backwall_clicked_cb(void *data,
Eo *o EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
Eo *obj = data;
efl_event_callback_call(obj, EFL_UI_POPUP_EVENT_BACKWALL_CLICKED, NULL);
}
EOLIAN static void
_efl_ui_popup_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Popup_Data *pd, Eina_Position2D pos)
{
pd->align = EFL_UI_POPUP_ALIGN_NONE;
_anchor_detach(obj, pd);
pd->anchor = NULL;
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
EOLIAN static void
_efl_ui_popup_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Popup_Data *pd, Eina_Size2D size)
{
@ -93,8 +363,17 @@ _parent_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED)
efl_canvas_group_change(obj);
}
static void
_hints_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
Efl_Ui_Popup_Data *pd = data;
if (!pd->in_calc)
efl_canvas_group_change(ev->object);
}
EOLIAN static void
_efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent)
_efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd, Eo *parent)
{
if (!parent)
{
@ -209,6 +488,7 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
elm_widget_theme_klass_set(obj, "popup");
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _hints_changed_cb, pd);
elm_widget_can_focus_set(obj, EINA_TRUE);
if (elm_widget_theme_object_set(obj, wd->resize_obj,
@ -227,6 +507,11 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
pd->align = EFL_UI_POPUP_ALIGN_CENTER;
pd->priority[0] = EFL_UI_POPUP_ALIGN_TOP;
pd->priority[1] = EFL_UI_POPUP_ALIGN_LEFT;
pd->priority[2] = EFL_UI_POPUP_ALIGN_RIGHT;
pd->priority[3] = EFL_UI_POPUP_ALIGN_BOTTOM;
pd->priority[4] = EFL_UI_POPUP_ALIGN_CENTER;
return obj;
}
@ -234,6 +519,7 @@ EOLIAN static void
_efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd)
{
ELM_SAFE_DEL(pd->backwall);
_anchor_detach(obj, pd);
efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb,
obj);
@ -274,7 +560,10 @@ _efl_ui_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Popup_Data *pd)
_sizing_eval(obj);
pd->in_calc = EINA_FALSE;
}
_calc_align(obj);
if (pd->anchor)
_anchor_calc(obj);
else
_calc_align(obj);
Eina_Rect p_geom = efl_gfx_entity_geometry_get(pd->win_parent);
@ -372,15 +661,15 @@ _efl_ui_popup_part_backwall_efl_file_load(Eo *obj, void *_pd EINA_UNUSED)
efl_del(prev_obj);
}
Eo *image = elm_image_add(pd->obj);
Eo *image = efl_add(EFL_UI_IMAGE_CLASS, pd->obj);
Eina_Bool ret;
const Eina_File *f;
f = efl_file_mmap_get(obj);
if (f)
ret = elm_image_mmap_set(image, f, efl_file_key_get(obj));
ret = efl_file_simple_mmap_load(image, f, efl_file_key_get(obj));
else
ret = elm_image_file_set(image, efl_file_get(obj), efl_file_key_get(obj));
ret = efl_file_simple_load(image, efl_file_get(obj), efl_file_key_get(obj));
if (!ret)
{
efl_del(image);

View File

@ -36,6 +36,36 @@ class @beta Efl.Ui.Popup extends Efl.Ui.Layout_Base implements Efl.Content, Efl.
time: double; [[Timeout in seconds]]
}
}
@property anchor {
set {
[[Set anchor popup to follow an anchor object.
If anchor object is moved or parent window is resized, the anchor popup moves to the new position.
If anchor object is set to NULL, the anchor popup stops following the anchor object.
When the popup is moved by using gfx_position_set, anchor is set NULL.
]]
}
get {
[[Returns the anchor object which the popup is following.]]
}
values {
anchor: Efl.Canvas.Object; [[The object which popup is following.]]
}
}
@property align_priority {
set {
[[Set the align priority of a popup.]]
}
get {
[[Get the align priority of a popup.]]
}
values {
first: Efl.Ui.Popup_Align; [[First align priority]]
second: Efl.Ui.Popup_Align; [[Second align priority]]
third: Efl.Ui.Popup_Align; [[Third align priority]]
fourth: Efl.Ui.Popup_Align; [[Fourth align priority]]
fifth: Efl.Ui.Popup_Align; [[Fifth align priority]]
}
}
}
parts {
backwall: Efl.Ui.Popup_Part_Backwall; [[A backwall behind the popup.]]

View File

@ -7,6 +7,9 @@ struct _Efl_Ui_Popup_Data
Eo *win_parent;
Eo *backwall;
Efl_Ui_Popup_Align align;
Eo *anchor;
Efl_Ui_Popup_Align priority[5];
Efl_Ui_Popup_Align used_align;
Ecore_Timer *timer;
double timeout;
Eina_Bool in_calc : 1;

View File

@ -11,21 +11,31 @@ typedef struct {
Eina_Free_Cb free_cb;
} Api_Callback;
typedef struct {
unsigned int start_id, end_id;
} Vis_Segment;
static inline int
_fill_buffer(Api_Callback *cb , int start_id, int len, void *data)
_fill_buffer(Api_Callback *cb , int start_id, int len, int *group_id, void *data)
{
Efl_Ui_Position_Manager_Batch_Result res;
Eina_Rw_Slice slice;
slice.mem = data;
slice.len = len;
return cb->access(cb->data, start_id, slice);
res = cb->access(cb->data, start_id, slice);
if (group_id)
*group_id = res.group_id;
return res.filled_items;
}
static inline void
vis_change_segment(Api_Callback *cb, int a, int b, Eina_Bool flag)
{
const int len = 50;
Efl_Gfx_Entity *data[len];
Efl_Ui_Position_Manager_Batch_Entity_Access data[len];
if (a == b) return;
@ -36,9 +46,9 @@ vis_change_segment(Api_Callback *cb, int a, int b, Eina_Bool flag)
if (buffer_id == 0)
{
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(cb, MIN(a,b), len, data) >= 0);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(cb, MIN(a,b), len, NULL, data) >= 0);
}
ent = data[i - MIN(a,b)];
ent = data[buffer_id].entity;
if (ent && !flag && (efl_ui_focus_object_focus_get(ent) || efl_ui_focus_object_child_focus_get(ent)))
{
//we should not make focused object invisible, rather move it to some parking lot
@ -51,3 +61,20 @@ vis_change_segment(Api_Callback *cb, int a, int b, Eina_Bool flag)
}
}
#endif
static inline void
vis_segment_swap(Api_Callback *cb, Vis_Segment new, Vis_Segment old)
{
if (new.end_id <= old.start_id || new.start_id >= old.end_id)
{
//it is important to first make the segment visible here, and then hide the rest
//otherwise we get a state where item_container has 0 subchildren, which triggers a lot of focus logic.
vis_change_segment(cb, new.start_id, new.end_id, EINA_TRUE);
vis_change_segment(cb, old.start_id, old.end_id, EINA_FALSE);
}
else
{
vis_change_segment(cb, old.start_id, new.start_id, (old.start_id > new.start_id));
vis_change_segment(cb, old.end_id, new.end_id, (old.end_id < new.end_id));
}
}

View File

@ -1,25 +1,51 @@
import efl_ui;
enum Efl.Ui.Position_Manager.Batch_Group_State{
[[Enum expressing the group related state of a item.]]
no_group = 0, [[This item is not a group item and is not part of any group.]]
group = 1, [[This item is a group item.]]
part_of_group = 2 [[This item is part of a group.]]
}
struct Efl.Ui.Position_Manager.Batch_Entity_Access{
[[Struct that is getting filled by the object function callback.]]
entity : Efl.Gfx.Entity; [[The canvas object.]]
group : Efl.Ui.Position_Manager.Batch_Group_State; [[If this is a group item.]]
}
struct Efl.Ui.Position_Manager.Batch_Size_Access{
[[Struct that is getting filled by the size function callback.]]
size : Eina.Size2D; [[The size of the element.]]
group : Efl.Ui.Position_Manager.Batch_Group_State; [[If this is a group item.]]
}
struct Efl.Ui.Position_Manager.Batch_Result {
[[Struct that is returned by the function callbacks.]]
group_id : int; [[The group of the first item. If the first item is a group, or the first item does not have a group, -1 will be the id]]
filled_items : int; [[The number of items that are filled into the slice]]
}
function Efl.Ui.Position_Manager.Batch_Access_Entity {
[[ Function callback for getting a batch of items]]
[[ Function callback for getting a batch of items.]]
params {
start_id : int; [[The id of the first item to fetch]]
memory : rw_slice<Efl.Gfx.Entity>; [[The slice to fill the information in, the full slice will be filled if there are enough items]]
memory : rw_slice<Efl.Ui.Position_Manager.Batch_Entity_Access>; [[The slice to fill the information in, the full slice will be filled if there are enough items]]
}
return: int; [[The number of filled elements in the slice]]
return: Efl.Ui.Position_Manager.Batch_Result; [[The returned stats of this function call.]]
};
function Efl.Ui.Position_Manager.Batch_Access_Size {
[[ Function callback for getting sizes of a batch of items]]
params {
start_id : int; [[The id of the first item to fetch]]
memory : rw_slice<Efl.Gfx.Entity>; [[The slice to fill the information in, the full slice will be filled if there are enough items]]
memory : rw_slice<Efl.Ui.Position_Manager.Batch_Size_Access>; [[The slice to fill the information in, the full slice will be filled if there are enough items]]
}
return: int; [[The number of filled elements in the slice]]
return: Efl.Ui.Position_Manager.Batch_Result; [[The returned stats of this function call]]
};
struct Efl.Ui.Position_Manager.Range_Update {
[[A struct containing the the updated range of visible items in this position manger]]
[[A struct containing the the updated range of visible items in this position manger.]]
start_id : uint; [[The first item that is visible]]
end_id : uint; [[The last item that is visible]]
}

View File

@ -15,34 +15,425 @@
typedef struct {
Api_Callback min_size, object;
unsigned int size;
unsigned int groups;
Eina_Rect viewport;
Eina_Vector2 scroll_position;
Efl_Ui_Layout_Orientation dir;
struct {
unsigned int start_id, end_id;
} prev_run;
Vis_Segment prev_run;
Eina_Size2D max_min_size;
Eina_Size2D last_viewport_size;
Eina_Size2D prev_min_size;
struct {
int columns;
int rows;
} current_display_table;
Eina_Inarray *group_cache;
Eina_Bool group_cache_dirty;
int *size_cache;
Eina_Bool size_cache_dirty;
Eo *last_group;
Eina_Future *rebuild_absolut_size;
} Efl_Ui_Position_Manager_Grid_Data;
typedef struct {
Eina_Bool real_group;
Eina_Size2D group_header_size;
int items;
} Group_Cache_Line;
static void
_group_cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
unsigned int i;
const int len = 100;
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[len];
Group_Cache_Line line = { 0 };
if (!pd->group_cache_dirty)
return;
pd->group_cache_dirty = EINA_FALSE;
if (pd->group_cache)
eina_inarray_free(pd->group_cache);
pd->group_cache = eina_inarray_new(sizeof(Group_Cache_Line), 10);
for (i = 0; i < pd->size; ++i)
{
int buffer_id = i % len;
if (buffer_id == 0)
{
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, i, len, NULL, size_buffer) > 0);
}
if (size_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP)
{
eina_inarray_push(pd->group_cache, &line);
line.real_group = EINA_TRUE;
line.group_header_size = size_buffer[buffer_id].size;
line.items = 1;
}
else if (size_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_PART_OF_GROUP ||
(!line.real_group && size_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_NO_GROUP))
{
line.items ++;
}
else if (size_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_NO_GROUP && line.real_group)
{
eina_inarray_push(pd->group_cache, &line);
line.real_group = EINA_FALSE;
line.group_header_size = EINA_SIZE2D(0, 0);
line.items = 0;
}
}
eina_inarray_push(pd->group_cache, &line);
}
static inline void
_group_cache_invalidate(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
pd->group_cache_dirty = EINA_TRUE;
pd->size_cache_dirty = EINA_TRUE;
}
static void
_size_cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
if (!pd->size_cache_dirty) return;
_group_cache_require(obj, pd);
pd->size_cache_dirty = EINA_FALSE;
if (pd->size_cache)
free(pd->size_cache);
pd->size_cache = calloc(sizeof(int), eina_inarray_count(pd->group_cache));
for (unsigned int i = 0; i < eina_inarray_count(pd->group_cache); ++i)
{
Group_Cache_Line *line = eina_inarray_nth(pd->group_cache, i);
int header_out = 0;
if (line->real_group)
header_out = 1;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
pd->size_cache[i] = line->group_header_size.h +
(ceil(
(double)(line->items - header_out)/ /* the number of real items in the group (- the group item) */
(int)(pd->viewport.w/pd->max_min_size.w))) /* devided by the number of items per row */
*pd->max_min_size.h;
else
pd->size_cache[i] = (ceil((double)(line->items - header_out)/
(int)((pd->viewport.h-line->group_header_size.h)/pd->max_min_size.h)))*pd->max_min_size.w;
}
}
static inline void
_size_cache_invalidate(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
pd->size_cache_dirty = EINA_TRUE;
}
typedef struct {
int resulting_id;
int consumed_space;
} Search_Result;
static inline Search_Result
_search_id(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, int relevant_space_size)
{
int consumed_space = 0;
int consumed_groups = -1;
int consumed_ids = 0;
int sub_ids = 0;
Search_Result res;
//first we search how many blocks we can skip
for (unsigned int i = 0; i < eina_inarray_count(pd->group_cache); ++i)
{
Group_Cache_Line *line = eina_inarray_nth(pd->group_cache, i);
if (consumed_space + pd->size_cache[i] > relevant_space_size)
break;
consumed_space += pd->size_cache[i];
consumed_groups = i;
consumed_ids += line->items;
}
Group_Cache_Line *line = NULL;
if (consumed_groups > -1 && consumed_groups + 1 < (int)eina_inarray_count(pd->group_cache))
line = eina_inarray_nth(pd->group_cache, consumed_groups + 1);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
//now we have relevant_space_size - consumed_space left maybe we are searching the group item
if (line && line->real_group)
{
if (consumed_space + line->group_header_size.h > relevant_space_size)
{
res.resulting_id = consumed_ids;
res.consumed_space = consumed_space;
return res;
}
else
{
consumed_space += line->group_header_size.h;
consumed_ids += 1;
}
}
//now we need to locate at which id we are starting
int space_top = relevant_space_size - consumed_space;
consumed_space += floor(space_top/pd->max_min_size.h)*pd->max_min_size.h;
sub_ids = floor(space_top/pd->max_min_size.h)*(pd->viewport.w/pd->max_min_size.w);
}
else
{
int header_height = 0;
if (line && line->real_group)
{
header_height = line->group_header_size.h;
}
//now we need to locate at which id we are starting
const int space_left = relevant_space_size - consumed_space;
consumed_space += floor(space_left/pd->max_min_size.w)*pd->max_min_size.w;
sub_ids = floor(space_left/pd->max_min_size.w)*((pd->viewport.h-header_height)/pd->max_min_size.h);
if (line && line->real_group &&
sub_ids > 0) /* if we are in the first row, we need the group item to be visible, otherwise, we need to add that to the consumed ids */
{
sub_ids += 1;
}
}
res.resulting_id = consumed_ids + sub_ids;
res.consumed_space = consumed_space;
return res;
}
static inline Eina_Bool
_search_start_end(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, int relevant_viewport, int relevant_space_size, unsigned int step, Vis_Segment *cur, int *consumed_space)
{
Search_Result start = _search_id(obj, pd, MAX(relevant_space_size, 0));
Search_Result end = _search_id(obj, pd, MAX(relevant_space_size, 0)+relevant_viewport+step*2);
cur->start_id = MIN(MAX(start.resulting_id, 0), (int)pd->size);
cur->end_id = MAX(MIN(end.resulting_id, (int)pd->size), 0);
*consumed_space = start.consumed_space;
return EINA_TRUE;
}
typedef struct {
int relevant_space_size;
int consumed_space;
Vis_Segment new;
Eo *floating_group;
Eina_Size2D floating_size;
Eo *placed_item;
} Item_Position_Context;
static inline void
_place_grid_item(Eina_Rect *geom, Efl_Ui_Position_Manager_Grid_Data *pd, int x, int y)
{
geom->x += x*pd->max_min_size.w;
geom->y += y*pd->max_min_size.h;
geom->size = pd->max_min_size;
}
static inline void
_position_items_vertical(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Item_Position_Context *ctx)
{
Eina_Position2D start = pd->viewport.pos;
unsigned int i;
const int len = 100;
int columns, last_block_start = ctx->new.start_id;
Efl_Ui_Position_Manager_Batch_Entity_Access obj_buffer[len];
if (!pd->viewport.w || !pd->viewport.h) return;
start.y -= (ctx->relevant_space_size - ctx->consumed_space);
columns = pd->viewport.w/pd->max_min_size.w;
for (i = ctx->new.start_id; i < ctx->new.end_id; ++i)
{
int buffer_id = (i-ctx->new.start_id) % len;
if (buffer_id == 0)
{
int tmp_group;
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->object, i, len, &tmp_group, obj_buffer) > 0);
if (tmp_group != -1 && i == ctx->new.start_id)
{
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[1];
Efl_Ui_Position_Manager_Batch_Entity_Access obj_buffer[1];
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, tmp_group, 1, NULL, size_buffer) != 0);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->object, tmp_group, 1, NULL, obj_buffer) != 0);
ctx->floating_group = obj_buffer[0].entity;
ctx->floating_size.h = size_buffer[0].size.h;
ctx->floating_size.w = pd->viewport.w;
}
}
Eina_Rect geom;
geom.pos = start;
int x = (i - last_block_start)%columns;
int y = (i - last_block_start)/columns;
if (obj_buffer[buffer_id].entity == pd->last_group)
pd->last_group = NULL;
if (obj_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP)
{
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[1];
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, i, 1, NULL, size_buffer) == 1);
if (x != 0)
y += 1;
last_block_start = i + 1;
start.y += size_buffer[0].size.h + y*pd->max_min_size.h;
geom.size = pd->viewport.size;
geom.h = size_buffer[0].size.h;
geom.y += y*pd->max_min_size.h;
if (!ctx->placed_item)
ctx->placed_item = obj_buffer[buffer_id].entity;
}
else
{
_place_grid_item(&geom, pd, x, y);
}
efl_gfx_entity_geometry_set(obj_buffer[buffer_id].entity, geom);
}
}
static inline void
_position_items_horizontal(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Item_Position_Context *ctx)
{
Eina_Position2D start = pd->viewport.pos;
unsigned int i;
const int len = 100;
int columns, last_block_start = ctx->new.start_id;
Efl_Ui_Position_Manager_Batch_Entity_Access obj_buffer[len];
if (!pd->viewport.w || !pd->viewport.h) return;
start.x -= (ctx->relevant_space_size - ctx->consumed_space);
columns = (pd->viewport.h)/pd->max_min_size.h;
for (i = ctx->new.start_id; i < ctx->new.end_id; ++i)
{
int buffer_id = (i-ctx->new.start_id) % len;
if (buffer_id == 0)
{
int tmp_group;
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->object, i, len, &tmp_group, obj_buffer) > 0);
if (tmp_group != -1 && i == ctx->new.start_id && pd->dir != EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[1];
Efl_Ui_Position_Manager_Batch_Entity_Access obj_buffer[1];
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, tmp_group, 1, NULL, size_buffer) != 0);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->object, tmp_group, 1, NULL, obj_buffer) != 0);
start.y += size_buffer[0].size.h;
columns = (pd->viewport.h - size_buffer[0].size.h)/pd->max_min_size.h;
ctx->floating_group = obj_buffer[0].entity;
ctx->floating_size.h = size_buffer[0].size.h;
ctx->floating_size.w = pd->viewport.w;
}
}
Eina_Rect geom;
geom.pos = start;
int x = (i - last_block_start)/columns;
int y = (i - last_block_start)%columns;
if (obj_buffer[buffer_id].entity == pd->last_group)
pd->last_group = NULL;
if (obj_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP)
{
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[1];
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, i, 1, NULL, size_buffer) == 1);
last_block_start = i + 1;
start.y = pd->viewport.y + size_buffer[0].size.h;
start.x += x*pd->max_min_size.w;
geom.size.h = size_buffer[0].size.h;
geom.size.w = pd->viewport.w;
geom.x += x*pd->max_min_size.w;
geom.y = pd->viewport.y;
columns = (pd->viewport.h - size_buffer[0].size.h)/pd->max_min_size.h;
if (!ctx->placed_item)
ctx->placed_item = obj_buffer[buffer_id].entity;
}
else
{
_place_grid_item(&geom, pd, x, y);
}
efl_gfx_entity_geometry_set(obj_buffer[buffer_id].entity, geom);
}
}
static inline void
_position_group_items(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Item_Position_Context *ctx)
{
//floating group is not yet positioned, in case it is there, we need to position it there
Eina_Rect geom;
if (!ctx->floating_group && pd->last_group)
{
efl_gfx_entity_visible_set(pd->last_group, EINA_FALSE);
pd->last_group = NULL;
}
if (ctx->floating_group)
{
geom.pos = pd->viewport.pos;
geom.size = ctx->floating_size;
if (ctx->placed_item)
{
Eina_Rect placed = efl_gfx_entity_geometry_get(ctx->placed_item);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
geom.y = MIN(geom.y, placed.y-geom.h);
}
else
{
geom.x = MIN(geom.x, placed.x-geom.w);
}
}
if (pd->last_group != ctx->floating_group)
{
efl_gfx_entity_visible_set(pd->last_group, EINA_FALSE);
pd->last_group = ctx->floating_group;
}
efl_gfx_entity_visible_set(ctx->floating_group, EINA_TRUE);
efl_gfx_stack_raise_to_top(ctx->floating_group);
efl_gfx_entity_geometry_set(ctx->floating_group, geom);
}
else if (ctx->placed_item)
{
Eina_Rect placed = efl_gfx_entity_geometry_get(ctx->placed_item);
placed.x = MAX(placed.x, pd->viewport.x);
placed.y = MAX(placed.y, pd->viewport.y);
efl_gfx_entity_geometry_set(ctx->placed_item, placed);
efl_gfx_stack_raise_to_top(ctx->placed_item);
}
}
static void
_reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
Eina_Size2D space_size;
int relevant_space_size, relevant_viewport;
unsigned int start_id, end_id, step;
const int len = 100;
Efl_Gfx_Entity *obj_buffer[len];
int relevant_space_size, relevant_viewport, consumed_space;
Vis_Segment cur;
unsigned int step;
Efl_Ui_Position_Manager_Range_Update ev;
Item_Position_Context ctx;
if (!pd->size) return;
if (pd->max_min_size.w <= 0 || pd->max_min_size.h <= 0) return;
if (pd->current_display_table.columns <= 0 || pd->current_display_table.rows <= 0) return;
if (!eina_inarray_count(pd->group_cache)) return;
//space size contains the amount of space that is outside the viewport (either to the top or to the left)
space_size.w = (MAX(pd->last_viewport_size.w - pd->viewport.w, 0))*pd->scroll_position.x;
@ -60,62 +451,34 @@ _reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
relevant_viewport = pd->viewport.w;
step = pd->max_min_size.w;
}
start_id = MIN((MAX(relevant_space_size,0) / step)*pd->current_display_table.columns, pd->size);
end_id = MIN((((MAX(relevant_space_size,0) + relevant_viewport + step) / step)*pd->current_display_table.columns)+1, pd->size);
EINA_SAFETY_ON_FALSE_RETURN(start_id <= end_id);
EINA_SAFETY_ON_FALSE_RETURN(start_id <= pd->size);
if (!_search_start_end(obj, pd, relevant_viewport, relevant_space_size, step, &cur, &consumed_space))
return;
//to performance optimize the whole widget, we are setting the objects that are outside the viewport to visibility false
//The code below ensures that things outside the viewport are always hidden, and things inside the viewport are visible
if (end_id < pd->prev_run.start_id || start_id > pd->prev_run.end_id)
vis_segment_swap(&pd->object, cur, pd->prev_run);
ctx.new = cur;
ctx.consumed_space = consumed_space;
ctx.relevant_space_size = relevant_space_size;
ctx.floating_group = NULL;
ctx.placed_item = NULL;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
//it is important to first make the segment visible here, and then hide the rest
//otherwise we get a state where item_container has 0 subchildren, which triggers a lot of focus logic.
vis_change_segment(&pd->object, start_id, end_id, EINA_TRUE);
vis_change_segment(&pd->object, pd->prev_run.start_id, pd->prev_run.end_id, EINA_FALSE);
_position_items_vertical(obj, pd, &ctx);
_position_group_items(obj, pd, &ctx);
}
else
{
vis_change_segment(&pd->object, pd->prev_run.start_id, start_id, (pd->prev_run.start_id > start_id));
vis_change_segment(&pd->object, pd->prev_run.end_id, end_id, (pd->prev_run.end_id < end_id));
_position_items_horizontal(obj, pd, &ctx);
_position_group_items(obj, pd, &ctx);
}
for (unsigned int i = start_id; i < end_id; ++i)
if (pd->prev_run.start_id != cur.start_id || pd->prev_run.end_id != cur.end_id)
{
Eina_Rect geom;
Efl_Gfx_Entity *ent;
int buffer_id = (i-start_id) % len;
geom.size = pd->max_min_size;
geom.pos = pd->viewport.pos;
if (buffer_id == 0)
{
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->object, i, len, obj_buffer) > 0);
}
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
geom.x += pd->max_min_size.w*(i%pd->current_display_table.columns);
geom.y += pd->max_min_size.h*(i/pd->current_display_table.columns);
geom.y -= (relevant_space_size);
}
else
{
geom.x += pd->max_min_size.w*(i/pd->current_display_table.columns);
geom.y += pd->max_min_size.h*(i%pd->current_display_table.columns);
geom.x -= (relevant_space_size);
}
ent = ((Efl_Gfx_Entity**)obj_buffer)[buffer_id];
//printf(">%d (%d, %d, %d, %d) %p\n", i, geom.x, geom.y, geom.w, geom.h, ent);
efl_gfx_entity_geometry_set(ent, geom);
}
if (pd->prev_run.start_id != start_id || pd->prev_run.end_id != end_id)
{
ev.start_id = pd->prev_run.start_id = start_id;
ev.end_id = pd->prev_run.end_id = end_id;
ev.start_id = pd->prev_run.start_id = cur.start_id;
ev.end_id = pd->prev_run.end_id = cur.end_id;
efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_VISIBLE_RANGE_CHANGED, &ev);
}
}
@ -123,44 +486,27 @@ _reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
static inline void
_flush_abs_size(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd)
{
int minor, major;
Eina_Size2D vp_size;
int sum_of_cache = 0;
if (!pd->size) return;
if (pd->max_min_size.w <= 0 || pd->max_min_size.h <= 0) return;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
_size_cache_require(obj, pd);
for (unsigned int i = 0; i < eina_inarray_count(pd->group_cache); ++i)
{
major = pd->viewport.w/pd->max_min_size.w;
pd->current_display_table.columns = major;
}
else
{
major = pd->viewport.h/pd->max_min_size.h;
pd->current_display_table.columns = major;
sum_of_cache += pd->size_cache[i];
}
if (major <= 0) return;
minor = ceil((double)pd->size/(double)major);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
pd->current_display_table.rows = minor;
else
pd->current_display_table.rows = minor;
/*
* calculate how much size we need with major in the given orientation.
* The
*/
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
vp_size.w = pd->viewport.w;
vp_size.h = minor*pd->max_min_size.h;
vp_size.h = sum_of_cache;
}
else
{
vp_size.h = pd->viewport.h;
vp_size.w = minor*pd->max_min_size.w;
vp_size.w = sum_of_cache;
}
if (vp_size.h != pd->last_viewport_size.h || vp_size.w != pd->last_viewport_size.w)
{
@ -208,6 +554,7 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_entity_data_access_set(Eo
EOLIAN static void
_efl_ui_position_manager_grid_efl_ui_position_manager_entity_viewport_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Eina_Rect viewport)
{
_size_cache_invalidate(obj, pd);
pd->viewport = viewport;
_flush_abs_size(obj, pd);
_reposition_content(obj, pd);
@ -221,53 +568,74 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_entity_scroll_position_set
_reposition_content(obj, pd);
}
static Eina_Value
_rebuild_job_cb(void *data, Eina_Value v EINA_UNUSED, const Eina_Future *f EINA_UNUSED)
{
MY_DATA_GET(data, pd);
if (!efl_alive_get(data)) return EINA_VALUE_EMPTY;
_flush_abs_size(data, pd);
_reposition_content(data, pd);
pd->rebuild_absolut_size = NULL;
return EINA_VALUE_EMPTY;
}
static void
_schedule_recalc_abs_size(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd)
{
if (pd->rebuild_absolut_size) return;
pd->rebuild_absolut_size = efl_loop_job(efl_app_main_get());
eina_future_then(pd->rebuild_absolut_size, _rebuild_job_cb, obj);
}
EOLIAN static void
_efl_ui_position_manager_grid_efl_ui_position_manager_entity_item_added(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, int added_index, Efl_Gfx_Entity *subobj EINA_UNUSED)
{
Eina_Size2D size[1];
Efl_Ui_Position_Manager_Batch_Size_Access size[1];
pd->size ++;
efl_gfx_entity_visible_set(subobj, EINA_FALSE);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, added_index, 1, &size) == 1);
_update_min_size(obj, pd, added_index, size[0]);
_group_cache_invalidate(obj, pd);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, added_index, 1, NULL, &size) == 1);
_update_min_size(obj, pd, added_index, size[0].size);
_flush_min_size(obj, pd);
_flush_abs_size(obj, pd);
_reposition_content(obj, pd); //FIXME we might can skip that
_schedule_recalc_abs_size(obj, pd);
}
EOLIAN static void
_efl_ui_position_manager_grid_efl_ui_position_manager_entity_item_removed(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, int removed_index EINA_UNUSED, Efl_Gfx_Entity *subobj EINA_UNUSED)
{
//we ignore here that we might loose the item giving the current max min size
EINA_SAFETY_ON_FALSE_RETURN(pd->size > 0);
pd->size --;
_group_cache_invalidate(obj, pd);
pd->prev_run.start_id = MIN(pd->prev_run.start_id, pd->size);
pd->prev_run.end_id = MIN(pd->prev_run.end_id, pd->size);
//we ignore here that we might loose the item giving the current max min size
_flush_abs_size(obj, pd);
_reposition_content(obj, pd); //FIXME we might can skip that
_schedule_recalc_abs_size(obj, pd);
efl_gfx_entity_visible_set(subobj, EINA_TRUE);
}
EOLIAN static void
_efl_ui_position_manager_grid_efl_ui_position_manager_entity_item_size_changed(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, int start_id, int end_id)
{
const int len = 50;
Eina_Size2D data[len];
Efl_Ui_Position_Manager_Batch_Size_Access data[len];
for (int i = start_id; i <= end_id; ++i)
{
int buffer_id = (i-start_id) % len;
if (buffer_id == 0)
{
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, start_id, len, data) >= 0);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, start_id, len, NULL, data) >= 0);
}
_update_min_size(obj, pd, i, data[i-start_id]);
_update_min_size(obj, pd, i, data[i-start_id].size);
}
_size_cache_invalidate(obj, pd);
_flush_min_size(obj, pd);
_flush_abs_size(obj, pd);
_reposition_content(obj, pd); //FIXME we could check if this is needed or not
_schedule_recalc_abs_size(obj, pd);
}
EOLIAN static void
@ -292,38 +660,71 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_entity_position_single_ite
Eina_Rect geom;
Eina_Size2D space_size;
unsigned int relevant_space_size;
unsigned int group_consumed_size = 0;
unsigned int group_consumed_ids = 0;
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[1];
if (!pd->size) return EINA_RECT(0, 0, 0, 0);
if (pd->max_min_size.w <= 0 || pd->max_min_size.h <= 0) return EINA_RECT(0, 0, 0, 0);
if (pd->current_display_table.columns <= 0 || pd->current_display_table.rows <= 0) return EINA_RECT(0, 0, 0, 0);
EINA_SAFETY_ON_FALSE_RETURN_VAL(_fill_buffer(&pd->min_size, idx, 1, NULL, size_buffer) == 1, EINA_RECT_EMPTY());
_size_cache_require(obj, pd);
_flush_abs_size(obj, pd);
//space size contains the amount of space that is outside the viewport (either to the top or to the left)
space_size.w = (MAX(pd->last_viewport_size.w - pd->viewport.w, 0))*pd->scroll_position.x;
space_size.h = (MAX(pd->last_viewport_size.h - pd->viewport.h, 0))*pd->scroll_position.y;
EINA_SAFETY_ON_FALSE_RETURN_VAL(space_size.w >= 0 && space_size.h >= 0, EINA_RECT(0, 0, 0, 0));
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
relevant_space_size = space_size.h;
}
relevant_space_size = space_size.h;
else
{
relevant_space_size = space_size.w;
}
relevant_space_size = space_size.w;
geom.size = pd->max_min_size;
geom.pos = pd->viewport.pos;
for (unsigned int i = 0; i < eina_inarray_count(pd->group_cache); ++i)
{
Group_Cache_Line *line = eina_inarray_nth(pd->group_cache, i);
if ((int)group_consumed_ids + line->items > idx)
break;
group_consumed_size += pd->size_cache[i];
group_consumed_ids += line->items;
if (line->real_group && idx == (int)group_consumed_ids + 1)
{
geom.y = (relevant_space_size - group_consumed_size);
geom.size = size_buffer[0].size;
return geom;
}
else if (line->real_group)
group_consumed_size += line->group_header_size.h;
}
if (idx > 0)
EINA_SAFETY_ON_FALSE_RETURN_VAL(group_consumed_ids < (unsigned int)idx, EINA_RECT(0, 0, 0, 0));
else if (idx == 0)
EINA_SAFETY_ON_FALSE_RETURN_VAL(group_consumed_ids == 0, EINA_RECT(0, 0, 0, 0));
int columns = pd->viewport.w/pd->max_min_size.w;
int sub_pos_id = idx - group_consumed_ids;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
geom.x += pd->max_min_size.w*(idx%pd->current_display_table.columns);
geom.y += pd->max_min_size.h*(idx/pd->current_display_table.columns);
geom.y -= (relevant_space_size);
const int x = (sub_pos_id)%columns;
const int y = (sub_pos_id)/columns;
geom.y -= relevant_space_size;
geom.x += pd->max_min_size.w*x;
geom.y += group_consumed_size + pd->max_min_size.h*y;
}
else
{
geom.x += pd->max_min_size.w*(idx/pd->current_display_table.columns);
geom.y += pd->max_min_size.h*(idx%pd->current_display_table.columns);
geom.x -= (relevant_space_size);
const int x = (sub_pos_id)/columns;
const int y = (sub_pos_id)%columns;
geom.x -= relevant_space_size;
geom.y += pd->max_min_size.h*y;
geom.x += group_consumed_size + pd->max_min_size.w*x;
}
return geom;
@ -344,10 +745,10 @@ _efl_ui_position_manager_grid_efl_ui_position_manager_entity_relative_item(Eo *o
new_id -= 1;
break;
case EFL_UI_FOCUS_DIRECTION_UP:
new_id -= pd->current_display_table.columns;
//FIXME
break;
case EFL_UI_FOCUS_DIRECTION_DOWN:
new_id += pd->current_display_table.columns;
//FIXME
break;
default:
new_id = -1;

View File

@ -24,9 +24,8 @@ typedef struct {
int *size_cache;
int average_item_size;
int maximum_min_size;
struct {
unsigned int start_id, end_id;
} prev_run;
Vis_Segment prev_run;
Efl_Gfx_Entity *last_group;
} Efl_Ui_Position_Manager_List_Data;
/*
@ -42,7 +41,7 @@ cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
{
unsigned int i;
const int len = 100;
Eina_Size2D size_buffer[100];
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[100];
if (pd->size_cache) return;
@ -67,9 +66,9 @@ cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
if (buffer_id == 0)
{
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, i, len, size_buffer) > 0);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, i, len, NULL, size_buffer) > 0);
}
size = size_buffer[buffer_id];
size = size_buffer[buffer_id].size;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
@ -132,16 +131,157 @@ recalc_absolut_size(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_MIN_SIZE_CHANGED, &min_size);
}
static inline Vis_Segment
_search_visual_segment(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, int relevant_space_size, int relevant_viewport)
{
Vis_Segment cur;
//based on the average item size, we jump somewhere into the sum cache.
//After beeing in there, we are walking back, until we have less space then viewport size
cur.start_id = MIN((unsigned int)(relevant_space_size / pd->average_item_size), pd->size);
for (; cache_access(obj, pd, cur.start_id) >= relevant_space_size && cur.start_id > 0; cur.start_id --) { }
//starting on the start id, we are walking down until the sum of elements is bigger than the lower part of the viewport.
cur.end_id = cur.start_id;
for (; cur.end_id <= pd->size && cache_access(obj, pd, cur.end_id) <= relevant_space_size + relevant_viewport ; cur.end_id ++) { }
cur.end_id = MAX(cur.end_id, cur.start_id + 1);
cur.end_id = MIN(cur.end_id, pd->size);
#ifdef DEBUG
printf("space_size %d : starting point : %d : cached_space_starting_point %d end point : %d cache_space_end_point %d\n", space_size.h, cur.start_id, pd->size_cache[cur.start_id], cur.end_id, pd->size_cache[cur.end_id]);
#endif
if (relevant_space_size > 0)
EINA_SAFETY_ON_FALSE_GOTO(cache_access(obj, pd, cur.start_id) <= relevant_space_size, err);
if (cur.end_id != pd->size)
EINA_SAFETY_ON_FALSE_GOTO(cache_access(obj, pd, cur.end_id) >= relevant_space_size + relevant_viewport, err);
EINA_SAFETY_ON_FALSE_GOTO(cur.start_id <= cur.end_id, err);
return cur;
err:
cur.start_id = cur.end_id = 0;
return cur;
}
static inline void
_position_items(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, Vis_Segment new, int relevant_space_size)
{
int group_id = -1;
Efl_Gfx_Entity *first_group = NULL, *first_fully_visual_group = NULL;
Eina_Size2D first_group_size;
Eina_Rect geom;
const int len = 100;
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[len];
Efl_Ui_Position_Manager_Batch_Entity_Access obj_buffer[len];
unsigned int i;
//placement of the plain items
geom = pd->viewport;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
geom.y -= (relevant_space_size - cache_access(obj, pd, new.start_id));
else
geom.x -= (relevant_space_size - cache_access(obj, pd, new.start_id));
for (i = new.start_id; i < new.end_id; ++i)
{
Eina_Size2D size;
Efl_Gfx_Entity *ent = NULL;
int buffer_id = (i-new.start_id) % len;
if (buffer_id == 0)
{
int tmp_group;
int res1, res2;
res1 = _fill_buffer(&pd->object, i, len, &tmp_group, obj_buffer);
res2 = _fill_buffer(&pd->min_size, i, len, NULL, size_buffer);
EINA_SAFETY_ON_FALSE_RETURN(res1 == res2);
EINA_SAFETY_ON_FALSE_RETURN(res2 > 0);
if (i == new.start_id)
{
if (tmp_group > 0)
group_id = tmp_group;
else if (obj_buffer[0].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP)
group_id = i;
}
}
size = size_buffer[buffer_id].size;
ent = obj_buffer[buffer_id].entity;
if (ent == pd->last_group)
{
pd->last_group = NULL;
}
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
geom.h = size.h;
else
geom.w = size.w;
if (!first_fully_visual_group && obj_buffer[buffer_id].group == EFL_UI_POSITION_MANAGER_BATCH_GROUP_STATE_GROUP &&
eina_spans_intersect(geom.x, geom.w, pd->viewport.x, pd->viewport.w) &&
eina_spans_intersect(geom.y, geom.h, pd->viewport.y, pd->viewport.h))
{
first_fully_visual_group = obj_buffer[buffer_id].entity;
}
if (ent)
efl_gfx_entity_geometry_set(ent, geom);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
geom.y += size.h;
else
geom.x += size.w;
}
//Now place group items
if (group_id > 0)
{
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->object, group_id, 1, NULL, obj_buffer) == 1);
EINA_SAFETY_ON_FALSE_RETURN(_fill_buffer(&pd->min_size, group_id, 1, NULL, size_buffer) == 1);
first_group = obj_buffer[0].entity;
first_group_size = size_buffer[0].size;
}
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
first_group_size.w = pd->viewport.w;
else
first_group_size.h = pd->viewport.h;
//if there is a new group item, display the new one, and hide the old one
if (first_group != pd->last_group)
{
efl_gfx_entity_visible_set(pd->last_group, EINA_FALSE);
efl_gfx_stack_raise_to_top(first_group);
pd->last_group = first_group;
}
//we have to set the visibility again here, as changing the visual segments might overwrite our visibility state
efl_gfx_entity_visible_set(first_group, EINA_TRUE);
//in case there is another group item coming in, the new group item (which is placed as normal item) moves the group item to the top
Eina_Position2D first_group_pos = EINA_POSITION2D(pd->viewport.x, pd->viewport.y);
if (first_fully_visual_group && first_fully_visual_group != first_group)
{
Eina_Position2D first_visual_group;
first_visual_group = efl_gfx_entity_position_get(first_fully_visual_group);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
first_group_pos.y = MIN(first_group_pos.y, first_visual_group.y - first_group_size.h);
else
first_group_pos.x = MIN(first_group_pos.x, first_visual_group.x - first_group_size.w);
}
efl_gfx_entity_position_set(first_group, first_group_pos);
efl_gfx_entity_size_set(first_group, first_group_size);
}
static void
position_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
{
Eina_Rect geom;
Eina_Size2D space_size;
unsigned int start_id = 0, end_id = 0, i;
Vis_Segment cur;
int relevant_space_size, relevant_viewport;
const int len = 100;
Eina_Size2D size_buffer[len];
Efl_Gfx_Entity *obj_buffer[len];
Efl_Ui_Position_Manager_Range_Update ev;
if (!pd->size) return;
@ -162,82 +302,17 @@ position_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
relevant_viewport = pd->viewport.w;
}
//based on the average item size, we jump somewhere into the sum cache.
//After beeing in there, we are walking back, until we have less space then viewport size
start_id = MIN((unsigned int)(relevant_space_size / pd->average_item_size), pd->size);
for (; cache_access(obj, pd, start_id) >= relevant_space_size && start_id > 0; start_id --) { }
//starting on the start id, we are walking down until the sum of elements is bigger than the lower part of the viewport.
end_id = start_id;
for (; end_id <= pd->size && cache_access(obj, pd, end_id) <= relevant_space_size + relevant_viewport ; end_id ++) { }
end_id = MAX(end_id, start_id + 1);
end_id = MIN(end_id, pd->size);
#ifdef DEBUG
printf("space_size %d : starting point : %d : cached_space_starting_point %d end point : %d cache_space_end_point %d\n", space_size.h, start_id, pd->size_cache[start_id], end_id, pd->size_cache[end_id]);
#endif
if (relevant_space_size > 0)
EINA_SAFETY_ON_FALSE_RETURN(cache_access(obj, pd, start_id) <= relevant_space_size);
if (end_id != pd->size)
EINA_SAFETY_ON_FALSE_RETURN(cache_access(obj, pd, end_id) >= relevant_space_size + relevant_viewport);
EINA_SAFETY_ON_FALSE_RETURN(start_id <= end_id);
cur = _search_visual_segment(obj, pd, relevant_space_size, relevant_viewport);
//to performance optimize the whole widget, we are setting the objects that are outside the viewport to visibility false
//The code below ensures that things outside the viewport are always hidden, and things inside the viewport are visible
if (end_id <= pd->prev_run.start_id || start_id >= pd->prev_run.end_id)
vis_segment_swap(&pd->object, cur, pd->prev_run);
_position_items(obj, pd, cur, relevant_space_size);
if (pd->prev_run.start_id != cur.start_id || pd->prev_run.end_id != cur.end_id)
{
//it is important to first make the segment visible here, and then hide the rest
//otherwise we get a state where item_container has 0 subchildren, which triggers a lot of focus logic.
vis_change_segment(&pd->object, start_id, end_id, EINA_TRUE);
vis_change_segment(&pd->object, pd->prev_run.start_id, pd->prev_run.end_id, EINA_FALSE);
}
else
{
vis_change_segment(&pd->object, pd->prev_run.start_id, start_id, (pd->prev_run.start_id > start_id));
vis_change_segment(&pd->object, pd->prev_run.end_id, end_id, (pd->prev_run.end_id < end_id));
}
geom = pd->viewport;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
geom.y -= (relevant_space_size - cache_access(obj, pd, start_id));
else
geom.x -= (relevant_space_size - cache_access(obj, pd, start_id));
for (i = start_id; i < end_id; ++i)
{
Eina_Size2D size;
Efl_Gfx_Entity *ent = NULL;
int buffer_id = (i-start_id) % len;
if (buffer_id == 0)
{
int res1, res2;
res1 = _fill_buffer(&pd->object, i, len, obj_buffer);
res2 = _fill_buffer(&pd->min_size, i, len, size_buffer);
EINA_SAFETY_ON_FALSE_RETURN(res1 == res2);
EINA_SAFETY_ON_FALSE_RETURN(res2 > 0);
}
size = size_buffer[buffer_id];
ent = obj_buffer[buffer_id];
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
geom.h = size.h;
else
geom.w = size.w;
if (ent)
efl_gfx_entity_geometry_set(ent, geom);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
geom.y += size.h;
else
geom.x += size.w;
}
if (pd->prev_run.start_id != start_id || pd->prev_run.end_id != end_id)
{
ev.start_id = pd->prev_run.start_id = start_id;
ev.end_id = pd->prev_run.end_id = end_id;
ev.start_id = pd->prev_run.start_id = cur.start_id;
ev.end_id = pd->prev_run.end_id = cur.end_id;
efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_VISIBLE_RANGE_CHANGED, &ev);
}
@ -333,7 +408,7 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_position_single_ite
Eina_Size2D space_size;
int relevant_space_size;
Eina_Size2D size;
Eina_Size2D size_buffer[1];
Efl_Ui_Position_Manager_Batch_Size_Access size_buffer[1];
if (!pd->size) return EINA_RECT(0,0,0,0);
@ -353,9 +428,9 @@ _efl_ui_position_manager_list_efl_ui_position_manager_entity_position_single_ite
geom = pd->viewport;
EINA_SAFETY_ON_FALSE_RETURN_VAL(_fill_buffer(&pd->min_size, idx, 1, size_buffer) == 1, EINA_RECT_EMPTY());
EINA_SAFETY_ON_FALSE_RETURN_VAL(_fill_buffer(&pd->min_size, idx, 1, NULL, size_buffer) == 1, EINA_RECT_EMPTY());
size = size_buffer[0];
size = size_buffer[0].size;
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{

View File

@ -170,6 +170,7 @@ _scroll_connector_bar_size_changed_cb(void *data, const Efl_Event *event EINA_UN
efl_ui_scrollbar_bar_size_get(ctx->smanager, &width, &height);
edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.hbar", width, 1.0);
edje_object_part_drag_size_set(wd->resize_obj, "efl.dragable.vbar", 1.0, height);
efl_layout_signal_emit(wd->resize_obj, "efl,action,scroll", "efl");
}
static void
@ -179,10 +180,21 @@ _scroll_connector_bar_pos_changed_cb(void *data, const Efl_Event *event EINA_UNU
ELM_WIDGET_DATA_GET_OR_RETURN(ctx->obj, wd);
double posx = 0.0, posy = 0.0;
Eina_Size2D cs;
Eina_Position2D step;
step = efl_ui_scrollable_step_size_get(ctx->smanager);
cs = efl_ui_scrollable_content_size_get(ctx->smanager);
edje_object_part_drag_step_set(wd->resize_obj, "efl.dragable.hbar",
(double)step.x / cs.w, 0.0);
edje_object_part_drag_step_set(wd->resize_obj, "efl.dragable.vbar",
0.0, (double)step.y / cs.h);
efl_ui_scrollbar_bar_position_get(ctx->smanager, &posx, &posy);
edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.hbar", posx, 0.0);
edje_object_part_drag_value_set(wd->resize_obj, "efl.dragable.vbar", 0.0, posy);
efl_layout_signal_emit(wd->resize_obj, "efl,action,scroll", "efl");
}
static void

View File

@ -335,6 +335,7 @@ _efl_ui_scroller_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Scroller_Data
if (sd->content) efl_gfx_entity_size_set(sd->content, EINA_SIZE2D(view.w, view.h));
edje_object_message_signal_process(wd->resize_obj);
edje_object_size_min_calc(wd->resize_obj, &vmw, &vmh);
if (sd->match_content_w) size.w = vmw + min.w;

View File

@ -65,11 +65,7 @@ _efl_ui_slider_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Eina_Bool us
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
&posx, &posy);
else
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
&posx, &posy);
if (_is_horizontal(sd->dir)) pos = posx;
else pos = posy;
@ -119,11 +115,7 @@ _efl_ui_slider_val_set(Evas_Object *obj, Efl_Ui_Slider_Data *sd)
pos = 1.0 - pos;
}
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
pos, pos);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
pos, pos);
// emit accessibility event also if value was changed by API
@ -138,11 +130,7 @@ _efl_ui_slider_down_knob(Evas_Object *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, d
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
button_x, button_y);
}
@ -151,11 +139,7 @@ _efl_ui_slider_move_knob(Evas_Object *obj, Efl_Ui_Slider_Data *sd EINA_UNUSED, d
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
button_x, button_y);
}
@ -210,7 +194,7 @@ _drag_step(void *data,
static void
_drag_up(void *data,
Evas_Object *obj,
Evas_Object *obj EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
@ -224,18 +208,15 @@ _drag_up(void *data,
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
relative_step = step/(sd->val_max - sd->val_min);
if (elm_widget_is_legacy(obj))
efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
step, step);
else
efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
relative_step, relative_step);
_slider_update(data, EINA_TRUE);
}
static void
_drag_down(void *data,
Evas_Object *obj,
Evas_Object *obj EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
@ -249,11 +230,8 @@ _drag_down(void *data,
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
relative_step = step/(sd->val_max - sd->val_min);
if (elm_widget_is_legacy(obj))
efl_ui_drag_step_move(efl_part(wd->resize_obj, "elm.dragable.slider"),
step, step);
else
efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_step_move(efl_part(wd->resize_obj, "efl.dragable.slider"),
relative_step, relative_step);
_slider_update(data, EINA_TRUE);
}
@ -443,20 +421,10 @@ _efl_ui_slider_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
if (elm_widget_is_legacy(obj))
{
if (efl_ui_layout_orientation_is_inverted(sd->dir))
efl_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
else
efl_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
}
if (efl_ui_layout_orientation_is_inverted(sd->dir))
efl_layout_signal_emit(obj, "efl,state,inverted,on", "efl");
else
{
if (efl_ui_layout_orientation_is_inverted(sd->dir))
efl_layout_signal_emit(obj, "efl,state,inverted,on", "efl");
else
efl_layout_signal_emit(obj, "efl,state,inverted,off", "efl");
}
efl_layout_signal_emit(obj, "efl,state,inverted,off", "efl");
efl_ui_slider_val_set(obj);
@ -668,10 +636,7 @@ _efl_ui_slider_efl_object_constructor(Eo *obj, Efl_Ui_Slider_Data *priv)
priv->spacer = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj,
efl_gfx_color_set(efl_added, 0, 0, 0, 0));
if (elm_widget_is_legacy(obj))
efl_content_set(efl_part(obj, "elm.swallow.bar"), priv->spacer);
else
efl_content_set(efl_part(obj, "efl.bar"), priv->spacer);
efl_content_set(efl_part(obj, "efl.bar"), priv->spacer);
evas_object_event_callback_add
(priv->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_down_cb, obj);
@ -755,18 +720,15 @@ _efl_ui_slider_efl_ui_range_display_range_limits_get(const Eo *obj EINA_UNUSED,
EOLIAN static void
_efl_ui_slider_efl_ui_range_display_range_value_set(Eo *obj, Efl_Ui_Slider_Data *sd, double val)
{
if (!elm_widget_is_legacy(obj))
if (val < sd->val_min)
{
if (val < sd->val_min)
{
ERR("Error, value is less than minimum");
return;
}
if (val > sd->val_max)
{
ERR("Error, value is greater than maximum");
return;
}
ERR("Error, value is less than minimum");
return;
}
if (val > sd->val_max)
{
ERR("Error, value is greater than maximum");
return;
}
if (EINA_DBL_EQ(val, sd->val)) return;

View File

@ -39,20 +39,12 @@ _efl_ui_slider_interval_val_fetch(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
EFL_UI_SLIDER_DATA_GET(obj, sd);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
&posx, &posy);
else
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
&posx, &posy);
if (efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE)) pos = posx;
else pos = posy;
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable2.slider"),
&posx2, &posy2);
else
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable2.slider"),
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable2.slider"),
&posx2, &posy2);
if (efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE)) pos2 = posx2;
else pos2 = posy2;
@ -124,20 +116,10 @@ _efl_ui_slider_interval_val_set(Evas_Object *obj, Efl_Ui_Slider_Interval_Data *p
else if (pos2 > 1.0)
pos2 = 1.0;
if (elm_widget_is_legacy(obj))
{
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
pos, pos);
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
pos2, pos2);
}
else
{
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
pos, pos);
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
pos2, pos2);
}
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
pos, pos);
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
pos2, pos2);
// emit accessibility event also if value was changed by API
if (_elm_config->atspi_mode)
@ -156,20 +138,10 @@ _efl_ui_slider_interval_down_knob(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
pd->intvl_flag = 0;
if (elm_widget_is_legacy(obj))
{
efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable.slider"),
&posx, &posy);
efl_ui_drag_value_get(efl_part(wd->resize_obj, "elm.dragable2.slider"),
&posx2, &posy2);
}
else
{
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
&posx, &posy);
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable2.slider"),
&posx2, &posy2);
}
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable.slider"),
&posx, &posy);
efl_ui_drag_value_get(efl_part(wd->resize_obj, "efl.dragable2.slider"),
&posx2, &posy2);
if (efl_ui_layout_orientation_is_horizontal(sd->dir, EINA_TRUE))
{
@ -186,21 +158,13 @@ _efl_ui_slider_interval_down_knob(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
if (diff1 < diff2)
{
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
button_x, button_y);
pd->intvl_flag = 1;
}
else if (diff1 > diff2)
{
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
button_x, button_y);
pd->intvl_flag = 2;
}
@ -208,21 +172,13 @@ _efl_ui_slider_interval_down_knob(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
{
if (diff3 < 0)
{
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
button_x, button_y);
pd->intvl_flag = 1;
}
else
{
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
button_x, button_y);
pd->intvl_flag = 2;
}
@ -236,20 +192,12 @@ _efl_ui_slider_interval_move_knob(Evas_Object *obj, Efl_Ui_Slider_Interval_Data
if (pd->intvl_flag == 1)
{
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable.slider"),
button_x, button_y);
}
else if (pd->intvl_flag == 2)
{
if (elm_widget_is_legacy(obj))
efl_ui_drag_value_set(efl_part(wd->resize_obj, "elm.dragable2.slider"),
button_x, button_y);
else
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
efl_ui_drag_value_set(efl_part(wd->resize_obj, "efl.dragable2.slider"),
button_x, button_y);
}
}

View File

@ -188,7 +188,6 @@ _elm_scrollable_is(const Evas_Object *obj)
static void
_on_sub_obj_del(void *data, const Efl_Event *event);
static void _propagate_event(void *data, const Efl_Event *eo_event);
static void _elm_widget_focus_tree_unfocusable_handle(Eo *obj);
static void _elm_widget_shadow_update(Efl_Ui_Widget *obj);
EFL_CALLBACKS_ARRAY_DEFINE(elm_widget_subitems_callbacks,
@ -270,7 +269,7 @@ _efl_ui_widget_focus_highlight_object_get(const Evas_Object *obj)
}
static Eina_Bool
_candidacy_exam(Eo *obj)
_legacy_focus_eval(Eo *obj)
{
Eina_List *lst;
Efl_Ui_Widget *wid = obj, *top;
@ -279,8 +278,6 @@ _candidacy_exam(Eo *obj)
wid_pd = efl_data_scope_get(wid, MY_CLASS);
do {
if (wid_pd->disabled) return EINA_TRUE;
if (wid_pd->tree_unfocusable) return EINA_TRUE;
top = wid;
wid = elm_widget_parent_get(wid);
@ -395,9 +392,16 @@ _eval_registration_candidate(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool *shou
//can focus can be overridden by the following properties
if ((!pd->parent_obj) ||
(!evas_object_visible_get(obj)) ||
(_candidacy_exam(obj)))
pd->disabled > 0 ||
pd->tree_unfocusable > 0)
return;
if (((Efl_Ui_Shared_Win_Data*)pd->shared_win_data)->legacy_focus_api_used)
{
if (_legacy_focus_eval(obj))
return;
}
if (pd->can_focus)
{
*should = *want_full = EINA_TRUE;
@ -452,14 +456,21 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s
Efl_Ui_Widget *parent;
Efl_Ui_Focus_Parent_Provider *provider;
if (should)
if (((Efl_Ui_Shared_Win_Data*)pd->shared_win_data)->custom_parent_provider)
{
provider = efl_provider_find(obj, EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE);
EINA_SAFETY_ON_NULL_RETURN_VAL(provider, NULL);
parent = efl_ui_focus_parent_provider_find_logical_parent(provider, obj);
if (should)
{
provider = efl_provider_find(obj, EFL_UI_FOCUS_PARENT_PROVIDER_INTERFACE);
EINA_SAFETY_ON_NULL_RETURN_VAL(provider, NULL);
parent = efl_ui_focus_parent_provider_find_logical_parent(provider, obj);
}
else
parent = NULL;
}
else
parent = NULL;
{
parent = efl_ui_widget_parent_get(obj);
}
if (pd->logical.parent != parent)
@ -609,12 +620,12 @@ _on_sub_obj_del(void *data, const Efl_Event *event)
if (_elm_widget_is(event->object))
{
if (_is_focused(event->object)) _parents_unfocus(sd->obj);
if (_is_focused(event->object)) _parents_unfocus(data);
}
if (event->object == sd->resize_obj)
{
/* already dels sub object */
elm_widget_resize_object_set(sd->obj, NULL);
elm_widget_resize_object_set(data, NULL);
}
else if (event->object == sd->hover_obj)
{
@ -622,8 +633,8 @@ _on_sub_obj_del(void *data, const Efl_Event *event)
}
else
{
if (!elm_widget_sub_object_del(sd->obj, event->object))
ERR("failed to remove sub object %p from %p\n", event->object, sd->obj);
if (!elm_widget_sub_object_del(data, event->object))
ERR("failed to remove sub object %p from %p\n", event->object, data);
}
}
@ -704,8 +715,6 @@ _obj_mouse_in(void *data,
EOLIAN static void
_efl_ui_widget_efl_canvas_group_group_add(Eo *obj, Elm_Widget_Smart_Data *priv)
{
priv->obj = obj;
priv->mirrored_auto_mode = EINA_TRUE; /* will follow system locale
* settings */
priv->focus_move_policy_auto_mode = EINA_TRUE;
@ -780,22 +789,24 @@ _efl_ui_widget_efl_canvas_group_group_del(Eo *obj, Elm_Widget_Smart_Data *sd)
}
static void
_smart_reconfigure(Elm_Widget_Smart_Data *sd)
_smart_reconfigure(Eo *obj, Elm_Widget_Smart_Data *sd)
{
Eina_Rect geom = efl_gfx_entity_geometry_get(obj);
if (sd->resize_obj)
{
evas_object_geometry_set(sd->resize_obj, sd->x, sd->y, sd->w, sd->h);
efl_gfx_entity_geometry_set(sd->resize_obj, geom);
}
if (sd->hover_obj)
{
evas_object_geometry_set(sd->hover_obj, sd->x, sd->y, sd->w, sd->h);
efl_gfx_entity_geometry_set(sd->hover_obj, geom);
}
if (sd->bg)
{
evas_object_geometry_set(sd->bg, sd->x, sd->y, sd->w, sd->h);
efl_gfx_entity_geometry_set(sd->bg, geom);
}
if (sd->has_shadow)
_elm_widget_shadow_update(sd->obj);
_elm_widget_shadow_update(obj);
}
EOLIAN static void
@ -804,9 +815,15 @@ _efl_ui_widget_efl_gfx_entity_position_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
return;
sd->x = pos.x;
sd->y = pos.y;
_smart_reconfigure(sd);
if (sd->resize_obj)
efl_gfx_entity_position_set(sd->resize_obj, pos);
if (sd->hover_obj)
efl_gfx_entity_position_set(sd->hover_obj, pos);
if (sd->bg)
efl_gfx_entity_position_set(sd->bg, pos);
if (sd->has_shadow)
_elm_widget_shadow_update(obj);
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
}
@ -817,9 +834,15 @@ _efl_ui_widget_efl_gfx_entity_size_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Dat
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, sz.w, sz.h))
return;
sd->w = sz.w;
sd->h = sz.h;
_smart_reconfigure(sd);
if (sd->resize_obj)
efl_gfx_entity_size_set(sd->resize_obj, sz);
if (sd->hover_obj)
efl_gfx_entity_size_set(sd->hover_obj, sz);
if (sd->bg)
efl_gfx_entity_size_set(sd->bg, sz);
if (sd->has_shadow)
_elm_widget_shadow_update(obj);
efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
}
@ -1617,7 +1640,7 @@ _efl_ui_widget_resize_object_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eo *sobj)
elm_widget_sub_object_add(obj, sobj);
evas_object_smart_member_add(sobj, obj);
_smart_reconfigure(sd);
_smart_reconfigure(obj, sd);
}
/*
@ -1641,7 +1664,7 @@ elm_widget_hover_object_set(Eo *obj, Evas_Object *sobj)
if (sd->hover_obj)
{
_callbacks_add(sobj, obj);
_smart_reconfigure(sd);
_smart_reconfigure(obj, sd);
}
}
@ -1679,6 +1702,15 @@ elm_widget_child_can_focus_get(const Eo *obj)
return sd->logical.child_count > 0;
}
static int
_tree_unfocusable_counter_get(Eo *widget)
{
ELM_WIDGET_DATA_GET_OR_RETURN(widget, pd, -1);
return pd->tree_unfocusable;
}
/**
* @internal
*
@ -1697,16 +1729,33 @@ elm_widget_child_can_focus_get(const Eo *obj)
EAPI void
elm_widget_tree_unfocusable_set(Eo *obj, Eina_Bool tree_unfocusable)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
if (!sd) return;
Efl_Ui_Widget *subs;
Eina_List *n;
Elm_Widget_Smart_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
if (!pd) return;
int distance, parent_counter = (pd->parent_obj ? _tree_unfocusable_counter_get(pd->parent_obj) : 0);
tree_unfocusable = !!tree_unfocusable;
if (sd->tree_unfocusable == tree_unfocusable) return;
sd->tree_unfocusable = tree_unfocusable;
_elm_widget_focus_tree_unfocusable_handle(obj);
if (tree_unfocusable)
pd->tree_unfocusable ++;
else
pd->tree_unfocusable --;
distance = pd->tree_unfocusable - parent_counter;
if ((distance < 0) || (distance > 1))
{
distance = MAX(MIN(tree_unfocusable, 1), 0);
pd->tree_unfocusable = parent_counter + distance;
}
EINA_LIST_FOREACH(pd->subobjs, n, subs)
{
if (efl_isa(subs, EFL_UI_WIDGET_CLASS))
elm_widget_tree_unfocusable_set(subs, elm_widget_tree_unfocusable_get(obj));
}
//focus state eval on all children
_elm_widget_full_eval_children(obj, sd);
_elm_widget_full_eval_children(obj, pd);
}
/**
@ -1725,7 +1774,7 @@ elm_widget_tree_unfocusable_get(const Eo *obj)
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
if (!sd) return EINA_FALSE;
return sd->tree_unfocusable;
return !!sd->tree_unfocusable;
}
/**
@ -2199,7 +2248,7 @@ _efl_ui_widget_scroll_freeze_push(Eo *obj, Elm_Widget_Smart_Data *sd)
{
if (elm_widget_is(child) && _elm_scrollable_is(child))
{
if (elm_widget_is_legacy(obj))
if (elm_widget_is_legacy(child))
elm_interface_scrollable_freeze_set(child, EINA_TRUE);
else
efl_ui_scrollable_scroll_freeze_set(child, EINA_TRUE);
@ -2914,12 +2963,6 @@ elm_widget_focus_mouse_up_handle(Eo *obj)
}
}
static void
_elm_widget_focus_tree_unfocusable_handle(Eo *obj EINA_UNUSED)
{
//FIXME
}
/*
* @internal
*
@ -4746,12 +4789,8 @@ EOLIAN static Eo *
_efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
{
sd->on_create = EINA_TRUE;
sd->window = efl_provider_find(efl_parent_get(obj), EFL_UI_WIN_CLASS);
_efl_ui_focus_event_redirector(obj, obj);
efl_canvas_group_clipped_set(obj, EINA_FALSE);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
if (!efl_isa(obj, EFL_UI_WIN_CLASS))
{
Eo *parent = efl_parent_get(obj);
@ -4761,14 +4800,30 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
"Elementary widget's parent should be an elementary widget.",
parent, evas_object_type_get(parent));
}
ELM_WIDGET_DATA_GET(parent, parent_sd);
if (parent_sd)
sd->shared_win_data = parent_sd->shared_win_data;
else
sd->shared_win_data = efl_ui_win_shared_data_get(obj);
efl_ui_widget_sub_object_add(parent, obj);
}
else
{
sd->shared_win_data = efl_ui_win_shared_data_get(obj);
}
_efl_ui_focus_event_redirector(obj, obj);
efl_canvas_group_clipped_set(obj, EINA_FALSE);
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
sd->on_create = EINA_FALSE;
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_UNKNOWN);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->shared_win_data, NULL);
return obj;
}
@ -5147,11 +5202,10 @@ elm_widget_show_region_set(Eo *obj, Eina_Rect sr, Eina_Bool forceshow)
}
}
}
child_obj = obj;
do
{
parent_obj = sd->parent_obj;
child_obj = sd->obj;
if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break;
sd = efl_data_scope_get(parent_obj, MY_CLASS);
if (!sd) break;
@ -5165,6 +5219,7 @@ elm_widget_show_region_set(Eo *obj, Eina_Rect sr, Eina_Bool forceshow)
if (sd->on_show_region)
sd->on_show_region(sd->on_show_region_data, parent_obj, sr);
child_obj = parent_obj;
}
while (parent_obj);
}
@ -5561,6 +5616,7 @@ static Efl_Canvas_Layout_Part_Type
_efl_ui_widget_part_efl_canvas_layout_part_type_get(const Eo *obj EINA_UNUSED, Elm_Part_Data *pd)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(pd->obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EFL_CANVAS_LAYOUT_PART_TYPE_NONE);
return efl_canvas_layout_part_type_get(efl_part(sd->resize_obj, pd->part));
}
@ -5568,6 +5624,7 @@ static Eina_Rect
_efl_ui_widget_part_efl_gfx_entity_geometry_get(const Eo *obj EINA_UNUSED, Elm_Part_Data *pd)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(pd->obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd, EINA_RECT_EMPTY());
return efl_gfx_entity_geometry_get(efl_part(sd->resize_obj, pd->part));
}
@ -5608,7 +5665,7 @@ _efl_ui_widget_bg_get(const Efl_Ui_Widget *obj)
sd->bg = bg_obj;
efl_canvas_group_member_add((Eo *)obj, sd->bg);
evas_object_stack_below(sd->bg, sd->resize_obj);
_smart_reconfigure(sd);
_smart_reconfigure((Eo*)obj, sd);
}
return bg_obj;
@ -5740,7 +5797,7 @@ _efl_ui_property_bind_clean(Eo *obj EINA_UNUSED,
}
static void
_efl_ui_property_bind_get(Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop)
_efl_ui_property_bind_get(Eo *obj, Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop)
{
Eina_Value *value;
Eina_Future *f;
@ -5751,7 +5808,7 @@ _efl_ui_property_bind_get(Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop)
if (!pd->properties.model) return ;
value = efl_model_property_get(pd->properties.model, prop->property);
target = prop->part ? efl_part(pd->obj, prop->part) : pd->obj;
target = prop->part ? efl_part(obj, prop->part) : obj;
fprintf(stderr, "setting: %s for %s from %s\n",
eina_value_to_string(value), prop->property, efl_debug_name_get(pd->properties.model));
@ -5764,22 +5821,22 @@ _efl_ui_property_bind_get(Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop)
if (prop->f) eina_future_cancel(prop->f);
f = efl_model_property_set(pd->properties.model, prop->property,
eina_value_error_new(err));
prop->f = efl_future_then(pd->obj, f, .free = _efl_ui_property_bind_clean, .data = prop);
prop->f = efl_future_then(obj, f, .free = _efl_ui_property_bind_clean, .data = prop);
}
static void
_efl_ui_property_bind_set(Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop)
_efl_ui_property_bind_set(Eo *obj, Efl_Ui_Widget_Data *pd, Efl_Ui_Property_Bound *prop)
{
Eina_Value value;
Eina_Future *f;
Eo *target;
target = prop->part ? efl_part(pd->obj, prop->part) : pd->obj;
target = prop->part ? efl_part(obj, prop->part) : obj;
value = efl_property_reflection_get(target, prop->key);
if (prop->f) eina_future_cancel(prop->f);
f = efl_model_property_set(pd->properties.model, prop->property, eina_value_dup(&value));
prop->f = efl_future_then(pd->obj, f, .free = _efl_ui_property_bind_clean, .data = prop);
prop->f = efl_future_then(obj, f, .free = _efl_ui_property_bind_clean, .data = prop);
eina_value_flush(&value);
}
@ -5787,7 +5844,7 @@ static void
_efl_ui_model_property_bind_changed(void *data, const Efl_Event *event)
{
Efl_Model_Property_Event *evt = event->info;
Efl_Ui_Widget_Data *pd = data;
ELM_WIDGET_DATA_GET(data, pd);
Eina_Array_Iterator it;
const char *prop;
unsigned int i;
@ -5797,7 +5854,7 @@ _efl_ui_model_property_bind_changed(void *data, const Efl_Event *event)
Efl_Ui_Property_Bound *lookup;
lookup = eina_hash_find(pd->properties.model_lookup, prop);
if (lookup) _efl_ui_property_bind_get(pd, lookup);
if (lookup) _efl_ui_property_bind_get(data, pd, lookup);
}
}
@ -5805,7 +5862,7 @@ static void
_efl_ui_view_property_bind_changed(void *data, const Efl_Event *event)
{
Efl_Ui_Property_Event *evt = event->info;
Efl_Ui_Widget_Data *pd = data;
ELM_WIDGET_DATA_GET(data, pd);
Eina_Array_Iterator it;
Eina_Stringshare *prop;
unsigned int i;
@ -5815,19 +5872,19 @@ _efl_ui_view_property_bind_changed(void *data, const Efl_Event *event)
Efl_Ui_Property_Bound *lookup;
lookup = eina_hash_find(pd->properties.view_lookup, prop);
if (lookup) _efl_ui_property_bind_set(pd, lookup);
if (lookup) _efl_ui_property_bind_set(data, pd, lookup);
}
}
static void
_efl_ui_widget_model_update(Efl_Ui_Widget_Data *pd)
_efl_ui_widget_model_update(Eo *obj, Efl_Ui_Widget_Data *pd)
{
Efl_Ui_Property_Bound *property;
Eina_Iterator *it;
it = eina_hash_iterator_data_new(pd->properties.model_lookup);
EINA_ITERATOR_FOREACH(it, property)
_efl_ui_property_bind_get(pd, property);
_efl_ui_property_bind_get(obj, pd, property);
eina_iterator_free(it);
}
@ -5841,25 +5898,26 @@ EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_widget_model_provider_callbacks,
static void
_efl_ui_widget_model_provider_model_change(void *data, const Efl_Event *event)
{
Efl_Ui_Widget_Data *pd = data;
ELM_WIDGET_DATA_GET(data, pd);
efl_replace(&pd->properties.model,
efl_ui_view_model_get(pd->properties.provider));
_efl_ui_widget_model_update(pd);
_efl_ui_widget_model_update(data, pd);
efl_event_callback_call(pd->obj, EFL_UI_VIEW_EVENT_MODEL_CHANGED, event->info);
efl_event_callback_call(data, EFL_UI_VIEW_EVENT_MODEL_CHANGED, event->info);
}
static void
_efl_ui_widget_model_provider_invalidate(void *data, const Efl_Event *event EINA_UNUSED)
{
Efl_Ui_Widget_Data *pd = data;
ELM_WIDGET_DATA_GET(data, pd);
efl_event_callback_array_del(pd->properties.provider,
efl_ui_widget_model_provider_callbacks(),
pd);
data);
efl_replace(&pd->properties.provider, NULL);
efl_replace(&pd->properties.model, NULL);
pd->properties.callback_to_provider = EINA_FALSE;
}
static void
@ -5874,10 +5932,11 @@ _efl_ui_widget_model_register(Eo *obj, Efl_Ui_Widget_Data *pd)
efl_replace(&pd->properties.provider,
efl_provider_find(obj, EFL_MODEL_PROVIDER_CLASS));
if (!pd->properties.provider) return ;
efl_event_callback_array_add(pd->properties.provider,
efl_ui_widget_model_provider_callbacks(),
pd);
if (!pd->properties.callback_to_provider)
efl_event_callback_array_add(pd->properties.provider,
efl_ui_widget_model_provider_callbacks(),
obj);
pd->properties.callback_to_provider = EINA_TRUE;
efl_replace(&pd->properties.model,
efl_ui_view_model_get(pd->properties.provider));
@ -5892,9 +5951,9 @@ _efl_ui_widget_model_register(Eo *obj, Efl_Ui_Widget_Data *pd)
if (!pd->properties.model_lookup) return ;
efl_event_callback_add(pd->properties.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
_efl_ui_model_property_bind_changed, pd);
_efl_ui_model_property_bind_changed, obj);
efl_event_callback_add(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED,
_efl_ui_view_property_bind_changed, pd);
_efl_ui_view_property_bind_changed, obj);
pd->properties.registered = EINA_TRUE;
}
@ -5905,15 +5964,15 @@ _efl_ui_widget_model_unregister(Eo *obj, Efl_Ui_Widget_Data *pd)
{
// Remove any existing handler that might exist for any reason
efl_event_callback_del(pd->properties.model, EFL_MODEL_EVENT_PROPERTIES_CHANGED,
_efl_ui_model_property_bind_changed, pd);
_efl_ui_model_property_bind_changed, obj);
efl_event_callback_del(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTIES_CHANGED,
_efl_ui_view_property_bind_changed, pd);
_efl_ui_view_property_bind_changed, obj);
pd->properties.registered = EINA_FALSE;
}
// Invalidate must be called before setting a new model and even if no model is registered
if (pd->properties.provider)
_efl_ui_widget_model_provider_invalidate(pd, NULL);
_efl_ui_widget_model_provider_invalidate(obj, NULL);
}
static Eina_Error
@ -5945,7 +6004,7 @@ _efl_ui_property_bind(Eo *widget, Eo *target, Efl_Ui_Widget_Data *pd,
eina_hash_direct_add(pd->properties.model_lookup, prop->property, prop);
eina_hash_direct_add(pd->properties.view_lookup, prop->key, prop);
_efl_ui_property_bind_get(pd, prop);
_efl_ui_property_bind_get(widget, pd, prop);
efl_event_callback_call(widget, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) prop->key);
// In case of part, we emit it also on the part so that the part too can act on it
@ -5984,7 +6043,7 @@ _efl_ui_widget_efl_ui_view_model_set(Eo *obj,
if (ev.current == pd->properties.model)
efl_event_callback_call(obj, EFL_UI_VIEW_EVENT_MODEL_CHANGED, &ev);
if (pd->properties.model) _efl_ui_widget_model_update(pd);
if (pd->properties.model) _efl_ui_widget_model_update(obj, pd);
efl_unref(ev.current);
efl_unref(ev.previous);

View File

@ -4,6 +4,7 @@
#define EFL_UI_WIDGET_PROTECTED
#define EFL_PART_PROTECTED
#define EFL_UI_FACTORY_PROTECTED
#include <Efl_Ui.h>
#include "elm_priv.h"
@ -39,8 +40,8 @@ struct _Efl_Ui_Widget_Factory_Data
struct _Efl_Ui_Widget_Factory_Request
{
Efl_Ui_Widget_Factory_Data *pd;
Efl_Ui_Factory *factory;
Eo *parent;
Efl_Model *model;
};
static void
@ -67,58 +68,93 @@ _efl_ui_widget_factory_item_class_get(const Eo *obj EINA_UNUSED,
return pd->klass;
}
static void
_efl_ui_widget_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, Efl_Ui_Widget_Factory_Data *pd EINA_UNUSED, Efl_Gfx_Entity *ui_view)
{
const Efl_Model *model;
Eina_Value *property;
char *style;
if (!pd->style) return ;
model = efl_ui_view_model_get(ui_view);
// As we have already waited for the property to be ready, we should get the right style now
property = efl_model_property_get(model, pd->style);
if (!property) return ;
style = eina_value_to_string(property);
if (style) efl_ui_widget_style_set(ui_view, style);
free(style);
eina_value_free(property);
}
static Efl_Ui_Widget *
_efl_ui_widget_create(const Efl_Ui_Factory *factory,
const Efl_Class *klass, Eo *parent,
Efl_Model *model,
const Eina_Hash *parts)
{
Efl_Ui_Bind_Part_Data *bpd;
Eina_Iterator *it;
Efl_Ui_Widget *w;
w = efl_add(klass, parent,
efl_ui_view_model_set(efl_added, model),
efl_ui_factory_building(factory, efl_added));
if (!parts) return w;
it = eina_hash_iterator_data_new(parts);
EINA_ITERATOR_FOREACH(it, bpd)
{
Efl_Ui_Property_Bind_Data *bppd;
Eina_List *l;
EINA_LIST_FOREACH(bpd->properties, l, bppd)
efl_ui_property_bind(efl_part(w, bpd->part),
bppd->part_property,
bppd->model_property);
}
eina_iterator_free(it);
return w;
}
static Eina_Value
_efl_ui_widget_factory_create_then(Eo *obj EINA_UNUSED, void *data, const Eina_Value v)
_efl_ui_widget_factory_create_then(Eo *model, void *data, const Eina_Value v EINA_UNUSED)
{
Efl_Ui_Widget_Factory_Request *r = data;
Efl_Ui_Widget *w;
const char *string = NULL;
if (!eina_value_string_get(&v, &string))
return eina_value_error_init(EFL_MODEL_ERROR_NOT_SUPPORTED);
w = efl_add(r->pd->klass, r->parent,
efl_ui_widget_style_set(efl_added, string),
efl_ui_view_model_set(efl_added, r->model));
if (r->pd->parts)
{
Efl_Ui_Bind_Part_Data *bpd;
Eina_Iterator *it;
it = eina_hash_iterator_data_new(r->pd->parts);
EINA_ITERATOR_FOREACH(it, bpd)
{
Efl_Ui_Property_Bind_Data *bppd;
Eina_List *l;
EINA_LIST_FOREACH(bpd->properties, l, bppd)
efl_ui_property_bind(efl_part(w, bpd->part),
bppd->part_property,
bppd->model_property);
}
eina_iterator_free(it);
}
w = _efl_ui_widget_create(r->factory, r->pd->klass, r->parent, model, r->pd->parts);
if (!w) return eina_value_error_init(ENOMEM);
return eina_value_object_init(w);
}
static void
_efl_ui_widget_factory_single_cleanup(Eo *model, void *data EINA_UNUSED, const Eina_Future *dead_future EINA_UNUSED)
{
efl_unref(model);
}
static void
_efl_ui_widget_factory_create_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED)
{
Efl_Ui_Widget_Factory_Request *r = data;
efl_unref(r->model);
efl_unref(r->factory);
efl_unref(r->parent);
free(r);
}
static Eina_Future *
_efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data *pd,
Efl_Model *model, Efl_Gfx_Entity *parent)
Eina_Iterator *models, Efl_Gfx_Entity *parent)
{
Efl_Ui_Widget_Factory_Request *r;
Eina_Future **f;
Efl_Model *model;
int count = 0;
if (!pd->klass)
return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE);
@ -126,10 +162,20 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
if (!pd->style)
{
Efl_Ui_Widget *w;
Eina_Value r;
w = efl_add(pd->klass, parent,
efl_ui_view_model_set(efl_added, model));
return efl_loop_future_resolved(obj, eina_value_object_init(w));
eina_value_array_setup(&r, EINA_VALUE_TYPE_OBJECT, 4);
EINA_ITERATOR_FOREACH(models, model)
{
w = _efl_ui_widget_create(obj, pd->klass, parent, model, pd->parts);
if (!w) return efl_loop_future_rejected(obj, ENOMEM);
eina_value_array_append(&r, w);
}
eina_iterator_free(models);
return efl_loop_future_resolved(obj, r);
}
r = calloc(1, sizeof (Efl_Ui_Widget_Factory_Request));
@ -137,10 +183,25 @@ _efl_ui_widget_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Widget_Factory_Data
r->pd = pd;
r->parent = efl_ref(parent);
r->model = efl_ref(model);
r->factory = efl_ref(obj);
return efl_future_then(obj, efl_model_property_ready_get(obj, pd->style),
.success = _efl_ui_widget_factory_create_then,
f = calloc(count + 1, sizeof (Eina_Future *));
if (!f) return efl_loop_future_rejected(obj, ENOMEM);
EINA_ITERATOR_FOREACH(models, model)
{
f[count++] = efl_future_then(efl_ref(model), efl_model_property_ready_get(model, pd->style),
.success = _efl_ui_widget_factory_create_then,
.free = _efl_ui_widget_factory_single_cleanup);
f = realloc(f, (count + 1) * sizeof (Eina_Future *));
if (!f) return efl_loop_future_rejected(obj, ENOMEM);
}
eina_iterator_free(models);
f[count] = EINA_FUTURE_SENTINEL;
return efl_future_then(obj, eina_future_all_array(f),
.data = r,
.free = _efl_ui_widget_factory_create_cleanup);
}

View File

@ -20,6 +20,7 @@ class @beta Efl.Ui.Widget_Factory extends Efl.Loop_Consumer implements Efl.Ui.Fa
implements {
Efl.Ui.Factory.create;
Efl.Ui.Factory.release;
Efl.Ui.Factory.building;
Efl.Ui.Property_Bind.property_bind;
Efl.Part.part_get;
}

View File

@ -269,6 +269,7 @@ struct _Efl_Ui_Win_Data
Eina_Bool bg_must_swallow_init : 1;
Eina_Bool ctor : 1; /**< legacy constructor: elm_win~add */
} legacy;
Efl_Ui_Shared_Win_Data spd;
Eina_Value exit_on_close;
@ -9441,3 +9442,12 @@ elm_win_focus_highlight_style_get(const Efl_Ui_Win *obj)
{
return efl_ui_win_focus_highlight_style_get(obj);
}
EAPI Efl_Ui_Shared_Win_Data*
efl_ui_win_shared_data_get(Efl_Ui_Win *obj)
{
Efl_Ui_Win_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
return &pd->spd;
}

View File

@ -21,6 +21,9 @@
ELM_WIDGET_DATA_GET_OR_RETURN(obj, pd, val); \
EINA_SAFETY_ON_FALSE_RETURN_VAL(elm_widget_is_legacy(obj), val);
#define MARK_WINDOW_LEGACY_USAGE() \
((Efl_Ui_Shared_Win_Data*)pd->shared_win_data)->legacy_focus_api_used = EINA_TRUE;
#define MAPPING() \
MAP(PREVIOUS, prev) \
MAP(NEXT, next) \
@ -106,6 +109,7 @@ elm_object_focus_next_object_set(Evas_Object *obj,
API_ENTRY()
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(next, EFL_UI_WIDGET_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(next, next_pd);
MARK_WINDOW_LEGACY_USAGE()
#define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction) pd->legacy_focus.field = next;
MAPPING()
@ -121,6 +125,8 @@ elm_object_focus_custom_chain_set(Evas_Object *obj,
Eina_List *objs)
{
API_ENTRY()
MARK_WINDOW_LEGACY_USAGE()
_custom_chain_set(obj, objs);
}
@ -128,6 +134,7 @@ EAPI void
elm_object_focus_custom_chain_unset(Evas_Object *obj)
{
API_ENTRY()
MARK_WINDOW_LEGACY_USAGE()
_custom_chain_set(obj, NULL);
}
@ -146,6 +153,7 @@ elm_object_focus_custom_chain_append(Evas_Object *obj,
Evas_Object *relative_child)
{
API_ENTRY()
MARK_WINDOW_LEGACY_USAGE()
Eina_List *tmp;
tmp = eina_list_clone(pd->legacy_focus.custom_chain);
@ -159,6 +167,7 @@ elm_object_focus_custom_chain_prepend(Evas_Object *obj,
Evas_Object *relative_child)
{
API_ENTRY()
MARK_WINDOW_LEGACY_USAGE()
Eina_List *tmp;
tmp = eina_list_clone(pd->legacy_focus.custom_chain);
@ -302,6 +311,7 @@ elm_object_focus_next_item_get(const Evas_Object *obj,
Elm_Focus_Direction dir EINA_UNUSED)
{
API_ENTRY_VAL(NULL)
MARK_WINDOW_LEGACY_USAGE()
#define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction && pd->legacy_focus.item_ ##field) return pd->legacy_focus.item_ ##field;
MAPPING()
@ -316,6 +326,7 @@ elm_object_focus_next_item_set(Evas_Object *obj,
Elm_Focus_Direction dir EINA_UNUSED)
{
API_ENTRY()
MARK_WINDOW_LEGACY_USAGE()
#define MAP(direction, field) if ((Efl_Ui_Focus_Direction)dir == EFL_UI_FOCUS_DIRECTION_ ##direction) pd->legacy_focus.item_ ##field = next_item;
MAPPING()

View File

@ -4380,11 +4380,13 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
{
legacy_efl_ui_focus_manager_widget_legacy_signals(obj, obj);
sd->content_item_map = eina_hash_pointer_new(NULL);
obj = efl_constructor(efl_super(obj, MY_CLASS));
sd->provider = efl_add(EFL_UI_FOCUS_PARENT_PROVIDER_GEN_CLASS, obj,
efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
obj = efl_constructor(efl_super(obj, MY_CLASS));
sd->obj = obj;
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);

View File

@ -3192,18 +3192,18 @@ _name_list_cb(void *data,
sd->src_name->name_list_parse_cb(name_list);
INF("Name List request success address");
if (name_list->cb)
name_list->cb(name_list->data, wd->obj,
name_list->cb(name_list->data, sd->obj,
name_list->names);
efl_event_callback_legacy_call
(wd->obj, ELM_MAP_EVENT_NAME_LOADED, NULL);
(sd->obj, ELM_MAP_EVENT_NAME_LOADED, NULL);
}
else
{
ERR("Name List request failed: %d", status);
if (name_list->cb)
name_list->cb(name_list->data, wd->obj, NULL);
name_list->cb(name_list->data, sd->obj, NULL);
efl_event_callback_legacy_call
(wd->obj, ELM_MAP_EVENT_NAME_LOADED_FAIL, NULL);
(sd->obj, ELM_MAP_EVENT_NAME_LOADED_FAIL, NULL);
}
edje_object_signal_emit(wd->resize_obj,
@ -3306,7 +3306,7 @@ _name_list_request(const Evas_Object *obj,
fname = _prepare_download();
url = sd->src_name->url_cb
(wd->obj, method, address, lon, lat);
(obj, method, address, lon, lat);
if (!url)
{
ERR("Name URL is NULL");
@ -3335,7 +3335,7 @@ _name_list_request(const Evas_Object *obj,
free(fname);
efl_event_callback_legacy_call
(wd->obj, ELM_MAP_EVENT_NAME_LOAD, name_list->names);
((Eo*)obj, ELM_MAP_EVENT_NAME_LOAD, name_list->names);
edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,start", "elm");
return name_list->names;

View File

@ -395,7 +395,7 @@ _parent_del_cb(void *data,
ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
evas_object_event_callback_del_full
(obj, EVAS_CALLBACK_RESIZE, _parent_resize_cb, wd->obj);
(obj, EVAS_CALLBACK_RESIZE, _parent_resize_cb, data);
sd->parent = NULL;
}

Some files were not shown because too many files have changed in this diff Show More