14 Commits
0.3.5 ... 0.3.6

34 changed files with 808 additions and 658 deletions

View File

@@ -0,0 +1,13 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="M57.268,52.064,55.78,48.233h-0.2256c-0.5556,0.7572-1.1112,1.4088-1.6668,1.9548-0.5556,0.5484-1.1604,0.9984-1.8168,1.35-0.6564,0.354-1.392,0.6144-2.2056,0.78-0.8184,0.1716-1.7628,0.2532-2.838,0.2532-1.1436,0-2.2032-0.1776-3.1776-0.546-0.9756-0.3588-1.8192-0.9072-2.5332-1.6332-0.7152-0.7332-1.2732-1.6572-1.6752-2.7768-0.4032-1.1184-0.6072-2.442-0.6072-3.9732,0-2.9928,0.9588-5.1984,2.8752-6.6216,1.9176-1.4208,4.7832-2.2056,8.6016-2.358l4.488-0.15v-2.1192c0-1.1604-0.3348-2.0184-1.0104-2.574-0.6708-0.5532-1.6128-0.8316-2.8248-0.8316s-2.3928,0.1752-3.5436,0.5292-2.3088,0.8256-3.4692,1.4136l-2.496-5.0952c1.4136-0.7896,2.976-1.4124,4.6896-1.8648,1.716-0.4548,3.516-0.6816,5.3976-0.6816,3.516,0,6.2088,0.8256,8.0832,2.472,1.8756,1.6476,2.8128,4.1532,2.8128,7.5168v18.79h-5.3724v-0.0024zm-0.781-9.233-2.548,0.101c-1.0248,0.0324-1.8936,0.1692-2.5968,0.4032-0.708,0.234-1.2756,0.5484-1.704,0.9444s-0.738,0.8652-0.9324,1.4136c-0.192,0.546-0.288,1.1556-0.288,1.8276,0,1.176,0.2856,2.0136,0.8556,2.5104,0.5724,0.4944,1.3224,0.7428,2.2452,0.7428,0.708,0,1.362-0.1224,1.9692-0.366,0.6048-0.2436,1.1292-0.6048,1.5756-1.0824,0.4476-0.48,0.7944-1.0692,1.0476-1.7652,0.252-0.699,0.376-1.503,0.376-2.413v-2.317h-0.0012z" fill="#333"/>
<path d="M26,38,14,38,9,54,3,54,17,9h6l8,25h-6l-5-18-5,18h16l6,20h-6z" fill="#333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

14
assets/icon/Down.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g transform="matrix(0,1.2,-1.2,0,631.9838,-722.6014)">
<polygon points="629.89,509.46,607.39,509.46,607.39,490.51,629.89,490.51,629.89,481.04,652.39,499.94,629.89,518.93" fill="#333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 638 B

4
assets/icon/File.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<path fill="#333" d="m50.318,5.003h-21.273c-5.515,6-11.03,12-16.545,18v34.714c0.10749,1.7195,2.0191,1.2097,3.1801,1.2857h34.638c1.6346-0.23497,1.0847-2.1237,1.1818-3.284v-49.431c0.018-0.6455-0.51-1.2961-1.182-1.285z"/>
<path fill="#FFF" d="m29.038,22.993h-14.182c4.7273-5.143,9.4547-10.286,14.182-15.429v15.429z"/>
</svg>

After

Width:  |  Height:  |  Size: 544 B

View File

@@ -1,7 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2,0,0,1.2,-579.7324,-351.106)">
<path d="m 509.777,296.755 c -12.426,0 -22.5,10.073 -22.5,22.5 0,12.427 10.074,22.5 22.5,22.5 12.426,0 22.5,-10.073 22.5,-22.5 0,-12.427 -10.074,-22.5 -22.5,-22.5 z m 14.063,22.5 c 0,2.344 -0.584,4.55 -1.602,6.495 l -18.955,-18.955 c 1.945,-1.019 4.151,-1.603 6.494,-1.603 7.754,10e-4 14.063,6.309 14.063,14.063 z m -28.125,0 c 0,-2.343 0.584,-4.55 1.602,-6.493 l 18.955,18.953 c -1.943,1.019 -4.15,1.603 -6.494,1.603 -7.755,0 -14.063,-6.308 -14.063,-14.063 z"
style="fill:#333333" />
</g>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3028"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Forbidden.svg">
<metadata
id="metadata3038">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3036" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1340"
inkscape:window-height="892"
id="namedview3034"
showgrid="false"
inkscape:zoom="8"
inkscape:cx="52.794424"
inkscape:cy="15.718112"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg3028" />
<g
transform="matrix(1.2,0,0,1.2,-579.7324,-351.106)"
id="g3030">
<path
d="m 532.27833,319.25811 c 0,-12.427 -10.07533,-22.50311 -22.50133,-22.50311 -12.426,0 -22.5,10.073 -22.5,22.5 0,12.427 10.074,22.5 22.5,22.5 l 0.021,-8.437 c -7.755,0 -14.08298,-6.308 -14.08298,-14.063 0,-2.343 0.584,-4.55 1.602,-6.493 l 18.955,18.953 c -1.943,1.019 -4.15,1.603 -6.494,1.603 l -0.001,8.45698 c 12.426,0 22.5,-10.09298 22.5,-22.51998 l -8.43744,5.9e-4 c 0,2.344 -0.58356,4.54941 -1.60156,6.49441 l -18.955,-18.955 c 1.945,-1.019 4.151,-1.603 6.494,-1.603 7.754,10e-4 14.063,6.309 14.063,14.063 z"
style="fill:#333333"
id="path3032"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cssccsccccccccccc" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 2.2 KiB

63
assets/icon/Remove2.svg Normal file
View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg3028"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Remove2.svg">
<metadata
id="metadata3038">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3036" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1680"
inkscape:window-height="968"
id="namedview3034"
showgrid="true"
inkscape:zoom="9.0377085"
inkscape:cx="14.895958"
inkscape:cy="28.796248"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg3028">
<inkscape:grid
type="xygrid"
id="grid3040" />
</sodipodi:namedview>
<g
transform="matrix(1.2000267,0,0,1.2000267,-651.9777,-351.11481)"
id="g3030">
<path
d="m 576.63525,319.25524 15.35699,-15.27674 c 0.627,-0.627 0.627,-1.654 0,-2.281 l -4.29338,-4.3352 c -0.627,-0.625 -1.652,-0.625 -2.279,0 l -15.45113,15.22642 -15.83298,-15.45692 c -0.627,-0.625 -1.654,-0.625 -2.281,0 l -3.9859,4.00946 c -0.625,0.627 -0.625,1.654 0,2.281 l 15.43337,15.83298 -15.31612,15.67389 c -0.61972,0.63419 -0.627,1.654 0,2.281 l 4.14303,4.07587 c 0.627,0.625 1.654,0.625 2.281,0 l 15.5586,-15.36424 16.05393,15.36226 c 0.627,0.625 1.652,0.625 2.279,0 l 3.69434,-4.06095 c 0.627,-0.627 0.62038,-1.64745 0,-2.281 z"
style="fill:#fe0000;fill-opacity:0.88627452"
id="path3032"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccscccccccsc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,13 +1,61 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<path d="M58.168,50.56,46.013,38.407c-0.91442-0.91442-2.3016-1.0644-3.3865-0.47161l-2.592-2.592c2.208-3.1357,3.5185-6.9493,3.5185-11.068,0-10.629-8.6485-19.276-19.277-19.276-10.629,0-19.276,8.6461-19.276,19.276s8.6461,19.277,19.276,19.277c4.1017,0,7.8985-1.296,11.026-3.4873l2.6088,2.6112c-0.56041,1.0752-0.40321,2.4348,0.49681,3.3373l12.155,12.153c1.1088,1.1112,2.9268,1.1112,4.0357,0l3.5725-3.5701c1.1064-1.1088,1.1064-2.9256-0.0024-4.0369z" fill="#333"/>
<path d="m1.4382,21.622a11.793,12.272,0,1,1,-23.586,0,11.793,12.272,0,1,1,23.586,0z" transform="matrix(1.0284553,0,0,1,35.146627,2.6846088)" fill="#FFF"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="64"
width="64"
version="1.1"
id="svg3965"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Search.svg">
<metadata
id="metadata3975">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3973" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1680"
inkscape:window-height="968"
id="namedview3971"
showgrid="false"
inkscape:zoom="16"
inkscape:cx="27.03623"
inkscape:cy="33.687368"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg3965" />
<path
d="M 39.436904,24.062448 C 39.915614,33.278293 29.16429,41.203307 19.736168,37.727362 10.452887,34.884476 6.7103607,23.258769 12.262163,15.90798 17.329733,7.8698857 31.048441,7.5763012 36.47627,15.419465 c 1.929199,2.496703 2.965789,5.568455 2.960389,8.64209 z"
id="path3969"
style="fill:#ffffff;fill-opacity:0.87450981"
inkscape:connector-curvature="0" />
<path
d="M 58.168,50.56 46.013,38.407 c -0.91442,-0.91442 -2.3016,-1.0644 -3.3865,-0.47161 l -2.592,-2.592 c 2.208,-3.1357 3.5185,-6.9493 3.5185,-11.068 0,-10.629 -8.6485,-19.276 -19.277,-19.276 -10.629,0 -19.276,8.6461 -19.276,19.276 0,10.6299 8.6461,19.277 19.276,19.277 4.1017,0 7.8985,-1.296 11.026,-3.4873 0,0 0.596082,-5.606306 -5.038478,-5.016691 -4.69706,2.902115 -12.054397,2.017375 -15.875086,-3.769003 -3.142722,-4.56604 -2.630816,-13.100523 2.668347,-16.731928 5.299163,-3.631405 14.142128,-3.981951 18.471312,4.363412 2.363082,6.040278 0.78609,12.603632 -5.311526,16.1632 7.665096,7.559567 7.694231,7.60221 7.694231,7.60221 -0.56041,1.0752 -0.40321,2.4348 0.49681,3.3373 l 12.155,12.153 c 1.1088,1.1112 2.9268,1.1112 4.0357,0 l 3.5725,-3.5701 c 1.1064,-1.1088 1.1064,-2.9256 -0.0024,-4.0369 z"
id="path3967"
inkscape:connector-curvature="0"
style="fill:#333333"
sodipodi:nodetypes="ccccssssccczccccccccc" />
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

14
assets/icon/Up.svg Normal file
View File

@@ -0,0 +1,14 @@
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g transform="matrix(0,-1.2,1.2,0,-567.9838,789.1274)">
<polygon points="652.39,499.94,629.89,518.93,629.89,509.46,607.39,509.46,607.39,490.51,629.89,490.51,629.89,481.04" fill="#333"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 638 B

46
assets/lang_in.xml Normal file
View File

@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="qconf configuration file">
<ext>*.in</ext>
<pass1><!-- multiline section & parse all file (now) and when modification retrive previous modification -->
<rule name="my preprocesseur">
<color>preprocesseur</color>
<start>#</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>'</start>
<end>'</end>
<!--<EscapeChar>\</EscapeChar>-->
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@menu|endmenu|comment|if|endif|help|default|choice|endchoice|prompt|depends on|config\@</start>
</rule>
<rule name="my type">
<color>type</color>
<start>\@int|hex|bool|string\@</start>
</rule>
<rule name="numeric constant">
<color>number</color>
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|!=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
</rule>
</pass2>
</EdnLang>

View File

@@ -45,23 +45,23 @@
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@return|goto|if|else|case|default|switch|break|continue|while|do|for|sizeof\@</start>
<start>\@return|goto|if|else|case|default|switch|break|continue|while|do|for\@</start>
</rule>
<rule name="my function keyword">
<color>systemFunction</color>
<start>\@new|delete|try|catch|memset|fopen|fread|fwrite|fgets|fclose|printf|(f|s|diag_)printf|calloc|malloc|realloc|(cyg|sup)_([a-z]|[A-Z]|[0-9]|_)+\@</start>
<start>\@new|try|catch|print\@</start>
</rule>
<rule name="my type">
<color>type</color>
<start>\@bool|char|double|float|u?int(8|16|32|64|128)?(_t)?|long|short|signed|size_t|unsigned|void|(I|U)(8|16|32|64|128)\@</start>
<start>\@boolean|byte|char|double|float|int|long|short|String|Object|Thread|void|enum\@</start>
</rule>
<rule name="my storage keyword">
<color>storageKeyword</color>
<start>\@import|package|extends|Override|const|class|virtual|private|public|protected|friend|const|extern|auto|register|static|unsigned|signed|volatile|char|double|float|int|long|short|void|typedef|struct|union|enum\@</start>
<start>\@import|package|extends|Override|implements|const|class|abstract|private|public|protected|final|const|static|transiant|volatile|interface@</start>
</rule>
<rule name="my common Define">
<color>commonDefine</color>
<start>\@NULL|MAX|MIN|__LINE__|__DATA__|__FILE__|__func__|__TIME__|__STDC__\@</start>
<start>\@null\@</start>
</rule>
<rule name="numeric constant">
<color>number</color>
@@ -69,7 +69,7 @@
</rule>
<rule name="my boolean">
<color>boolean</color>
<start>\@true|TRUE|false|FALSE\@</start>
<start>\@true|false\@</start>
</rule>
<rule name="BIG LETTER">
<color>macro</color>

60
assets/lang_lua.xml Normal file
View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<EdnLang version="0.1" lang="c">
<ext>*.lua</ext>
<pass1>
<rule name="Comment multiline">
<color>comment</color>
<start>\-\-\[\[</start>
<end>\-\-\]\]</end>
</rule>
<rule name="my todo comment">
<color>SYNTAX_ERROR</color>
<start>\-\-[ \t]*TODO[ \t]*:</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
</rule>
<rule name="my comment">
<color>comment</color>
<start>\-\-</start>
<end>\n</end>
<EscapeChar>\</EscapeChar>
</rule>
<rule name="doubleQuteText">
<color>doubleQuoteText</color>
<start>"</start>
<end>"</end>
<EscapeChar>\</EscapeChar>
</rule>
<rule name="simpleQuteText">
<color>doubleQuoteText</color>
<start>'</start>
<end>'</end>
</rule>
</pass1>
<pass2> <!-- Parse on display data ==> nor regenerate every display but every time modification apear -->
<rule name="my keyword">
<color>keyword</color>
<start>\@and|break|do|else|elseif|end|for|function|if|in|local|nil|not|or|repeat|return|then|until|while\@</start>
</rule>
<rule name="numeric constant">
<color>number</color>
<start>\@((0(x|X)[0-9a-fA-F]*)|(\d+\.?\d*|\.\d+)((e|E)(\+|\-)?\d+)?)(L|l|UL|ul|u|U|F|f)?\@</start>
</rule>
<rule name="my boolean">
<color>boolean</color>
<start>\@true|false\@</start>
</rule>
<rule name="BIG LETTER">
<color>macro</color>
<start>\@[A-Z_][A-Z_0-9]{3,500}\@</start>
</rule>
<rule name="Function name">
<color>functionName</color>
<start>\@(\w|_)+[ \t]*\(</start>
</rule>
<rule name="condition">
<color>boolean</color>
<start>==|&lt;=|&gt;=|~=|&lt;{1,2}|&gt;{1,2}|&amp;&amp;|\{|\}|</start>
</rule>
</pass2>
</EdnLang>

View File

@@ -1,8 +1,10 @@
#!/bin/bash
#really simple to install
sudo cp linux/bin/release/edn /usr/bin/edn
echo "- copy binary /usr/bin/edn"
sudo cp -vf linux/bin/release/edn /usr/bin/edn
sudo chmod 777 /usr/bin/edn
sudo mkdir -p /usr/share/edn
sudo rm -r /usr/share/edn/*
sudo cp -r assets/* /usr/share/edn/
echo "- Remove the folder /usr/share/edn/*"
sudo rm -rf /usr/share/edn/*
sudo cp -rfv assets/* /usr/share/edn/

View File

@@ -35,7 +35,6 @@ LOCAL_CFLAGS := -D__PLATFORM__Android \
-D__MODE__Touch \
-DETK_DEBUG_LEVEL=1 \
-DAPPL_DEBUG_LEVEL=1 \
-DMODE_RELEASE \
-DPROJECT_NAME="\"$(LOCAL_MODULE)\""
endif

View File

@@ -117,19 +117,19 @@ bool Buffer::NeedToUpdateDisplayPosition(void)
return tmpVal;
}
coord2D_ts Buffer::GetBorderSize(void)
Vector2D<float> Buffer::GetBorderSize(void)
{
coord2D_ts tmpVal;
Vector2D<float> tmpVal;
tmpVal.x = 30;
tmpVal.y = 30;
return tmpVal;
}
coord2D_ts Buffer::GetPosition(int32_t fontId,bool& centerRequested)
Vector2D<float> Buffer::GetPosition(int32_t fontId,bool& centerRequested)
{
centerRequested = false;
coord2D_ts tmpVal;
Vector2D<float> tmpVal;
tmpVal.x = 0;
tmpVal.y = 0;
return tmpVal;

View File

@@ -117,15 +117,15 @@ class Buffer {
// moving with cursor change position:
private:
bool m_updatePositionRequested; //!< if a position xhange in the windows ...
coord2D_ts m_maximumSize; //!< current maxSize of the buffer
Vector2D<float> m_maximumSize; //!< current maxSize of the buffer
protected:
void RequestUpdateOfThePosition(void) { m_updatePositionRequested = true; };
void SetMaximumSize(coord2D_ts maxSize) { m_maximumSize = maxSize; };
void SetMaximumSize(Vector2D<float> maxSize) { m_maximumSize = maxSize; };
public:
bool NeedToUpdateDisplayPosition(void);
virtual coord2D_ts GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ...
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested);
coord2D_ts GetMaxSize(void) { return m_maximumSize; };
virtual Vector2D<float> GetBorderSize(void); // this is to requested the minimum size for the buffer that is not consider as visible ...
virtual Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
Vector2D<float> GetMaxSize(void) { return m_maximumSize; };
protected:
bool m_fileModify; //!<
// naming

View File

@@ -79,7 +79,7 @@ int32_t BufferEmpty::Display(ewol::OObject2DTextColored& OOTextNormal,
int32_t fontId = OOTextNormal.GetFontID();
int32_t letterHeight = ewol::GetHeight(fontId);
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = 20;
textPos.y = 20;

View File

@@ -272,8 +272,8 @@ void classBufferManager::OnReceiveMessage(ewol::EObject * CallerObject, const ch
}
}
// set it to the currect display
SendMultiCast(ednMsgBufferId, destBuffer);
m_idSelected = destBuffer;
SendMultiCast(ednMsgBufferId, destBuffer);
}
// Remove requested buffer
Remove(closeID);

View File

@@ -214,7 +214,7 @@ void BufferText::DrawLineNumber(ewol::OObject2DTextColored* OOText, ewol::OObjec
OOColored->Rectangle( 0, positionY, sizeX+0.5*SEPARATION_SIZE_LINE_NUMBER, sizeY);
OOText->SetColor(ColorizeManager::Get(COLOR_CODE_LINE_NUMBER));
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = 1;
textPos.y = positionY;
etk::UString tmppp = tmpLineNumber;
@@ -299,7 +299,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
// update the display position with the scroll ofset :
int32_t displayStartBufferPos = m_EdnBuf.CountForwardNLines(0, displayStartLineId);
coord2D_ts maxSize;
Vector2D<float> maxSize;
maxSize.x = 0.0;
maxSize.y = m_EdnBuf.NumberOfLines() * letterHeight;
int32_t nbColoneForLineNumber = GetLineNumberNumberOfElement();
@@ -309,7 +309,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
m_displaySize.y = (sizeY/letterHeight) + 1;
APPL_VERBOSE("main DIPLAY " << m_displaySize.x << " char * " << m_displaySize.y << " char");
selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd);
colorInformation_ts * HLColor = NULL;
@@ -370,7 +370,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
OOTextBoldItalic.clippingSet(drawClippingTextArea);
OOColored.clippingSet(drawClippingTextArea);
etkFloat_t lineMaxSize = 0.0;
float lineMaxSize = 0.0;
for (iii=displayStartBufferPos; iii<mylen && displayLines < m_displaySize.y ; iii = new_i) {
//APPL_DEBUG("diplay element=" << iii);
int displaywidth;
@@ -411,7 +411,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored& OOTextNormal,
haveBg = selectColor->HaveBg();
}
}
coord2D_ts textPos;
Vector2D<float> textPos;
textPos.x = pixelX-offsetX;
textPos.y = y;
if (true == selectColor->GetItalic() ) {
@@ -553,7 +553,7 @@ void BufferText::MouseEvent(int32_t fontId, int32_t width, int32_t height)
/*if (m_cursorPreferredCol < 0) {
m_cursorPreferredCol = posX;
}*/
m_EdnBuf.Unselect(SELECTION_PRIMARY);
m_EdnBuf.Unselect();
RequestUpdateOfThePosition();
}
@@ -577,7 +577,7 @@ void BufferText::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t
int32_t selStart, selEnd, selRectStart, selRectEnd;
bool selIsRect;
int32_t selHave = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, selStart, selEnd, selIsRect, selRectStart, selRectEnd);
int32_t selHave = m_EdnBuf.GetSelectionPos(selStart, selEnd, selIsRect, selRectStart, selRectEnd);
//APPL_DEBUG("BufferText:: " << selHave << " = BufGetSelectionPos(SELECTION_PRIMARY," << selStart << "," << selEnd << "," << selIsRect << "," << selRectStart << "," << selRectEnd << ");" );
int32_t rememberCursorPos = m_cursorPos;
// move the cursor
@@ -589,12 +589,12 @@ void BufferText::MouseSelectFromCursorTo(int32_t fontId, int32_t width, int32_t
}*/
if (false == selHave) {
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos);
m_EdnBuf.Select(rememberCursorPos, m_cursorPos);
} else {
if (rememberCursorPos == selStart) {
m_EdnBuf.Select(SELECTION_PRIMARY, m_cursorPos, selEnd);
m_EdnBuf.Select(m_cursorPos, selEnd);
} else {
m_EdnBuf.Select(SELECTION_PRIMARY, selStart, m_cursorPos);
m_EdnBuf.Select(selStart, m_cursorPos);
}
}
Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
@@ -615,7 +615,7 @@ void BufferText::MouseEventDouble(void)
{
int32_t beginPos, endPos;
if (true == m_EdnBuf.SelectAround(m_cursorPos, beginPos, endPos)) {
m_EdnBuf.Select(SELECTION_PRIMARY, beginPos, endPos);
m_EdnBuf.Select(beginPos, endPos);
m_cursorPos = endPos;
}
Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
@@ -632,7 +632,7 @@ void BufferText::MouseEventDouble(void)
*/
void BufferText::MouseEventTriple(void)
{
m_EdnBuf.Select(SELECTION_PRIMARY, m_EdnBuf.StartOfLine(m_cursorPos), m_EdnBuf.EndOfLine(m_cursorPos));
m_EdnBuf.Select(m_EdnBuf.StartOfLine(m_cursorPos), m_EdnBuf.EndOfLine(m_cursorPos));
m_cursorPos = m_EdnBuf.EndOfLine(m_cursorPos);
Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
}
@@ -648,14 +648,14 @@ void BufferText::RemoveLine(void)
void BufferText::SelectAll(void)
{
m_EdnBuf.Select(SELECTION_PRIMARY, 0, m_EdnBuf.Size());
m_EdnBuf.Select(0, m_EdnBuf.Size());
m_cursorPos = m_EdnBuf.Size();
Copy(ewol::clipBoard::CLIPBOARD_SELECTION);
}
void BufferText::SelectNone(void)
{
m_EdnBuf.Unselect(SELECTION_PRIMARY);
m_EdnBuf.Unselect();
}
@@ -671,13 +671,13 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
{
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
int32_t rememberCursorPos = m_cursorPos;
//APPL_DEBUG("newPos=" << newPos);
// unselect buffer:
m_EdnBuf.Unselect(SELECTION_PRIMARY);
m_EdnBuf.Unselect();
/* make sure new position is ok, do nothing if it hasn't changed */
if (newPos != m_cursorPos) {
if (newPos < 0){
@@ -695,19 +695,19 @@ void BufferText::SetInsertPosition(int32_t newPos, bool insertChar)
return;
}
if( false == haveSelectionActive
&& true == ewol::IsSetShift() )
if( false == haveSelectionActive
&& true == ewol::IsSetShift() )
{
// new selection
m_EdnBuf.Select(SELECTION_PRIMARY, rememberCursorPos, m_cursorPos);
} else if( true == ewol::IsSetShift()
&& true == haveSelectionActive)
m_EdnBuf.Select(rememberCursorPos, m_cursorPos);
} else if( true == ewol::IsSetShift()
&& true == haveSelectionActive)
{
// update selection
if (rememberCursorPos == SelectionStart) {
m_EdnBuf.Select(SELECTION_PRIMARY, m_cursorPos, SelectionEnd);
m_EdnBuf.Select(m_cursorPos, SelectionEnd);
} else {
m_EdnBuf.Select(SELECTION_PRIMARY, SelectionStart, m_cursorPos);
m_EdnBuf.Select(SelectionStart, m_cursorPos);
}
}
}
@@ -849,11 +849,11 @@ void BufferText::cursorMove(ewol::eventKbMoveType_te moveTypeEvent)
* @return ---
*
*/
coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
Vector2D<float> BufferText::GetPosition(int32_t fontId, bool& centerRequested)
{
centerRequested = m_centerRequested;
m_centerRequested = false;
coord2D_ts outputPosition;
Vector2D<float> outputPosition;
// Display position (Y mode):
APPL_INFO("change the position : " << m_cursorPos);
@@ -867,8 +867,8 @@ coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
// get font porperties :
// TODO : change this :
etkFloat_t letterWidth = ewol::GetWidth(fontId, "A");
etkFloat_t letterHeight = ewol::GetHeight(fontId);
float letterWidth = ewol::GetWidth(fontId, "A");
float letterHeight = ewol::GetHeight(fontId);
outputPosition.x *= letterWidth;
outputPosition.y *= letterHeight;
return outputPosition;
@@ -876,7 +876,7 @@ coord2D_ts BufferText::GetPosition(int32_t fontId, bool& centerRequested)
/* if we request a center :
} else {
// center the line at the middle of the screen :
coord2D_ts outputPosition;
Vector2D<float> outputPosition;
//APPL_DEBUG(" -------------------------------------------------");
outputPosition.y = m_EdnBuf.CountLines(0, m_cursorPos);
//APPL_DEBUG(" cursor position : " << m_cursorPos << " ==> ligne=" << outputPosition.y);
@@ -907,7 +907,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
{
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (unicodeData == 0x09) {
if (false == haveSelectionActive) {
etk::VectorType<int8_t> tmpVect;
@@ -921,13 +921,13 @@ void BufferText::AddChar(uniChar_t unicodeData)
if (0 == nbSelectedLines) {
etk::VectorType<int8_t> tmpVect;
tmpVect.PushBack(0x09);
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
} else {
if (true == ewol::IsSetShift() ) {
m_cursorPos = m_EdnBuf.UnIndent(SELECTION_PRIMARY);
m_cursorPos = m_EdnBuf.UnIndent();
} else {
m_cursorPos = m_EdnBuf.Indent(SELECTION_PRIMARY);
m_cursorPos = m_EdnBuf.Indent();
}
}
}
@@ -963,7 +963,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+tmpVect.Size(), true);
} else {
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+tmpVect.Size(), true);
}
} else if (unicodeData == 0x7F ) {
@@ -971,7 +971,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
if (false == haveSelectionActive) {
m_EdnBuf.Remove(m_cursorPos, m_cursorPos+1);
} else {
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
m_EdnBuf.RemoveSelected();
SetInsertPosition(SelectionStart, true);
}
} else if (unicodeData == 0x08) {
@@ -980,7 +980,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
m_EdnBuf.Remove(m_cursorPos-1, m_cursorPos);
SetInsertPosition(m_cursorPos-1, true);
} else {
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
m_EdnBuf.RemoveSelected();
SetInsertPosition(SelectionStart, true);
}
} else {
@@ -995,7 +995,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+localOfset, true);
} else {
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+localOfset, true);
}
} else {
@@ -1009,7 +1009,7 @@ void BufferText::AddChar(uniChar_t unicodeData)
m_EdnBuf.Insert(m_cursorPos, tmpVect);
SetInsertPosition(m_cursorPos+1, true);
} else {
m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, tmpVect);
m_EdnBuf.ReplaceSelected(tmpVect);
SetInsertPosition(SelectionStart+1, true);
}
}
@@ -1047,7 +1047,7 @@ int32_t BufferText::FindLine(etk::UString &data)
void BufferText::JumpAtLine(int32_t newLine)
{
int32_t positionLine = m_EdnBuf.CountForwardNLines(0, newLine);
m_EdnBuf.Unselect(SELECTION_PRIMARY);
m_EdnBuf.Unselect();
APPL_DEBUG("jump at the line : " << newLine );
SetInsertPosition(positionLine);
m_centerRequested = true;
@@ -1075,7 +1075,7 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
int32_t startSearchPos = m_cursorPos;
if (true == haveSelectionActive) {
@@ -1090,46 +1090,41 @@ void BufferText::Search(etk::UString &data, bool back, bool caseSensitive, bool
APPL_WARNING("no search data");
return;
}
etk::VectorType<uniChar_t> mVectSearch;
mVectSearch = data.GetVector();
APPL_TODO("Remove for now ...");
/*
if (false == back) {
//APPL_INFO("search data Forward : startSearchPos=" << startSearchPos );
int32_t foundPos;
bool findSomething = m_EdnBuf.SearchForward(startSearchPos, mVectSearch, &foundPos, caseSensitive);
int32_t foundPosEnd;
bool findSomething = m_EdnBuf.SearchForward(startSearchPos, data, &foundPos, &foundPosEnd, caseSensitive);
if( false == findSomething
&& true == wrap)
{
//APPL_INFO("WrapMode !!! 0 ==> end");
findSomething = m_EdnBuf.SearchForward(0, mVectSearch, &foundPos, caseSensitive);
findSomething = m_EdnBuf.SearchForward(0, data, &foundPos, &foundPosEnd, caseSensitive);
}
// if find data :
if (true == findSomething) {
// select new position
int32_t endSelectionPos = foundPos+mVectSearch.Size();
SetInsertPosition(endSelectionPos);
m_EdnBuf.Select(SELECTION_PRIMARY, foundPos, endSelectionPos);
SetInsertPosition(foundPosEnd);
m_EdnBuf.Select(foundPos, foundPosEnd);
}
} else {
//APPL_INFO("search data Backward : " << data.GetDirectPointer() );
int32_t foundPos;
bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, mVectSearch, &foundPos, caseSensitive);
int32_t foundPosEnd;
bool findSomething = m_EdnBuf.SearchBackward(startSearchPos, data, &foundPos, &foundPosEnd, caseSensitive);
if( false == findSomething
&& true == wrap)
{
//APPL_INFO("WrapMode !!! end ==> 0");
findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), mVectSearch, &foundPos, caseSensitive);
findSomething = m_EdnBuf.SearchBackward(m_EdnBuf.Size(), data, &foundPos, &foundPosEnd, caseSensitive);
}
// if find data :
if (true == findSomething) {
// select new position
int32_t endSelectionPos = foundPos+mVectSearch.Size();
SetInsertPosition(foundPos);
m_EdnBuf.Select(SELECTION_PRIMARY, foundPos, endSelectionPos);
m_EdnBuf.Select(foundPos, foundPosEnd);
}
}
*/
m_centerRequested = true;
RequestUpdateOfThePosition();
}
@@ -1139,10 +1134,10 @@ void BufferText::Replace(etk::UString &data)
{
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (true == haveSelectionActive) {
// Replace Data :
int32_t size = m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, data);
int32_t size = m_EdnBuf.ReplaceSelected(data);
SetInsertPosition(SelectionStart + size);
}
SetModify(true);
@@ -1161,8 +1156,8 @@ void BufferText::Copy(int8_t clipboardID)
{
etk::UString mVect;
// get the curent selected data
if (true == m_EdnBuf.SelectHasSelection(SELECTION_PRIMARY) ) {
m_EdnBuf.GetSelectionText(SELECTION_PRIMARY, mVect);
if (true == m_EdnBuf.SelectHasSelection() ) {
m_EdnBuf.GetSelectionText(mVect);
}
// copy data in the click board :
ewol::clipBoard::Set(clipboardID, mVect);
@@ -1182,14 +1177,14 @@ void BufferText::Cut(int8_t clipboardID)
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
// copy data
Copy(clipboardID);
// remove data :
if (true == haveSelectionActive ) {
APPL_INFO("REMOVE SELECTION");
m_EdnBuf.RemoveSelected(SELECTION_PRIMARY);
m_EdnBuf.RemoveSelected();
m_cursorPos = SelectionStart;
}
RequestUpdateOfThePosition();
@@ -1213,11 +1208,11 @@ void BufferText::Paste(int8_t clipboardID)
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SELECTION_PRIMARY, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = m_EdnBuf.GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (true == haveSelectionActive ) {
// replace data
int32_t size = m_EdnBuf.ReplaceSelected(SELECTION_PRIMARY, mVect );
int32_t size = m_EdnBuf.ReplaceSelected(mVect );
m_cursorPos = SelectionStart + size;
} else {
// insert data

View File

@@ -85,7 +85,7 @@ class BufferText : public Buffer {
// Direct buffer IO
EdnBuf m_EdnBuf; //!< buffer associated on this displayer
coord2D_ts m_displaySize; //!< number of char displayable in the screan
Vector2D<float> m_displaySize; //!< number of char displayable in the screan
// Cursor :
int32_t m_cursorPos; //!< position in the buffer of the cursor
int32_t m_cursorPreferredCol; //!< colomn of the last up and down ...
@@ -96,7 +96,7 @@ class BufferText : public Buffer {
private:
bool m_centerRequested;
public:
virtual coord2D_ts GetPosition(int32_t fontId, bool& centerRequested);
virtual Vector2D<float> GetPosition(int32_t fontId, bool& centerRequested);
private:
bool TextDMoveUp(int32_t offset);
bool TextDMoveDown(int32_t offset);

View File

@@ -56,18 +56,10 @@ EdnBuf::EdnBuf(void)
m_useTabs = true;
// Current selection
m_selectionList[SELECTION_PRIMARY].selected = false;
m_selectionList[SELECTION_PRIMARY].zeroWidth = false;
m_selectionList[SELECTION_PRIMARY].rectangular = false;
m_selectionList[SELECTION_PRIMARY].start = m_selectionList[SELECTION_PRIMARY].end = 0;
m_selectionList[SELECTION_SECONDARY].selected = false;
m_selectionList[SELECTION_SECONDARY].zeroWidth = false;
m_selectionList[SELECTION_SECONDARY].rectangular = false;
m_selectionList[SELECTION_SECONDARY].start = m_selectionList[SELECTION_SECONDARY].end = 0;
m_selectionList[SELECTION_HIGHTLIGHT].selected = false;
m_selectionList[SELECTION_HIGHTLIGHT].zeroWidth = false;
m_selectionList[SELECTION_HIGHTLIGHT].rectangular = false;
m_selectionList[SELECTION_HIGHTLIGHT].start = m_selectionList[SELECTION_HIGHTLIGHT].end = 0;
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
m_selectionList.rectangular = false;
m_selectionList.start = m_selectionList.end = 0;
// charset :
m_isUtf8 = false;
@@ -116,7 +108,7 @@ bool EdnBuf::DumpFrom(FILE *myFile)
{
if (true == m_data.DumpFrom(myFile) ) {
// set no selection
UpdateSelections(0, 0, m_data.Size() );
UpdateSelection(0, 0, m_data.Size() );
// generate HighLight
CleanHighLight();
GenerateHighLightAt(0, m_data.Size());
@@ -150,7 +142,7 @@ void EdnBuf::SetAll(etk::VectorType<int8_t> &text)
m_data.Insert(0, text);
// Zero all of the existing selections
UpdateSelections(0, deletedText.Size(), 0);
UpdateSelection(0, deletedText.Size(), 0);
// Call the modification Event Manager
eventModification(0, m_data.Size(), deletedText);
@@ -247,6 +239,9 @@ int32_t EdnBuf::Insert(int32_t pos, etk::UString &insertText)
*/
int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::VectorType<int8_t> &insertText)
{
if (end-start == 0) {
return 0;
}
etk::VectorType<int8_t> deletedText;
GetRange(start, end, deletedText);
m_data.Replace(start, end-start, insertText);
@@ -254,8 +249,12 @@ int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::VectorType<int8_t> &ins
eventModification(start, insertText.Size(), deletedText);
return insertText.Size();
}
int32_t EdnBuf::Replace(int32_t start, int32_t end, etk::UString &insertText)
{
if (end-start == 0) {
return 0;
}
etk::VectorType<int8_t> deletedText;
GetRange(start, end, deletedText);
etk::VectorType<int8_t> tmpInsertText;
@@ -314,17 +313,17 @@ void EdnBuf::Remove(int32_t start, int32_t end)
}
int32_t EdnBuf::Indent(selectionType_te select)
int32_t EdnBuf::Indent(void)
{
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = GetSelectionPos(select, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (false == haveSelectionActive) {
return SelectionEnd;
}
// Disable selection:
Unselect(select);
Unselect();
// Get Range :
int32_t l_start = StartOfLine(SelectionStart);
int32_t l_end = EndOfLine(SelectionEnd);
@@ -348,22 +347,22 @@ int32_t EdnBuf::Indent(selectionType_te select)
Replace(l_start, l_end, l_tmpData);
// Set the new selection :
l_end = l_start + l_tmpData.Size();
Select(select, l_start, l_end);
Select(l_start, l_end);
// Return the position of the cursor
return l_end;
}
int32_t EdnBuf::UnIndent(selectionType_te select)
int32_t EdnBuf::UnIndent(void)
{
int32_t SelectionStart, SelectionEnd, SelectionRectStart, SelectionRectEnd;
bool SelectionIsRect;
bool haveSelectionActive = GetSelectionPos(select, SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
bool haveSelectionActive = GetSelectionPos(SelectionStart, SelectionEnd, SelectionIsRect, SelectionRectStart, SelectionRectEnd);
if (false == haveSelectionActive) {
return SelectionEnd;
}
// Disable selection:
Unselect(select);
Unselect();
// Get Range :
int32_t l_start = StartOfLine(SelectionStart);
int32_t l_end = EndOfLine(SelectionEnd);
@@ -394,7 +393,7 @@ int32_t EdnBuf::UnIndent(selectionType_te select)
Replace(l_start, l_end, l_tmpData);
// Set the new selection :
l_end = l_start + l_tmpData.Size();
Select(select, l_start, l_end);
Select(l_start, l_end);
// Return the position of the cursor
return l_end;
}
@@ -986,13 +985,25 @@ bool EdnBuf::charMatch(char first, char second, bool caseSensitive)
* @return false ==> not found data
*
*/
bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive)
bool EdnBuf::SearchForward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive)
{
etk::VectorType<int8_t> searchVect;
if (true == m_isUtf8) {
char * tmpPointer = search.Utf8Data();
while (*tmpPointer != '\0') {
searchVect.PushBack(*tmpPointer++);
}
} else {
etk::VectorType<unsigned int> tmppp = search.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// remove the '\0' at the end of the string ...
searchVect.PopBack();
int32_t position;
int32_t searchLen = searchVect.Size();
int32_t dataLen = m_data.Size();
char currentChar = '\0';
//APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
APPL_INFO(" startPos=" << startPos << " searchLen=" << searchLen);
for (position=startPos; position<dataLen - (searchLen-1); position++) {
currentChar = m_data[position];
if (true == charMatch(currentChar, searchVect[0], caseSensitive)) {
@@ -1007,11 +1018,13 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect
}
if (true == found) {
*foundPos = position;
*foundPosEnd = position + searchVect.Size();
return true;
}
}
}
*foundPos = m_data.Size();
*foundPosEnd = m_data.Size();
return false;
}
@@ -1027,8 +1040,21 @@ bool EdnBuf::SearchForward(int32_t startPos, etk::VectorType<int8_t> &searchVect
* @return false ==> not found data
*
*/
bool EdnBuf::SearchBackward(int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive)
bool EdnBuf::SearchBackward(int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive)
{
etk::VectorType<int8_t> searchVect;
if (true == m_isUtf8) {
char * tmpPointer = search.Utf8Data();
while (*tmpPointer != '\0') {
searchVect.PushBack(*tmpPointer++);
}
} else {
etk::VectorType<unsigned int> tmppp = search.GetVector();
convertUnicodeToIso(m_charsetType, tmppp, searchVect);
}
// remove the '\0' at the end of the string ...
searchVect.PopBack();
int32_t position;
int32_t searchLen = searchVect.Size();
char currentChar = '\0';
@@ -1047,11 +1073,13 @@ bool EdnBuf::SearchBackward(int32_t startPos, etk::VectorType<int8_t> &searchVec
}
if (true == found) {
*foundPos = position - (searchLen-1);
*foundPosEnd = position + searchVect.Size();
return true;
}
}
}
*foundPos = m_data.Size();
*foundPosEnd = m_data.Size();
return false;
}
@@ -1158,7 +1186,7 @@ int32_t EdnBuf::LocalInsert(int32_t pos, etk::VectorType<int8_t> &insertText)
// Insert data in buffer
m_data.Insert(pos, insertText);
// update the current selected area
UpdateSelections(pos, 0, insertText.Size() );
UpdateSelection(pos, 0, insertText.Size() );
// return the number of element inserted ...
return insertText.Size();
}

View File

@@ -58,14 +58,6 @@ typedef struct {
int32_t rectEnd; //!< Indent of right edge of rect. selection
} selection;
typedef enum{
SELECTION_PRIMARY,
SELECTION_SECONDARY,
SELECTION_HIGHTLIGHT,
SELECTION_SIZE
}selectionType_te;
typedef struct {
etk::VectorType<colorInformation_ts> HLData;
int32_t posHLPass1;
@@ -95,8 +87,8 @@ class EdnBuf {
int32_t Replace( int32_t start, int32_t end, etk::VectorType<int8_t> &insertText);
int32_t Replace( int32_t start, int32_t end, etk::UString &insertText);
void Remove( int32_t start, int32_t end);
int32_t Indent( selectionType_te select);
int32_t UnIndent( selectionType_te select);
int32_t Indent( void);
int32_t UnIndent( void);
void GetLineText( int32_t pos, etk::VectorType<int8_t> &text);
@@ -115,35 +107,34 @@ class EdnBuf {
int32_t CountForwardNLines( int32_t startPos, int32_t nLines);
int32_t CountBackwardNLines( int32_t startPos, int32_t nLines);
bool SearchForward( int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
bool SearchBackward( int32_t startPos, etk::VectorType<int8_t> &searchVect, int32_t *foundPos, bool caseSensitive = true);
bool SearchForward( int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive = true);
bool SearchBackward( int32_t startPos, etk::UString &search, int32_t *foundPos, int32_t *foundPosEnd, bool caseSensitive = true);
bool SearchForward( int32_t startPos, char searchChar, int32_t *foundPos);
bool SearchBackward( int32_t startPos, char searchChar, int32_t *foundPos);
bool SelectAround( int32_t startPos, int32_t &beginPos, int32_t &endPos);
// Buffer Size system :
int32_t Size(void) { return m_data.Size(); };
int32_t NumberOfLines(void) {return m_nbLine;};
int32_t NumberOfLines(void) { return m_nbLine; };
// -----------------------------------------
// selection remember...
// -----------------------------------------
public:
bool SelectHasSelection( selectionType_te select);
void Select( selectionType_te select, int32_t start, int32_t end);
void Unselect( selectionType_te select);
void RectSelect( selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd);
bool GetSelectionPos( selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd);
void GetSelectionText( selectionType_te select, etk::VectorType<int8_t> &text);
void GetSelectionText( selectionType_te select, etk::UString &text);
void RemoveSelected( selectionType_te select);
int32_t ReplaceSelected( selectionType_te select, etk::VectorType<int8_t> &text);
int32_t ReplaceSelected( selectionType_te select, etk::UString &text);
bool SelectHasSelection(void);
void Select( int32_t start, int32_t end);
void Unselect( void);
void RectSelect( int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd);
bool GetSelectionPos( int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd);
void GetSelectionText( etk::VectorType<int8_t> &text);
void GetSelectionText( etk::UString &text);
void RemoveSelected( void);
int32_t ReplaceSelected( etk::VectorType<int8_t> &text);
int32_t ReplaceSelected( etk::UString &text);
private:
// current selection of the buffer
selection m_selectionList[SELECTION_SIZE]; //!< Selection area of the buffer
void UpdateSelection( selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted);
void UpdateSelections( int32_t pos, int32_t nDeleted, int32_t nInserted);
selection m_selectionList; //!< Selection area of the buffer
void UpdateSelection( int32_t pos, int32_t nDeleted, int32_t nInserted);
// -----------------------------------------
// History section :

View File

@@ -41,9 +41,9 @@
* @return ---
*
*/
bool EdnBuf::SelectHasSelection(selectionType_te select)
bool EdnBuf::SelectHasSelection(void)
{
return m_selectionList[select].selected;
return m_selectionList.selected;
}
@@ -56,14 +56,14 @@ bool EdnBuf::SelectHasSelection(selectionType_te select)
* @return ---
*
*/
void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
void EdnBuf::Select(int32_t start, int32_t end)
{
//selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = start != end;
m_selectionList[select].zeroWidth = (start == end) ? true : false;
m_selectionList[select].rectangular = false;
m_selectionList[select].start = etk_min(start, end);
m_selectionList[select].end = etk_max(start, end);
m_selectionList.selected = start != end;
m_selectionList.zeroWidth = (start == end) ? true : false;
m_selectionList.rectangular = false;
m_selectionList.start = etk_min(start, end);
m_selectionList.end = etk_max(start, end);
}
@@ -75,11 +75,11 @@ void EdnBuf::Select(selectionType_te select, int32_t start, int32_t end)
* @return ---
*
*/
void EdnBuf::Unselect(selectionType_te select)
void EdnBuf::Unselect(void)
{
//selection oldSelection = m_selectionList[select];
m_selectionList[select].selected = false;
m_selectionList[select].zeroWidth = false;
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
}
@@ -94,15 +94,15 @@ void EdnBuf::Unselect(selectionType_te select)
* @return ---
*
*/
void EdnBuf::RectSelect(selectionType_te select, int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd)
void EdnBuf::RectSelect(int32_t start, int32_t end, int32_t rectStart, int32_t rectEnd)
{
m_selectionList[select].selected = rectStart < rectEnd;
m_selectionList[select].zeroWidth = (rectStart == rectEnd) ? false : true;
m_selectionList[select].rectangular = true;
m_selectionList[select].start = start;
m_selectionList[select].end = end;
m_selectionList[select].rectStart = rectStart;
m_selectionList[select].rectEnd = rectEnd;
m_selectionList.selected = rectStart < rectEnd;
m_selectionList.zeroWidth = (rectStart == rectEnd) ? false : true;
m_selectionList.rectangular = true;
m_selectionList.start = start;
m_selectionList.end = end;
m_selectionList.rectStart = rectStart;
m_selectionList.rectEnd = rectEnd;
}
@@ -114,17 +114,17 @@ void EdnBuf::RectSelect(selectionType_te select, int32_t start, int32_t end, int
* @return ---
*
*/
bool EdnBuf::GetSelectionPos(selectionType_te select, int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd)
bool EdnBuf::GetSelectionPos(int32_t &start, int32_t &end, bool &isRect, int32_t &rectStart, int32_t &rectEnd)
{
/* Always fill in the parameters (zero-width can be requested too). */
isRect = m_selectionList[select].rectangular;
start = m_selectionList[select].start;
end = m_selectionList[select].end;
if (m_selectionList[select].rectangular) {
rectStart = m_selectionList[select].rectStart;
rectEnd = m_selectionList[select].rectEnd;
isRect = m_selectionList.rectangular;
start = m_selectionList.start;
end = m_selectionList.end;
if (m_selectionList.rectangular) {
rectStart = m_selectionList.rectStart;
rectEnd = m_selectionList.rectEnd;
}
return m_selectionList[select].selected;
return m_selectionList.selected;
}
@@ -136,14 +136,14 @@ bool EdnBuf::GetSelectionPos(selectionType_te select, int32_t &start, int32_t &e
* @return ---
*
*/
void EdnBuf::GetSelectionText(selectionType_te select, etk::VectorType<int8_t> &text)
void EdnBuf::GetSelectionText(etk::VectorType<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text.Clear();
bool isSelected = GetSelectionPos(select, start, end, isRect, rectStart, rectEnd);
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
@@ -158,14 +158,14 @@ void EdnBuf::GetSelectionText(selectionType_te select, etk::VectorType<int8_t> &
GetRange(start, end, text);
}
}
void EdnBuf::GetSelectionText(selectionType_te select, etk::UString &text)
void EdnBuf::GetSelectionText(etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
// remove output data
text = "";
bool isSelected = GetSelectionPos(select, start, end, isRect, rectStart, rectEnd);
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
@@ -190,12 +190,12 @@ void EdnBuf::GetSelectionText(selectionType_te select, etk::UString &text)
* @return ---
*
*/
void EdnBuf::RemoveSelected(selectionType_te select)
void EdnBuf::RemoveSelected(void)
{
int32_t start, end;
int32_t rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(select, start, end, isRect, rectStart, rectEnd);
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
@@ -208,7 +208,7 @@ void EdnBuf::RemoveSelected(selectionType_te select)
} else {
Remove(start, end);
}
Unselect(select);
Unselect();
}
@@ -220,11 +220,11 @@ void EdnBuf::RemoveSelected(selectionType_te select)
* @return ---
*
*/
int32_t EdnBuf::ReplaceSelected(selectionType_te select, etk::VectorType<int8_t> &text)
int32_t EdnBuf::ReplaceSelected(etk::VectorType<int8_t> &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(select, start, end, isRect, rectStart, rectEnd);
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
@@ -239,14 +239,14 @@ int32_t EdnBuf::ReplaceSelected(selectionType_te select, etk::VectorType<int8_t>
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList[select].selected = false;
m_selectionList.selected = false;
return returnSize;
}
int32_t EdnBuf::ReplaceSelected(selectionType_te select, etk::UString &text)
int32_t EdnBuf::ReplaceSelected(etk::UString &text)
{
int32_t start, end, rectStart, rectEnd;
bool isRect;
bool isSelected = GetSelectionPos(select, start, end, isRect, rectStart, rectEnd);
bool isSelected = GetSelectionPos(start, end, isRect, rectStart, rectEnd);
// No data selected ...
if (false == isSelected) {
@@ -261,31 +261,11 @@ int32_t EdnBuf::ReplaceSelected(selectionType_te select, etk::UString &text)
returnSize = Replace(start, end, text);
}
// Clean selection
m_selectionList[select].selected = false;
m_selectionList.selected = false;
return returnSize;
}
/*
** Update all of the selections in "buf" for changes in the buffer's text
*/
/**
* @brief
*
* @param[in,out] ---
*
* @return ---
*
*/
void EdnBuf::UpdateSelections(int32_t pos, int32_t nDeleted, int32_t nInserted)
{
UpdateSelection(SELECTION_PRIMARY , pos, nDeleted, nInserted);
UpdateSelection(SELECTION_SECONDARY , pos, nDeleted, nInserted);
UpdateSelection(SELECTION_HIGHTLIGHT, pos, nDeleted, nInserted);
}
/*
** Update an individual selection for changes in the corresponding text
*/
@@ -297,33 +277,33 @@ void EdnBuf::UpdateSelections(int32_t pos, int32_t nDeleted, int32_t nInserted)
* @return ---
*
*/
void EdnBuf::UpdateSelection(selectionType_te select, int32_t pos, int32_t nDeleted, int32_t nInserted)
void EdnBuf::UpdateSelection(int32_t pos, int32_t nDeleted, int32_t nInserted)
{
if( ( false == m_selectionList[select].selected
&& false == m_selectionList[select].zeroWidth)
|| pos > m_selectionList[select].end )
if( ( false == m_selectionList.selected
&& false == m_selectionList.zeroWidth)
|| pos > m_selectionList.end )
{
return;
}
if (pos+nDeleted <= m_selectionList[select].start) {
m_selectionList[select].start += nInserted - nDeleted;
m_selectionList[select].end += nInserted - nDeleted;
} else if( pos <= m_selectionList[select].start
&& pos+nDeleted >= m_selectionList[select].end)
if (pos+nDeleted <= m_selectionList.start) {
m_selectionList.start += nInserted - nDeleted;
m_selectionList.end += nInserted - nDeleted;
} else if( pos <= m_selectionList.start
&& pos+nDeleted >= m_selectionList.end)
{
m_selectionList[select].start = pos;
m_selectionList[select].end = pos;
m_selectionList[select].selected = false;
m_selectionList[select].zeroWidth = false;
} else if( pos <= m_selectionList[select].start
&& pos+nDeleted < m_selectionList[select].end)
m_selectionList.start = pos;
m_selectionList.end = pos;
m_selectionList.selected = false;
m_selectionList.zeroWidth = false;
} else if( pos <= m_selectionList.start
&& pos+nDeleted < m_selectionList.end)
{
m_selectionList[select].start = pos;
m_selectionList[select].end = nInserted + m_selectionList[select].end - nDeleted;
} else if(pos < m_selectionList[select].end) {
m_selectionList[select].end += nInserted - nDeleted;
if (m_selectionList[select].end <= m_selectionList[select].start) {
m_selectionList[select].selected = false;
m_selectionList.start = pos;
m_selectionList.end = nInserted + m_selectionList.end - nDeleted;
} else if(pos < m_selectionList.end) {
m_selectionList.end += nInserted - nDeleted;
if (m_selectionList.end <= m_selectionList.start) {
m_selectionList.selected = false;
}
}
}

View File

@@ -186,7 +186,7 @@ bool BufferView::GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToW
return true;
}
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y)
bool BufferView::OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y)
{
if (1 == IdInput && typeEvent == ewol::EVENT_INPUT_TYPE_SINGLE) {
APPL_INFO("Event on List : IdInput=" << IdInput << " colomn=" << colomn << " raw=" << raw );

View File

@@ -69,7 +69,7 @@ class BufferView : public ewol::List
virtual bool GetTitle(int32_t colomn, etk::UString &myTitle, color_ts &fg, color_ts &bg);
virtual uint32_t GetNuberOfRaw(void);
virtual bool GetElement(int32_t colomn, int32_t raw, etk::UString &myTextToWrite, color_ts &fg, color_ts &bg);
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, etkFloat_t x, etkFloat_t y);
virtual bool OnItemEvent(int32_t IdInput, ewol::eventInputType_te typeEvent, int32_t colomn, int32_t raw, float x, float y);
private:
int32_t m_selectedIdRequested;
int32_t m_selectedID;

View File

@@ -72,6 +72,8 @@ CodeView::CodeView(void)
RegisterMultiCast(ednMsgGuiRm);
RegisterMultiCast(ednMsgGuiSelect);
RegisterMultiCast(ednMsgGuiChangeCharset);
RegisterMultiCast(ednMsgGuiFind);
RegisterMultiCast(ednMsgGuiReplace);
}
CodeView::~CodeView(void)
@@ -87,7 +89,7 @@ CodeView::~CodeView(void)
*/
void CodeView::UpdateNumberOfLineReference(int32_t bufferID)
{
coord2D_ts tmpCoord;
Vector2D<float> tmpCoord;
tmpCoord.x = 0;
tmpCoord.y = 0;
if (m_lineNumberList.Size()<=bufferID) {
@@ -157,6 +159,7 @@ void CodeView::OnDraw(void)
m_OObjectTextBold[ m_currentDrawId].Draw();
m_OObjectTextItalic[ m_currentDrawId].Draw();
m_OObjectTextBoldItalic[m_currentDrawId].Draw();
WidgetScrooled::OnDraw();
}
void CodeView::OnRegenerateDisplay(void)
@@ -181,9 +184,9 @@ void CodeView::OnRegenerateDisplay(void)
if(true == BufferManager::Get(m_bufferID)->NeedToUpdateDisplayPosition() ) {
coord2D_ts borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
Vector2D<float> borderWidth = BufferManager::Get(m_bufferID)->GetBorderSize();
bool centerRequested = false;
coord2D_ts currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested);
Vector2D<float> currentPosition = BufferManager::Get(m_bufferID)->GetPosition(m_OObjectTextNormal[m_currentCreateId].GetFontID(), centerRequested);
SetScrollingPositionDynamic(borderWidth, currentPosition, centerRequested);
} // else : nothing to do ...
@@ -230,21 +233,22 @@ bool CodeView::OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveTy
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
bool CodeView::OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos)
bool CodeView::OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos)
{
coord2D_ts relativePos = RelativePosition(pos);
Vector2D<float> relativePos = RelativePosition(pos);
if (m_bufferID < 0) {
return false;
}
if (true == WidgetScrooled::OnEventInput(IdInput, typeEvent, pos)) {
if (true == WidgetScrooled::OnEventInput(type, IdInput, typeEvent, pos)) {
ewol::widgetManager::FocusKeep(this);
// nothing to do ... done on upper widet ...
// nothing to do ... done on upper widget ...
return true;
}
if (1 == IdInput) {
@@ -374,33 +378,26 @@ void CodeView::OnReceiveMessage(ewol::EObject * CallerObject, const char * event
} else {
APPL_ERROR(" on event " << eventId << " unknow data=\"" << data << "\"" );
}
} else if (eventId == ednMsgGuiFind) {
etk::UString myDataString;
SearchData::GetSearch(myDataString);
if (data == "Next") {
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
} else if (data == "Previous") {
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
} else if (eventId == ednMsgGuiReplace) {
etk::UString myDataString;
SearchData::GetReplace(myDataString);
if (data == "Normal") {
BufferManager::Get(m_bufferID)->Replace(myDataString);
} else if (data == "All") {
}
}
/*
switch (id)
{
case APPL_MSG__CURRENT_FIND_PREVIOUS:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, true, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case APPL_MSG__CURRENT_FIND_NEXT:
{
etk::UString myDataString;
SearchData::GetSearch(myDataString);
BufferManager::Get(m_bufferID)->Search(myDataString, false, SearchData::GetCase(), SearchData::GetWrap(), SearchData::GetRegExp() );
}
break;
case APPL_MSG__CURRENT_REPLACE:
{
etk::UString myDataString;
SearchData::GetReplace(myDataString);
BufferManager::Get(m_bufferID)->Replace(myDataString);
}
break;
case APPL_MSG__CURRENT_REPLACE_ALL:
break;
case APPL_MSG__CURRENT_GOTO_LINE:
if (dataID<0) {
dataID = 0;

View File

@@ -63,7 +63,7 @@ class CodeView :public ewol::WidgetScrooled
color_ts m_textColorBg; //!< Background color
int32_t m_bufferID;
bool m_buttunOneSelected;
etk::VectorType<coord2D_ts> m_lineNumberList;
etk::VectorType<Vector2D<float> > m_lineNumberList;
void UpdateNumberOfLineReference(int32_t bufferID);
// drawing elements :
ewol::OObject2DTextColored m_OObjectTextNormal[NB_BOUBLE_BUFFER];
@@ -85,13 +85,14 @@ class CodeView :public ewol::WidgetScrooled
public:
/**
* @brief Event on an input of this Widget
* @param[in] type Type of the input (ewol::INPUT_TYPE_MOUSE/ewol::INPUT_TYPE_FINGER ...)
* @param[in] IdInput Id of the current Input (PC : left=1, right=2, middle=3, none=0 / Tactil : first finger=1 , second=2 (only on this widget, no knowledge at ouside finger))
* @param[in] typeEvent ewol type of event like EVENT_INPUT_TYPE_DOWN/EVENT_INPUT_TYPE_MOVE/EVENT_INPUT_TYPE_UP/EVENT_INPUT_TYPE_SINGLE/EVENT_INPUT_TYPE_DOUBLE/...
* @param[in] pos Absolute position of the event
* @return true the event is used
* @return false the event is not used
*/
virtual bool OnEventInput(int32_t IdInput, ewol::eventInputType_te typeEvent, coord2D_ts pos);
virtual bool OnEventInput(ewol::inputType_te type, int32_t IdInput, ewol::eventInputType_te typeEvent, Vector2D<float> pos);
virtual bool OnEventKb(ewol::eventKbType_te typeEvent, uniChar_t unicodeData);
virtual bool OnEventKbMove(ewol::eventKbType_te typeEvent, ewol::eventKbMoveType_te moveTypeEvent);

View File

@@ -28,6 +28,7 @@
#include <MainWindows.h>
#include <CodeView.h>
#include <BufferView.h>
#include <Search.h>
#include <ewol/widget/Button.h>
#include <ewol/widget/CheckBox.h>
@@ -47,12 +48,13 @@
#undef __class__
#define __class__ "MainWindows"
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS = "MainWindows";
extern const char * const TYPE_EOBJECT_EDN_MAIN_WINDOWS = __class__;
MainWindows::MainWindows(void)
{
APPL_DEBUG("CREATE WINDOWS ... ");
ewol::SizerVert * mySizerVert = NULL;
ewol::SizerVert * mySizerVert2 = NULL;
ewol::SizerHori * mySizerHori = NULL;
//ewol::Button * myButton = NULL;
CodeView * myCodeView = NULL;
@@ -124,25 +126,25 @@ MainWindows::MainWindows(void)
myBufferView->SetFillX(true);
myBufferView->SetFillY(true);
mySizerHori->SubWidgetAdd(myBufferView);
myCodeView = new CodeView();
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
/*
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "ubuntu/UbuntuMono-R.ttf");
myCodeView->SetFontNameBold( "ubuntu/UbuntuMono-B.ttf");
myCodeView->SetFontNameItalic( "ubuntu/UbuntuMono-RI.ttf");
myCodeView->SetFontNameBoldItalic("ubuntu/UbuntuMono-BI.ttf");
*/
mySizerHori->SubWidgetAdd(myCodeView);
mySizerVert2 = new ewol::SizerVert();
mySizerHori->SubWidgetAdd(mySizerVert2);
// search area :
Search * mySearch = new Search();
mySizerVert2->SubWidgetAdd(mySearch);
// main buffer Area :
myCodeView = new CodeView();
myCodeView->SetExpendX(true);
myCodeView->SetExpendY(true);
myCodeView->SetFillX(true);
myCodeView->SetFillY(true);
myCodeView->SetFontSize(11);
myCodeView->SetFontNameNormal( "freefont/FreeMono.ttf");
myCodeView->SetFontNameBold( "freefont/FreeMonoBold.ttf");
myCodeView->SetFontNameItalic( "freefont/FreeMonoOblique.ttf");
myCodeView->SetFontNameBoldItalic("freefont/FreeMonoBoldOblique.ttf");
mySizerVert2->SubWidgetAdd(myCodeView);
// Generic event ...
RegisterMultiCast(ednMsgGuiSaveAs);

View File

@@ -31,336 +31,195 @@
#include "MainWindows.h"
#include "appl/globalMsg.h"
#include <ewol/widget/Button.h>
#include <ewol/widget/ButtonImage.h>
#include <ewol/widget/CheckBox.h>
#include <ewol/widget/SizerHori.h>
#include <ewol/widget/SizerVert.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Entry.h>
#include <ewol/widget/List.h>
#include <ewol/widget/ContextMenu.h>
#include <ewol/widget/PopUp.h>
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Menu.h>
#include <ewol/widgetMeta/FileChooser.h>
#include <ewol/WidgetManager.h>
#include <ewol/EObject.h>
#undef __class__
#define __class__ "Search"
extern const char * const TYPE_EOBJECT_APPL_SEARCH = __class__;
const char* const l_eventSearchEntry = "appl-search-entry";
const char* const l_eventReplaceEntry = "appl-replace-entry";
const char* const l_eventSearchBt = "appl-search-button";
const char* const l_eventReplaceBt = "appl-replace-button";
const char* const l_eventCaseCb = "appl-case-sensitive-CheckBox";
const char* const l_eventWrapCb = "appl-wrap-CheckBox";
const char* const l_eventForwardCb = "appl-forward-CheckBox";
const char* const l_eventHideBt = "appl-hide-button";
Search::Search(void)
/*: m_localDialog(NULL),
m_searchLabel(NULL),
m_searchEntry(NULL),
m_replaceLabel(NULL),
m_replaceEntry(NULL),
m_CkMatchCase(NULL),
m_CkWrapAround(NULL) */
{
// nothing to do ...
m_forward = false;
ewol::Entry * myEntry = NULL;
ewol::ButtonImage * myButtonImage = NULL;
myEntry = new ewol::Entry();
myEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventSearchEntry);
myEntry->SetExpendX(true);
myEntry->SetFillX(true);
SubWidgetAdd(myEntry);
myButtonImage = new ewol::ButtonImage("icon/Search.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventSearchBt);
SubWidgetAdd(myButtonImage);
myEntry = new ewol::Entry();
myEntry->RegisterOnEvent(this, ewolEventEntryModify, l_eventReplaceEntry);
myEntry->SetExpendX(true);
myEntry->SetFillX(true);
SubWidgetAdd(myEntry);
myButtonImage = new ewol::ButtonImage("icon/Replace.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventReplaceBt);
SubWidgetAdd(myButtonImage);
myButtonImage = new ewol::ButtonImage("icon/CaseSensitive.svg");
myButtonImage->SetImageSelected("icon/CaseSensitive.svg", 0xFFFFFF5F);
myButtonImage->SetMinSize(32,32);
myButtonImage->SetToggleMode(true);
myButtonImage->SetValue(SearchData::GetCase());
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventCaseCb);
SubWidgetAdd(myButtonImage);
myButtonImage = new ewol::ButtonImage("icon/WrapAround.svg");
myButtonImage->SetImageSelected("icon/WrapAround.svg", 0xFFFFFF5F);
myButtonImage->SetMinSize(32,32);
myButtonImage->SetToggleMode(true);
myButtonImage->SetValue(SearchData::GetWrap());
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventWrapCb);
SubWidgetAdd(myButtonImage);
myButtonImage = new ewol::ButtonImage("icon/Up.svg");
myButtonImage->SetImageSelected("icon/Down.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->SetToggleMode(true);
myButtonImage->SetValue(m_forward);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventForwardCb);
SubWidgetAdd(myButtonImage);
myButtonImage = new ewol::ButtonImage("icon/Forbidden.svg");
myButtonImage->SetMinSize(32,32);
myButtonImage->RegisterOnEvent(this, ewolEventButtonPressed, l_eventHideBt);
SubWidgetAdd(myButtonImage);
RegisterMultiCast(ednMsgGuiSearch);
// basicly hiden ...
Hide();
}
Search::~Search(void)
{
/*
if (NULL!=m_localDialog) {
gtk_widget_hide(m_localDialog);
gtk_widget_destroy(m_localDialog);
m_localDialog = NULL;
}
*/
}
/*
void Search::Display(GtkWindow *parent)
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool Search::CheckObjectType(const char * const objectType)
{
if(NULL == m_localDialog) {
m_localDialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// set dialog not resisable
gtk_window_set_resizable(GTK_WINDOW(m_localDialog), FALSE);
// set the windows alwais on top of every all system windows
//gtk_window_set_keep_above(GTK_WINDOW(m_localDialog), TRUE);
// Set the dialog on top of the selected windows
gtk_window_set_transient_for(GTK_WINDOW(m_localDialog), parent);
// set the dialog on the top right
gtk_window_set_gravity(GTK_WINDOW(m_localDialog), GDK_GRAVITY_NORTH_EAST);
// Remove the dialogue from the task bar
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(m_localDialog), TRUE);
// this element did not apear in the miniature of the windows
gtk_window_set_skip_pager_hint(GTK_WINDOW(m_localDialog), TRUE);
// select the program icone
//gtk_window_set_default_icon_name("Replace");
// set default title :
gtk_window_set_title(GTK_WINDOW(m_localDialog), "Search / Replace");
// Default size open windows
//gtk_window_set_default_size(GTK_WINDOW(m_localDialog), 300, 400);
// enable the close signal of the windows
g_signal_connect(G_OBJECT(m_localDialog), "destroy", G_CALLBACK(OnButtonQuit), this);
// Create a vertical box for stacking the menu and editor widgets in.
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER(m_localDialog), vbox);
// Set key Accelerator :
//AccelKey::getInstance()->LinkCommonAccel(GTK_WINDOW(m_localDialog));
// **********************************************************
// * Search Entry
// **********************************************************
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// search label
m_searchLabel = gtk_label_new("Search ");
gtk_box_pack_start(GTK_BOX(hbox), m_searchLabel, FALSE, TRUE, 0);
// Search entry
m_searchEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox), m_searchEntry, TRUE, TRUE, 0);
// Connect signals :
g_signal_connect(G_OBJECT(m_searchEntry), "activate", G_CALLBACK(OnButtonNext), this);
g_signal_connect(G_OBJECT(m_searchEntry), "changed", G_CALLBACK(OnEntrySearchChange), this);
}
// **********************************************************
// * Replace Entry
// **********************************************************
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// search label
m_replaceLabel = gtk_label_new("Replace");
gtk_box_pack_start(GTK_BOX(hbox), m_replaceLabel, FALSE, TRUE, 0);
// Search entry
m_replaceEntry = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox), m_replaceEntry, TRUE, TRUE, 0);
// Connect signals :
g_signal_connect(G_OBJECT(m_replaceEntry), "changed", G_CALLBACK(OnEntryReplaceChange), this);
}
// **********************************************************
// * mode Selection
// **********************************************************
m_CkMatchCase = gtk_check_button_new_with_label("Case Sensitive");
gtk_container_add(GTK_CONTAINER (vbox), m_CkMatchCase);
m_CkWrapAround = gtk_check_button_new_with_label("Wrap arround");
gtk_container_add(GTK_CONTAINER (vbox), m_CkWrapAround);
m_CkRegularExpression = gtk_check_button_new_with_label("Regular Expression");
gtk_container_add(GTK_CONTAINER (vbox), m_CkRegularExpression);
// connect signals :
g_signal_connect(G_OBJECT(m_CkMatchCase), "activate", G_CALLBACK(OnCheckBoxEventCase), this);
g_signal_connect(G_OBJECT(m_CkMatchCase), "clicked", G_CALLBACK(OnCheckBoxEventCase), this);
g_signal_connect(G_OBJECT(m_CkWrapAround), "activate", G_CALLBACK(OnCheckBoxEventWrap), this);
g_signal_connect(G_OBJECT(m_CkWrapAround), "clicked", G_CALLBACK(OnCheckBoxEventWrap), this);
g_signal_connect(G_OBJECT(m_CkRegularExpression), "activate", G_CALLBACK(OnCheckBoxEventRegExp), this);
g_signal_connect(G_OBJECT(m_CkRegularExpression), "clicked", G_CALLBACK(OnCheckBoxEventRegExp), this);
// **********************************************************
// * Search / Replace button
// **********************************************************
{
GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add(GTK_CONTAINER (vbox), hbox);
// Find previous
m_BtPrevious = gtk_button_new_with_label("Previous");
gtk_container_add(GTK_CONTAINER (hbox), m_BtPrevious);
// Find Next
m_BtNext = gtk_button_new_with_label("Next");
gtk_container_add(GTK_CONTAINER (hbox), m_BtNext);
// Replace
m_BtReplace = gtk_button_new_with_label("Replace");
gtk_container_add(GTK_CONTAINER (hbox), m_BtReplace);
// Replace & next
m_BtReplaceAndNext = gtk_button_new_with_label("Replace & Find");
gtk_container_add(GTK_CONTAINER (hbox), m_BtReplaceAndNext);
// Exit
m_BtQuit = gtk_button_new_with_label("Close");
gtk_container_add(GTK_CONTAINER (hbox), m_BtQuit);
// Connect signals :
g_signal_connect(G_OBJECT(m_BtPrevious), "activate", G_CALLBACK(OnButtonPrevious), this);
g_signal_connect(G_OBJECT(m_BtPrevious), "released", G_CALLBACK(OnButtonPrevious), this);
g_signal_connect(G_OBJECT(m_BtNext), "activate", G_CALLBACK(OnButtonNext), this);
g_signal_connect(G_OBJECT(m_BtNext), "released", G_CALLBACK(OnButtonNext), this);
g_signal_connect(G_OBJECT(m_BtReplace), "activate", G_CALLBACK(OnButtonReplace), this);
g_signal_connect(G_OBJECT(m_BtReplace), "released", G_CALLBACK(OnButtonReplace), this);
g_signal_connect(G_OBJECT(m_BtReplaceAndNext), "activate", G_CALLBACK(OnButtonReplaceAndNext), this);
g_signal_connect(G_OBJECT(m_BtReplaceAndNext), "released", G_CALLBACK(OnButtonReplaceAndNext), this);
g_signal_connect(G_OBJECT(m_BtQuit), "activate", G_CALLBACK(OnButtonQuit), this);
g_signal_connect(G_OBJECT(m_BtQuit), "released", G_CALLBACK(OnButtonQuit), this);
}
// recursive version of gtk_widget_show
gtk_widget_show_all(m_localDialog);
if (NULL == objectType) {
APPL_ERROR("check error : \"" << TYPE_EOBJECT_APPL_SEARCH << "\" != NULL(pointer) ");
return false;
}
if(NULL == m_localDialog) {
APPL_ERROR("No search-dialog instance");
if (objectType == TYPE_EOBJECT_APPL_SEARCH) {
return true;
} else {
// update datas :
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkWrapAround), SearchData::GetWrap());
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkMatchCase), SearchData::GetCase());
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_CkRegularExpression), SearchData::GetRegExp());
if (true == SearchData::GetRegExp()) {
gtk_widget_set_sensitive(m_CkMatchCase, false);
} else {
gtk_widget_set_sensitive(m_CkMatchCase, true);
if(true == ewol::SizerHori::CheckObjectType(objectType)) {
return true;
}
// Remove data form the search
etk::UString myDataString = "";
SearchData::SetSearch(myDataString);
gtk_entry_set_text(GTK_ENTRY(m_searchEntry), myDataString.c_str());
if (0 == strlen(myDataString.c_str())) {
m_haveSearchData = false;
APPL_ERROR("check error : \"" << TYPE_EOBJECT_APPL_SEARCH << "\" != \"" << objectType << "\"");
return false;
}
}
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const Search::GetObjectType(void)
{
return TYPE_EOBJECT_APPL_SEARCH;
}
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
void Search::OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data)
{
ewol::SizerHori::OnReceiveMessage(CallerObject, eventId, data);
//APPL_INFO("Search receive message : \"" << eventId << "\" data=\"" << data << "\"");
if ( eventId == l_eventSearchEntry) {
SearchData::SetSearch(data);
} else if ( eventId == l_eventReplaceEntry) {
SearchData::SetReplace(data);
} else if ( eventId == l_eventSearchBt) {
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
m_haveSearchData = true;
SendMultiCast(ednMsgGuiFind, "Next");
}
SearchData::GetReplace(myDataString);
gtk_entry_set_text(GTK_ENTRY(m_replaceEntry), myDataString.c_str());
if (0 == strlen(myDataString.c_str())) {
m_haveReplaceData = false;
} else if ( eventId == l_eventReplaceBt) {
SendMultiCast(ednMsgGuiReplace, "Normal");
if (true==m_forward) {
SendMultiCast(ednMsgGuiFind, "Previous");
} else {
m_haveReplaceData = true;
SendMultiCast(ednMsgGuiFind, "Next");
}
gtk_widget_set_sensitive(m_BtPrevious, m_haveSearchData);
gtk_widget_set_sensitive(m_BtNext, m_haveSearchData);
// basic no search data
gtk_widget_set_sensitive(m_BtReplace, false);
gtk_widget_set_sensitive(m_BtReplaceAndNext, false);
// set focus on a specific widget :
//gtk_window_set_focus(parent, m_searchEntry);
gtk_widget_grab_focus(m_searchEntry);
// display the dialogue box
gtk_widget_show_all(m_localDialog);
// hide regular expression
gtk_widget_hide(m_CkRegularExpression);
}
}
*/
void Search::Destroy(void)
{
/*
if (NULL!=m_localDialog) {
gtk_widget_destroy(m_localDialog);
m_localDialog = NULL;
}
*/
}
void Search::Hide(void)
{
//gtk_widget_hide(m_localDialog);
}
/*
void Search::OnButtonPrevious(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_FIND_PREVIOUS);
}
void Search::OnButtonNext(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_FIND_NEXT);
}
void Search::OnButtonReplace(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_REPLACE);
}
void Search::OnButtonReplaceAndNext(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
GeneralSendMessage(APPL_MSG__CURRENT_REPLACE);
GeneralSendMessage(APPL_MSG__CURRENT_FIND_NEXT);
}
void Search::OnButtonQuit(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
self->Destroy();
}
void Search::OnCheckBoxEventWrap(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetWrap(true);
} else {
SearchData::SetWrap(false);
}
}
void Search::OnCheckBoxEventCase(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetCase(true);
} else {
SearchData::SetCase(false);
}
}
void Search::OnCheckBoxEventRegExp(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
SearchData::SetRegExp(true);
gtk_widget_set_sensitive(self->m_CkMatchCase, false);
} else {
SearchData::SetRegExp(false);
gtk_widget_set_sensitive(self->m_CkMatchCase, true);
}
}
void Search::OnEntrySearchChange(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
// update research data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
etk::UString myDataString = testData;
SearchData::SetSearch(myDataString);
if (0 == strlen(testData)) {
self->m_haveSearchData = false;
} else if ( eventId == l_eventCaseCb) {
if (data == "true") {
SearchData::SetCase(true);
} else {
self->m_haveSearchData = true;
SearchData::SetCase(false);
}
gtk_widget_set_sensitive(self->m_BtPrevious, self->m_haveSearchData);
gtk_widget_set_sensitive(self->m_BtNext, self->m_haveSearchData);
if (false == self->m_haveSearchData) {
gtk_widget_set_sensitive(self->m_BtReplace, false);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
} else if ( eventId == l_eventWrapCb) {
if (data == "true") {
SearchData::SetWrap(true);
} else {
gtk_widget_set_sensitive(self->m_BtReplace, true);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, true);
SearchData::SetWrap(false);
}
} else if ( eventId == l_eventForwardCb) {
if (data == "true") {
m_forward = true;
} else {
m_forward = false;
}
} else if ( eventId == l_eventHideBt) {
Hide();
} else if ( eventId == ednMsgGuiSearch) {
if (true == IsHide()) {
Show();
} else {
Hide();
}
}
}
void Search::OnEntryReplaceChange(GtkWidget *widget, gpointer data)
{
//APPL_INFO("CALLBACK");
Search * self = static_cast<Search*>(data);
// update replace data
const char *testData = gtk_entry_get_text(GTK_ENTRY(widget));
if (NULL != testData) {
etk::UString myDataString = testData;
SearchData::SetReplace(myDataString);
if (0 == strlen(testData)) {
self->m_haveReplaceData = false;
} else {
self->m_haveReplaceData = true;
}
if (false == self->m_haveSearchData) {
gtk_widget_set_sensitive(self->m_BtReplace, false);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, false);
} else {
gtk_widget_set_sensitive(self->m_BtReplace, true);
gtk_widget_set_sensitive(self->m_BtReplaceAndNext, true);
}
}
}
*/

View File

@@ -27,54 +27,43 @@
#define __SEARCH_H__
#include <appl/Debug.h>
#include <ewol/widget/SizerHori.h>
extern const char * const TYPE_EOBJECT_APPL_SEARCH;
class Search
class Search : public ewol::SizerHori
{
public:
// Constructeur
Search(void);
~Search(void);
public:
void Destroy(void);
//void Display(GtkWindow *parent);
void Hide(void);
/*
/**
* @brief Check if the object has the specific type.
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type of the object we want to check
* @return true if the object is compatible, otherwise false
*/
bool CheckObjectType(const char * const objectType);
/**
* @brief Get the current Object type of the EObject
* @note In Embended platforme, it is many time no -rtti flag, then it is not possible to use dynamic cast ==> this will replace it
* @param[in] objectType type description
* @return true if the object is compatible, otherwise false
*/
const char * const GetObjectType(void);
/**
* @brief Receive a message from an other EObject with a specific eventId and data
* @param[in] CallerObject Pointer on the EObject that information came from
* @param[in] eventId Message registered by this class
* @param[in] data Data registered by this class
* @return ---
*/
virtual void OnReceiveMessage(ewol::EObject * CallerObject, const char * eventId, etk::UString data);
private:
GtkWidget * m_localDialog; //!< local dialog element
// entry
GtkWidget * m_searchLabel; //!< gtk label of the search section
GtkWidget * m_searchEntry; //!< gtk entry of the search section
GtkWidget * m_replaceLabel; //!< gtk label of the replace section
GtkWidget * m_replaceEntry; //!< gtk entry of the replace section
// checkbox
GtkWidget * m_CkMatchCase; //!< tick of the case matching
GtkWidget * m_CkWrapAround; //!< tick of the wrap the file
GtkWidget * m_CkRegularExpression; //!< the test is a regular expression
// button
GtkWidget * m_BtPrevious; //!< Button Previous
GtkWidget * m_BtNext; //!< Button Next
GtkWidget * m_BtReplace; //!< Button Replace
GtkWidget * m_BtReplaceAndNext; //!< Button Replace and find next
GtkWidget * m_BtQuit; //!< Button Quit
bool m_haveSearchData;
bool m_haveReplaceData;
// CallBack for GTK+ gui
private :
static void OnButtonPrevious(GtkWidget *widget, gpointer user_data);
static void OnButtonNext(GtkWidget *widget, gpointer user_data);
static void OnButtonReplace(GtkWidget *widget, gpointer user_data);
static void OnButtonReplaceAndNext(GtkWidget *widget, gpointer user_data);
static void OnButtonQuit(GtkWidget *widget, gpointer user_data);
static void OnCheckBoxEventCase(GtkWidget *widget, gpointer user_data);
static void OnCheckBoxEventWrap(GtkWidget *widget, gpointer user_data);
static void OnCheckBoxEventRegExp(GtkWidget *widget, gpointer user_data);
static void OnEntrySearchChange(GtkWidget *widget, gpointer user_data);
static void OnEntryReplaceChange(GtkWidget *widget, gpointer user_data);
*/
bool m_forward;
};
#define EDN_CAST_APPL_SEARCH(curentPointer) EWOL_CAST(TYPE_EOBJECT_APPL_SEARCH,Search,curentPointer)
#endif

View File

@@ -174,6 +174,14 @@ class localClassHighlightManager: public ewol::EObject
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_lua.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
xmlFilename = "lang_in.xml";
myHightline = new Highlight(xmlFilename);
listHighlight.PushBack(myHightline);
//myHightline->Display();
}

View File

@@ -93,7 +93,7 @@ etk::UString CTagsManager::GetFolder(etk::UString &inputString)
return out;
}
bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y)
bool CTagsManager::OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y)
{
/*
switch (id)
@@ -348,7 +348,7 @@ void CTagsManager::JumpTo(void)
// get the middle button of the clipboard ==> represent the current selection ...
ClipBoard::Get(COPY_MIDDLE_BUTTON, data);
if (data.Size() == 0) {
APPL_INFO("No current S<EFBFBD>lection");
APPL_INFO("No current S\E9lection");
}
tagEntry entry;
data.PushBack('\0');

View File

@@ -50,7 +50,7 @@ class CTagsManager: public etk::Singleton<CTagsManager>, public ewol::Widget
~CTagsManager(void);
public:
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, etkFloat_t x, etkFloat_t y);
virtual bool OnEventAreaExternal(int32_t widgetID, const char * generateEventId, const char * eventExternId, float x, float y);
private:
int32_t m_currentSelectedID;
void LoadTagFile(void);

View File

@@ -45,7 +45,7 @@
extern const char* const ednMsgGuiGotoLine; // data : "???" / "1" ... "999999999999"
extern const char* const ednMsgGuiSearch; // data : ""
extern const char* const ednMsgGuiReplace; // data : ""
extern const char* const ednMsgGuiReplace; // data : "Normal" "All"
extern const char* const ednMsgGuiFind; // data : "Next" "Previous" "All" "None"
extern const char* const ednMsgGuiChangeColor; // data : "Black" "White"

View File

@@ -63,27 +63,9 @@ void APP_Init(void)
#endif
#endif
ewol::ChangeSize(800, 600);
etk::InitDefaultFolder(PROJECT_NAME);
char cCurrentPath[FILENAME_MAX];
// set the default Path of the application :
#ifdef __PLATFORM__Linux
etk::UString homedir;
#ifdef MODE_RELEASE
homedir = "/usr/share/"PROJECT_NAME"/";
#else
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
homedir = "./assets/";
} else {
cCurrentPath[FILENAME_MAX - 1] = '\0';
homedir = cCurrentPath;
homedir += "/assets/";
}
#endif
// TODO : Remove the Utf8Data
etk::SetBaseFolderData(homedir.Utf8Data());
etk::SetBaseFolderDataUser("~/."PROJECT_NAME"/");
etk::SetBaseFolderCache("/tmp/"PROJECT_NAME"/");
#endif
ewol::SetFontFolder("Font");
#ifdef __PLATFORM__Android
@@ -109,7 +91,7 @@ void APP_Init(void)
HighlightManager::Init();
HighlightManager::loadLanguages();
char cCurrentPath[FILENAME_MAX];
// get the curent program folder
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return ;
@@ -151,6 +133,8 @@ void APP_Init(void)
ewol::shortCut::Add("ctrl+l", ednMsgGuiGotoLine, "???");
ewol::shortCut::Add("ctrl+f", ednMsgGuiSearch, "");
// add files
APPL_INFO("show list of files : ");