Replaces some C-style arrays with std::array

This commit is contained in:
Markus Gans 2020-10-04 00:59:21 +02:00
parent 61d88eb413
commit a821030333
123 changed files with 1830 additions and 1761 deletions

View File

@ -1,3 +1,8 @@
2020-10-04 Markus Gans <guru.mail@muenster.de>
* Replaces some C-style arrays with std::array
* Now you can use the arrow keys to move a window into the visible area
* Removes FData memory leak in FListBoxItem and FListViewItem
2020-09-27 Markus Gans <guru.mail@muenster.de> 2020-09-27 Markus Gans <guru.mail@muenster.de>
* An explanation of the widget tree was added to the document * An explanation of the widget tree was added to the document
of the first steps of the first steps

View File

@ -5,41 +5,13 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"
xmlns="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"
id="svg61"
version="1.1"
width="149.86537mm"
viewBox="0 0 149.86537 65.484895"
height="65.484894mm" height="65.484894mm"
sodipodi:docname="final-cut-widget tree.svg" viewBox="0 0 149.86537 65.484895"
inkscape:version="0.92.1 r15371"> width="149.86537mm"
<sodipodi:namedview version="1.1"
pagecolor="#ffffff" id="svg109">
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3840"
inkscape:window-height="1984"
id="namedview67"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="4.5793919"
inkscape:cx="296"
inkscape:cy="123.75099"
inkscape:window-x="0"
inkscape:window-y="55"
inkscape:window-maximized="1"
inkscape:current-layer="svg61" />
<metadata <metadata
id="metadata67"> id="metadata115">
<rdf:RDF> <rdf:RDF>
<cc:Work <cc:Work
rdf:about=""> rdf:about="">
@ -51,364 +23,302 @@
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
<defs <defs
id="defs65"> id="defs113" />
<marker <marker
style="overflow:visible" id="a"
id="Arrow1Mend" orient="auto"
refX="0" overflow="visible"
refY="0" refX="0"
orient="auto"> refY="0">
<path <path
transform="matrix(-0.4,0,0,-0.4,-4,0)" d="m0 0 5-5-17.5 5 17.5 5z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" fill-rule="evenodd"
d="M 0,0 5,-5 -12.5,0 5,5 Z" stroke="#000"
id="path4659" stroke-width="1pt"
inkscape:connector-curvature="0" /> transform="matrix(-.4 0 0 -.4 -4 0)"
</marker> id="path2" />
<marker </marker>
style="overflow:visible" <marker
id="Arrow2Lend" id="b"
refX="0" orient="auto"
refY="0" overflow="visible"
orient="auto"> refX="0"
<path refY="0">
transform="matrix(-1.1,0,0,-1.1,-1.1,0)" <path
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" d="m0 0 5-5-17.5 5 17.5 5z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" fill-rule="evenodd"
id="path4671" stroke="#000"
inkscape:connector-curvature="0" /> stroke-width="1pt"
</marker> transform="matrix(-.4 0 0 -.4 -4 0)"
<marker id="path5" />
style="overflow:visible" </marker>
id="Arrow1Lstart" <marker
refX="0" id="c"
refY="0" orient="auto"
orient="auto"> overflow="visible"
<path refX="0"
transform="matrix(0.8,0,0,0.8,10,0)" refY="0">
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" <path
d="M 0,0 5,-5 -12.5,0 5,5 Z" d="m0 0 5-5-17.5 5 17.5 5z"
id="path4650" fill-rule="evenodd"
inkscape:connector-curvature="0" /> stroke="#000"
</marker> stroke-width="1pt"
<marker transform="matrix(-.4 0 0 -.4 -4 0)"
style="overflow:visible" id="path8" />
id="Arrow1Mend-9" </marker>
refX="0" <marker
refY="0" id="d"
orient="auto"> orient="auto"
<path overflow="visible"
transform="matrix(-0.4,0,0,-0.4,-4,0)" refX="0"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" refY="0">
d="M 0,0 5,-5 -12.5,0 5,5 Z" <path
id="path4659-6" d="m0 0 5-5-17.5 5 17.5 5z"
inkscape:connector-curvature="0" /> fill-rule="evenodd"
</marker> stroke="#000"
<marker stroke-width="1pt"
style="overflow:visible" transform="matrix(-.4 0 0 -.4 -4 0)"
id="Arrow1Mend-9-7" id="path11" />
refX="0" </marker>
refY="0" <marker
orient="auto"> id="e"
<path orient="auto"
transform="matrix(-0.4,0,0,-0.4,-4,0)" overflow="visible"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" refX="0"
d="M 0,0 5,-5 -12.5,0 5,5 Z" refY="0">
id="path4659-6-0" <path
inkscape:connector-curvature="0" /> d="m0 0 5-5-17.5 5 17.5 5z"
</marker> fill-rule="evenodd"
<marker stroke="#000"
style="overflow:visible" stroke-width="1pt"
id="Arrow1Mend-9-7-1" transform="matrix(-.4 0 0 -.4 -4 0)"
refX="0" id="path14" />
refY="0" </marker>
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path4659-6-0-3"
inkscape:connector-curvature="0" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Mend-9-7-1-7"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path4659-6-0-3-2"
inkscape:connector-curvature="0" />
</marker>
</defs>
<linearGradient
y2="222.78156"
y1="296.49637"
x2="34.111275"
x1="33.698196"
gradientUnits="userSpaceOnUse"
id="a">
<stop
style="stop-color:#e8a7a7;stop-opacity:1"
id="stop2"
stop-color="#dbdbdc"
offset="0" />
<stop
id="stop4"
stop-color="#fff"
offset="1" />
</linearGradient>
<g <g
id="g59" style="stroke-width:1.20796704"
transform="matrix(0.82806766,0,0,0.82760652,18.811674,-210.24741)" id="g57">
style="stroke-width:1.20796716"> <g
<rect transform="matrix(0.82806766,0,0,0.82760652,18.811674,-210.24741)"
y="254.29825" id="g23">
x="7.8681464" <path
height="10.661442" style="fill:#f9f9f9;stroke:#000000;stroke-width:0.51105303;stroke-linecap:round;stroke-linejoin:round"
width="57.783382" d="m 7.868146,254.29825 h 57.783382 v 10.66144 H 7.868146 Z"
id="rect4522" id="path17" />
style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.5110532;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> <text
<text style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
id="text47"
y="261.55215"
x="37.113487"
style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0">
<tspan
y="261.55215"
x="37.113487" x="37.113487"
id="tspan4512" y="261.55215"
style="stroke-width:0.51097012">FApplication</tspan> id="text21">
</text> <tspan
</g> style="stroke-width:0.51097"
<g x="37.113487"
transform="matrix(0.82806766,0,0,0.82760652,25.151866,-0.20330766)" y="261.55215"
id="g4560" id="tspan19">FApplication</tspan>
style="stroke-width:1.20796716"> </text>
<rect </g>
y="19.022009" <g
x="15.875" transform="matrix(0.82806766,0,0,0.82760652,25.151866,-0.203308)"
height="10.661442" id="g31">
width="26.458334" <path
id="rect4522-3" style="fill:#f9f9f9;stroke:#000000;stroke-width:0.51105303;stroke-linecap:round;stroke-linejoin:round"
style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.51105309;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> d="M 15.875,19.022009 H 42.333334 V 29.683451 H 15.875 Z"
<text id="path25" />
id="text47-6" <text
y="26.275915" style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
x="29.24534"
style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0">
<tspan
id="tspan4555"
x="29.24534" x="29.24534"
y="26.275915" y="26.275915"
style="stroke-width:0.51097012">FDialog</tspan> id="text29">
</text> <tspan
</g> style="stroke-width:0.51097"
<g x="29.24534"
id="g4560-9" y="26.275915"
transform="matrix(0.82806766,0,0,0.82760652,38.120716,15.124655)" id="tspan27">FDialog</tspan>
style="stroke-width:1.20796716"> </text>
<rect </g>
y="19.022009" <g
x="15.875" transform="matrix(0.82806766,0,0,0.82760652,38.120716,15.124655)"
height="10.661442" id="g39">
width="26.458334" <path
id="rect4522-3-7" style="fill:#f9f9f9;stroke:#000000;stroke-width:0.51105303;stroke-linecap:round;stroke-linejoin:round"
style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.51105309;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> d="M 15.875,19.022009 H 42.333334 V 29.683451 H 15.875 Z"
<text id="path33" />
id="text47-6-3" <text
y="26.275915" style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
x="29.24534"
style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0">
<tspan
id="tspan4555-5"
x="29.24534" x="29.24534"
y="26.275915" y="26.275915"
style="stroke-width:0.51097012">FDialog</tspan> id="text37">
</text> <tspan
</g> style="stroke-width:0.51097"
<g x="29.24534"
id="g4560-9-0" y="26.275915"
transform="matrix(0.82806766,0,0,0.82760652,12.006292,15.124655)" id="tspan35">FDialog</tspan>
style="stroke-width:1.20796716"> </text>
<rect </g>
y="19.022009" <g
x="15.875" transform="matrix(0.82806766,0,0,0.82760652,12.006292,15.124655)"
height="10.661442" id="g47">
width="26.458334" <path
id="rect4522-3-7-9" style="fill:#f9f9f9;stroke:#000000;stroke-width:0.51105303;stroke-linecap:round;stroke-linejoin:round"
style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.51105309;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> d="M 15.875,19.022009 H 42.333334 V 29.683451 H 15.875 Z"
<text id="path41" />
id="text47-6-3-8" <text
y="26.275915" style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
x="29.24534"
style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0">
<tspan
y="26.275915"
x="29.24534" x="29.24534"
id="tspan4610" y="26.275915"
style="stroke-width:0.51097012">FLabel</tspan> id="text45">
</text> <tspan
</g> style="stroke-width:0.51097"
<g x="29.24534"
transform="matrix(0.82806766,0,0,0.82760652,25.151866,-0.20330766)" y="26.275915"
id="g6273" id="tspan43">FLabel</tspan>
style="stroke-width:1.20796716"> </text>
<rect </g>
y="56.063679" <g
x="31.75" transform="matrix(0.82806766,0,0,0.82760652,25.151866,-0.203308)"
height="10.661442" id="g55">
width="26.458334" <path
id="rect4522-3-7-8" style="fill:#f9f9f9;stroke:#000000;stroke-width:0.51105303;stroke-linecap:round;stroke-linejoin:round"
style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.51105309;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal" /> d="M 31.75,56.063679 H 58.208334 V 66.725121 H 31.75 Z"
<text id="path49" />
id="text47-6-3-6" <text
y="63.317585" style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
x="45.120338"
style="font-weight:bold;font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0">
<tspan
id="tspan4555-5-2"
x="45.120338" x="45.120338"
y="63.317585" y="63.317585"
style="stroke-width:0.51097012">FButton</tspan> id="text53">
</text> <tspan
style="stroke-width:0.51097"
x="45.120338"
y="63.317585"
id="tspan51">FListBox</tspan>
</text>
</g>
</g> </g>
<text <text
style="font-style:italic;font-weight:bold;font-size:4.08859491px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.42300001;stroke-opacity:0" style="font-style:italic;font-weight:bold;font-size:4.08859491px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.42300001;stroke-opacity:0"
transform="scale(1.0002786,0.99972148)"
x="62.287796" x="62.287796"
y="65.409096" y="65.409096"
id="text47-6-3-6-5" id="text61">
transform="scale(1.0002786,0.99972148)">
<tspan <tspan
style="stroke-width:0.42300001"
y="65.409096"
x="62.287796" x="62.287796"
id="tspan4555-5-2-2">etc.</tspan> y="65.409096"
id="tspan59">etc.</tspan>
</text> </text>
<path <path
id="path4648" d="m49.251306 9.2100164v5.7870836"
d="M 49.251306,9.2100164 V 14.9971" fill="none"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.42306879;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend)" marker-end="url(#a)"
inkscape:connector-curvature="0" /> stroke="#000"
stroke-width=".423069"
id="path63" />
<path <path
id="path4648-0" d="m42.679299 24.537976v5.779196"
d="m 42.679299,24.537976 v 5.779196" fill="none"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.42306873;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-9)" marker-end="url(#b)"
inkscape:connector-curvature="0" /> stroke="#000"
stroke-width=".423069"
id="path65" />
<path <path
id="path4648-0-0" d="m55.736511 24.537898v5.779196"
d="m 55.736511,24.537898 v 5.779196" fill="none"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.42306867;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-9-7)" marker-end="url(#c)"
inkscape:connector-curvature="0" /> stroke="#000"
stroke-width=".423069"
id="path67" />
<path <path
id="path4648-0-0-7" d="m62.369882 39.865938v5.548839"
d="m 62.369882,39.865938 v 5.548839" fill="none"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.42306867;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-9-7-1)" marker-end="url(#d)"
inkscape:connector-curvature="0" /> stroke="#000"
stroke-width=".423069"
id="path69" />
<path <path
id="path4648-0-0-7-6" d="m62.369882 55.193909v5.548839"
d="m 62.369882,55.193909 v 5.548839" fill="none"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.42306867;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Mend-9-7-1-7)" marker-end="url(#e)"
inkscape:connector-curvature="0" /> stroke="#000"
stroke-width=".423069"
id="path71" />
<g <g
transform="matrix(0.82806766,0,0,0.82760652,25.151866,-0.20330766)" style="font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
id="level" transform="matrix(0.82806766,0,0,0.82760652,25.151866,-0.203308)"
style="stroke-width:1.20796716"> id="g89">
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="-23.01368" x="-23.01368"
y="8.7182531" y="8.7182531"
id="text47-7"> id="text75">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1"
x="-23.01368" x="-23.01368"
y="8.7182531">Parent:</tspan> y="8.7182531"
id="tspan73">Parent:</tspan>
</text> </text>
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="-24.412582" x="-24.412582"
y="27.239086" y="27.239086"
id="text47-7-2"> id="text79">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-2"
x="-24.412582" x="-24.412582"
y="27.239086">Child:</tspan> y="27.239086"
id="tspan77">Child:</tspan>
</text> </text>
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="-20.59841" x="-20.59841"
y="44.796837" y="44.796837"
id="text47-7-0"> id="text83">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-21"
x="-20.59841" x="-20.59841"
y="44.796837">Subchild:</tspan> y="44.796837"
id="tspan81">Subchild:</tspan>
</text> </text>
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="-15.852447" x="-15.852447"
y="63.317669" y="63.317669"
id="text47-7-7"> id="text87">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-5"
x="-15.852447" x="-15.852447"
y="63.317669">Sub-subchild:</tspan> y="63.317669"
id="tspan85">Sub-subchild:</tspan>
</text> </text>
</g> </g>
<g <g
id="level-7" style="font-size:4.93888903px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;letter-spacing:0;word-spacing:0;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097;stroke-opacity:0"
transform="matrix(0.82806766,0,0,0.82760652,107.7173,-0.20330766)" transform="matrix(0.82806766,0,0,0.82760652,107.7173,-0.203308)"
style="stroke-width:1.20796716"> id="g107">
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0" x="-5.0208001"
x="-5.0207996"
y="8.7182531" y="8.7182531"
id="text47-7-4"> id="text93">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-1"
x="-5.0208001" x="-5.0208001"
y="8.7182531">Application widget (= 1)</tspan> y="8.7182531"
id="tspan91">Application widget (= 1)</tspan>
</text> </text>
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="-12.021867" x="-12.021867"
y="27.239086" y="27.239086"
id="text47-7-2-7"> id="text97">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-2-1"
x="-12.021868" x="-12.021868"
y="27.239086">Main widget (= 1)</tspan> y="27.239086"
id="tspan95">Main widget (= 1)</tspan>
</text> </text>
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="5.9180651" x="5.9180651"
y="44.796837" y="44.796837"
id="text47-7-0-1"> id="text101">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-21-1"
x="5.918066" x="5.918066"
y="44.796837">Widget(s) of the main widget (≥ 0)</tspan> y="44.796837"
id="tspan99">Widget(s) of the main widget (≥ 0)</tspan>
</text> </text>
<text <text
style="font-weight:normal;font-size:4.93888855px;font-family:FreeSans, Arial, 'Bitstream Vera Sans', 'DejaVu Sans', 'Open Sans', sans-serif;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:left;letter-spacing:0;word-spacing:0;writing-mode:lr-tb;text-anchor:middle;fill:#1a1a1a;stroke-width:0.51097012;stroke-opacity:0"
x="10.413227" x="10.413227"
y="63.317669" y="63.317669"
id="text47-7-7-7"> id="text105">
<tspan <tspan
style="stroke-width:0.51097012"
id="tspan4512-1-5-0"
x="10.413226" x="10.413226"
y="63.317669">Widget(s) from the parent widget (≥ 0)</tspan> y="63.317669"
id="tspan103">Widget(s) from the parent widget (≥ 0)</tspan>
</text> </text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -27,7 +27,7 @@ class myWidgetColors final : public finalcut::FWidgetColors
~myWidgetColors() override ~myWidgetColors() override
{ } { }
const finalcut::FString getClassName() const override finalcut::FString getClassName() const override
{ {
return "myWidgetColors"; return "myWidgetColors";
} }
@ -68,7 +68,7 @@ class BeeColorTheme final : public finalcut::FWidgetColors
~BeeColorTheme() override ~BeeColorTheme() override
{ } { }
const finalcut::FString getClassName() const override finalcut::FString getClassName() const override
{ {
return "BeeColorTheme"; return "BeeColorTheme";
} }
@ -216,7 +216,7 @@ class myColorPalette final : public finalcut::FColorPalette
~myColorPalette() ~myColorPalette()
{ } { }
const finalcut::FString getClassName() const override finalcut::FString getClassName() const override
{ {
return "myColorPalette"; return "myColorPalette";
} }
@ -299,7 +299,7 @@ class BeeColorPalette final : public finalcut::FColorPalette
~BeeColorPalette() ~BeeColorPalette()
{ } { }
const finalcut::FString getClassName() const override finalcut::FString getClassName() const override
{ {
return "BeeColorPalette"; return "BeeColorPalette";
} }

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <map> #include <map>
#include <vector> #include <vector>
@ -39,9 +40,6 @@ using finalcut::FSize;
class SegmentView final : public finalcut::FDialog class SegmentView final : public finalcut::FDialog
{ {
public: public:
// Using-declaration
using FDialog::setGeometry;
// Constructor // Constructor
explicit SegmentView (finalcut::FWidget* = nullptr); explicit SegmentView (finalcut::FWidget* = nullptr);
@ -64,10 +62,9 @@ class SegmentView final : public finalcut::FDialog
void get7Segment (const wchar_t); void get7Segment (const wchar_t);
void draw() override; void draw() override;
// Data members // Data members
std::map<wchar_t, sevenSegment> code{}; std::map<wchar_t, sevenSegment> code{};
finalcut::FString line[3]{}; std::array<finalcut::FString, 3> line{};
finalcut::FLineEdit input{"0123", this}; finalcut::FLineEdit input{"0123", this};
finalcut::FButton exit{"E&xit", this}; finalcut::FButton exit{"E&xit", this};
}; };
@ -140,7 +137,7 @@ void SegmentView::hexEncoding()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void SegmentView::get7Segment (const wchar_t c) void SegmentView::get7Segment (const wchar_t c)
{ {
for (int i{0}; i < 3; i++) for (std::size_t i{0}; i < 3; i++)
line[i].clear(); line[i].clear();
switch ( c ) switch ( c )
@ -186,8 +183,8 @@ void SegmentView::get7Segment (const wchar_t c)
if ( code.find(c) != code.end() ) if ( code.find(c) != code.end() )
{ {
const sevenSegment& s = code[c]; const sevenSegment& s = code[c];
constexpr char h[2]{' ', '_'}; constexpr std::array<char, 2> h{{' ', '_'}};
constexpr char v[2]{' ', '|'}; constexpr std::array<char, 2> v{{' ', '|'}};
line[0] << ' ' << h[s.a] << ' '; line[0] << ' ' << h[s.a] << ' ';
line[1] << v[s.f] << h[s.g] << v[s.b]; line[1] << v[s.f] << h[s.g] << v[s.b];

View File

@ -38,9 +38,6 @@ using finalcut::FSize;
class Background final : public finalcut::FDialog class Background final : public finalcut::FDialog
{ {
public: public:
// Using-declaration
using FDialog::setGeometry;
// Typedef // Typedef
typedef std::tuple<uChar, uChar, uChar> RGB; typedef std::tuple<uChar, uChar, uChar> RGB;

View File

@ -23,6 +23,7 @@
#include <cfloat> #include <cfloat>
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
#include <array>
#include <limits> #include <limits>
#include <map> #include <map>
#include <memory> #include <memory>
@ -231,7 +232,7 @@ class Calc final : public finalcut::FDialog
char infix_operator{'\0'}; char infix_operator{'\0'};
char last_infix_operator{'\0'}; char last_infix_operator{'\0'};
finalcut::FString input{""}; finalcut::FString input{""};
button button_no[Calc::NUM_OF_BUTTONS]{}; std::array<button, Calc::NUM_OF_BUTTONS> button_no{};
struct StackData struct StackData
{ {
@ -950,8 +951,8 @@ void Calc::draw()
bool Calc::isDataEntryKey (int key) const bool Calc::isDataEntryKey (int key) const
{ {
// Test if key is in {'.', '0'..'9'} // Test if key is in {'.', '0'..'9'}
const int data_entry_keys[] = constexpr std::array<int, 11> key_list =
{ {{
Decimal_point, Decimal_point,
Zero, Zero,
One, One,
@ -963,11 +964,11 @@ bool Calc::isDataEntryKey (int key) const
Seven, Seven,
Eight, Eight,
Nine Nine
}; }};
const int* iter = std::find (data_entry_keys, data_entry_keys + 11, key); const auto& iter = std::find (key_list.begin(), key_list.end(), key);
if ( iter != data_entry_keys + 11 ) if ( iter != key_list.end() )
return true; return true;
else else
return false; return false;
@ -977,19 +978,19 @@ bool Calc::isDataEntryKey (int key) const
bool Calc::isOperatorKey(int key) const bool Calc::isOperatorKey(int key) const
{ {
// Test if key is in {'*', '/', '+', '-', '^', '='} // Test if key is in {'*', '/', '+', '-', '^', '='}
const int operators[] = constexpr std::array<int, 6> operators =
{ {{
Multiply, Multiply,
Divide, Divide,
Add, Add,
Subtract, Subtract,
Power, Power,
Equals Equals
}; }};
const int* iter = std::find (operators, operators + 6, key); const auto& iter = std::find (operators.begin(), operators.end(), key);
if ( iter != operators + 6 ) if ( iter != operators.end() )
return true; return true;
else else
return false; return false;
@ -1099,8 +1100,8 @@ void Calc::adjustSize()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const wchar_t* Calc::getButtonText (const std::size_t key) const const wchar_t* Calc::getButtonText (const std::size_t key) const
{ {
static const wchar_t* const button_text[Calc::NUM_OF_BUTTONS] = constexpr std::array<const wchar_t*, Calc::NUM_OF_BUTTONS> button_text =
{ {{
L"&Sin", L"&Sin",
L"&Cos", L"&Cos",
L"&Tan", L"&Tan",
@ -1135,7 +1136,7 @@ const wchar_t* Calc::getButtonText (const std::size_t key) const
L"&.", L"&.",
L"", L"",
L"&=" L"&="
}; }};
return button_text[key]; return button_text[key];
} }

View File

@ -58,6 +58,7 @@ class CheckList final : public finalcut::FDialog
private: private:
// Method // Method
void populate(); void populate();
void adjustSize() override;
// Event handlers // Event handlers
void onKeyPress (finalcut::FKeyEvent*) override; void onKeyPress (finalcut::FKeyEvent*) override;
@ -80,8 +81,7 @@ CheckList::CheckList (finalcut::FWidget* parent)
// (CERT, OOP50-CPP) // (CERT, OOP50-CPP)
FDialog::setText (L"Shopping list"); FDialog::setText (L"Shopping list");
const std::size_t nf_offset = ( finalcut::FTerm::isNewFont() ) ? 1 : 0; const std::size_t nf_offset = ( finalcut::FTerm::isNewFont() ) ? 1 : 0;
FDialog::setGeometry ( FPoint{int(1 + (parent->getWidth() - 28) / 2), 5} FDialog::setSize (FSize{28 + nf_offset, 13} );
, FSize{28 + nf_offset, 13} );
setShadow(); setShadow();
listview.ignorePadding(); listview.ignorePadding();
listview.setGeometry ( FPoint{1 + int(nf_offset), 2} listview.setGeometry ( FPoint{1 + int(nf_offset), 2}
@ -121,29 +121,36 @@ CheckList::~CheckList() // destructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void CheckList::populate() void CheckList::populate()
{ {
const std::string list[][2] = constexpr std::array<std::array<const char*, 2>, 10> list =
{ {{
{ "Milk", "Highest" }, {{ "Milk", "Highest" }},
{ "Cheese", "High" }, {{ "Cheese", "High" }},
{ "Yoghurt", "Medium" }, {{ "Yoghurt", "Medium" }},
{ "Bread", "Low" }, {{ "Bread", "Low" }},
{ "Eggs", "High" }, {{ "Eggs", "High" }},
{ "Toothpaste", "Medium" }, {{ "Toothpaste", "Medium" }},
{ "Apples", "Lowest" }, {{ "Apples", "Lowest" }},
{ "Bananas", "Medium" }, {{ "Bananas", "Medium" }},
{ "Fish", "Medium" }, {{ "Fish", "Medium" }},
{ "Lemons", "Low" } {{ "Lemons", "Low" }}
}; }};
for (const auto& line : list) for (const auto& line : list)
{ {
const finalcut::FStringList string_line (&line[0], &line[0] + 2); const finalcut::FStringList string_line (line.begin(), line.end());
auto iter = listview.insert (string_line); auto iter = listview.insert (string_line);
auto item = static_cast<finalcut::FListViewItem*>(*iter); auto item = static_cast<finalcut::FListViewItem*>(*iter);
item->setCheckable(true); item->setCheckable(true);
} }
} }
//----------------------------------------------------------------------
void CheckList::adjustSize()
{
finalcut::FDialog::adjustSize();
setPos(FPoint{int(1 + (getDesktopWidth() - getWidth()) / 2), 5});
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void CheckList::onKeyPress (finalcut::FKeyEvent* ev) void CheckList::onKeyPress (finalcut::FKeyEvent* ev)
{ {

View File

@ -51,7 +51,7 @@ class EventDialog final : public finalcut::FDialog
EventDialog (const EventDialog&) = delete; EventDialog (const EventDialog&) = delete;
// Destructor // Destructor
~EventDialog(); ~EventDialog() override;
// Disable copy assignment operator (=) // Disable copy assignment operator (=)
EventDialog& operator = (const EventDialog&) = delete; EventDialog& operator = (const EventDialog&) = delete;
@ -245,7 +245,7 @@ class EventLog final : public finalcut::FDialog, public std::ostringstream
EventLog (const EventLog&) = delete; EventLog (const EventLog&) = delete;
// Destructor // Destructor
~EventLog(); ~EventLog() override;
// Disable copy assignment operator (=) // Disable copy assignment operator (=)
EventLog& operator = (const EventLog&) = delete; EventLog& operator = (const EventLog&) = delete;

View File

@ -130,54 +130,54 @@ Listview::~Listview() // destructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Listview::populate() void Listview::populate()
{ {
const std::string weather[][5] = constexpr std::array<std::array<const char*, 5>, 41> weather =
{ {{
{ "Alexandria", "Sunny", "31°C", "61%", "1006.4 mb" }, {{ "Alexandria", "Sunny", "31°C", "61%", "1006.4 mb" }},
{ "Amsterdam", "Cloudy", "21°C", "82%", "1021.3 mb" }, {{ "Amsterdam", "Cloudy", "21°C", "82%", "1021.3 mb" }},
{ "Baghdad", "Fair", "47°C", "9%", "1001.0 mb" }, {{ "Baghdad", "Fair", "47°C", "9%", "1001.0 mb" }},
{ "Bangkok", "Partly Cloudy", "30°C", "69%", "1002.0 mb" }, {{ "Bangkok", "Partly Cloudy", "30°C", "69%", "1002.0 mb" }},
{ "Beijing", "Fair", "31°C", "68%", "1007.1 mb" }, {{ "Beijing", "Fair", "31°C", "68%", "1007.1 mb" }},
{ "Berlin", "Cloudy", "22°C", "53%", "1022.0 mb" }, {{ "Berlin", "Cloudy", "22°C", "53%", "1022.0 mb" }},
{ "Bogotá", "Fair", "9°C", "95%", "1028.5 mb" }, {{ "Bogotá", "Fair", "9°C", "95%", "1028.5 mb" }},
{ "Budapest", "Partly Cloudy", "23°C", "37%", "1020.7 mb" }, {{ "Budapest", "Partly Cloudy", "23°C", "37%", "1020.7 mb" }},
{ "Buenos Aires", "Cloudy", "7°C", "73%", "1019.0 mb" }, {{ "Buenos Aires", "Cloudy", "7°C", "73%", "1019.0 mb" }},
{ "Cairo", "Fair", "39°C", "22%", "1006.1 mb" }, {{ "Cairo", "Fair", "39°C", "22%", "1006.1 mb" }},
{ "Cape Town", "Partly Cloudy", "12°C", "45%", "1030.1 mb" }, {{ "Cape Town", "Partly Cloudy", "12°C", "45%", "1030.1 mb" }},
{ "Chicago", "Mostly Cloudy", "21°C", "81%", "1014.9 mb" }, {{ "Chicago", "Mostly Cloudy", "21°C", "81%", "1014.9 mb" }},
{ "Delhi", "Haze", "33°C", "68%", "998.0 mb" }, {{ "Delhi", "Haze", "33°C", "68%", "998.0 mb" }},
{ "Dhaka", "Haze", "32°C", "64%", "996.3 mb" }, {{ "Dhaka", "Haze", "32°C", "64%", "996.3 mb" }},
{ "Houston", "Cloudy", "23°C", "100%", "1014.2 mb" }, {{ "Houston", "Cloudy", "23°C", "100%", "1014.2 mb" }},
{ "Istanbul", "Mostly Cloudy", "27°C", "61%", "1011.2 mb" }, {{ "Istanbul", "Mostly Cloudy", "27°C", "61%", "1011.2 mb" }},
{ "Jakarta", "Fair", "28°C", "71%", "1009.1 mb" }, {{ "Jakarta", "Fair", "28°C", "71%", "1009.1 mb" }},
{ "Jerusalem", "Sunny", "35°C", "17%", "1005.8 mb" }, {{ "Jerusalem", "Sunny", "35°C", "17%", "1005.8 mb" }},
{ "Johannesburg", "Fair", "18°C", "16%", "1020.0 mb" }, {{ "Johannesburg", "Fair", "18°C", "16%", "1020.0 mb" }},
{ "Karachi", "Mostly Cloudy", "29°C", "76%", "998.0 mb" }, {{ "Karachi", "Mostly Cloudy", "29°C", "76%", "998.0 mb" }},
{ "Lagos", "Mostly Cloudy", "27°C", "86%", "1014.6 mb" }, {{ "Lagos", "Mostly Cloudy", "27°C", "86%", "1014.6 mb" }},
{ "Lima", "Cloudy", "17°C", "83%", "1017.3 mb" }, {{ "Lima", "Cloudy", "17°C", "83%", "1017.3 mb" }},
{ "London", "Cloudy", "23°C", "71%", "1023.0 mb" }, {{ "London", "Cloudy", "23°C", "71%", "1023.0 mb" }},
{ "Los Angeles", "Fair", "21°C", "78%", "1011.9 mb" }, {{ "Los Angeles", "Fair", "21°C", "78%", "1011.9 mb" }},
{ "Madrid", "Fair", "32°C", "35%", "1020.0 mb" }, {{ "Madrid", "Fair", "32°C", "35%", "1020.0 mb" }},
{ "Mexico City", "Partly Cloudy", "14°C", "79%", "1028.5 mb" }, {{ "Mexico City", "Partly Cloudy", "14°C", "79%", "1028.5 mb" }},
{ "Moscow", "Partly Cloudy", "24°C", "54%", "1014.2 mb" }, {{ "Moscow", "Partly Cloudy", "24°C", "54%", "1014.2 mb" }},
{ "Mumbai", "Haze", "28°C", "77%", "1003.0 mb" }, {{ "Mumbai", "Haze", "28°C", "77%", "1003.0 mb" }},
{ "New York City", "Sunny", "21°C", "80%", "1014.2 mb" }, {{ "New York City", "Sunny", "21°C", "80%", "1014.2 mb" }},
{ "Paris", "Partly Cloudy", "27°C", "57%", "1024.4 mb" }, {{ "Paris", "Partly Cloudy", "27°C", "57%", "1024.4 mb" }},
{ "Reykjavík", "Mostly Cloudy", "11°C", "76%", "998.6 mb" }, {{ "Reykjavík", "Mostly Cloudy", "11°C", "76%", "998.6 mb" }},
{ "Rio de Janeiro", "Fair", "24°C", "64%", "1022.0 mb" }, {{ "Rio de Janeiro", "Fair", "24°C", "64%", "1022.0 mb" }},
{ "Rome", "Fair", "32°C", "18%", "1014.2 mb" }, {{ "Rome", "Fair", "32°C", "18%", "1014.2 mb" }},
{ "Saint Petersburg", "Mostly Cloudy", "18°C", "55%", "1014.6 mb" }, {{ "Saint Petersburg", "Mostly Cloudy", "18°C", "55%", "1014.6 mb" }},
{ "São Paulo", "Fair", "19°C", "53%", "1024.0 mb" }, {{ "São Paulo", "Fair", "19°C", "53%", "1024.0 mb" }},
{ "Seoul", "Cloudy", "26°C", "87%", "1012.2 mb" }, {{ "Seoul", "Cloudy", "26°C", "87%", "1012.2 mb" }},
{ "Shanghai", "Fair", "32°C", "69%", "1009.1 mb" }, {{ "Shanghai", "Fair", "32°C", "69%", "1009.1 mb" }},
{ "Singapore", "Mostly Cloudy", "29°C", "73%", "1009.1 mb" }, {{ "Singapore", "Mostly Cloudy", "29°C", "73%", "1009.1 mb" }},
{ "Tehran", "Fair", "36°C", "14%", "1013.2 mb" }, {{ "Tehran", "Fair", "36°C", "14%", "1013.2 mb" }},
{ "Tokyo", "Mostly Cloudy", "28°C", "67%", "1009.1 mb" }, {{ "Tokyo", "Mostly Cloudy", "28°C", "67%", "1009.1 mb" }},
{ "Zurich", "Mostly Cloudy", "23°C", "44%", "1023.7 mb" } {{ "Zurich", "Mostly Cloudy", "23°C", "44%", "1023.7 mb" }}
}; }};
for (const auto& place : weather) for (const auto& place : weather)
{ {
const finalcut::FStringList line (&place[0], &place[0] + 5); const finalcut::FStringList line (place.begin(), place.end());
listview.insert (line); listview.insert (line);
} }
} }
@ -197,7 +197,10 @@ void Listview::cb_showInMessagebox()
"Temperature: " + item->getText(3) + "\n" "Temperature: " + item->getText(3) + "\n"
" Humidity: " + item->getText(4) + "\n" " Humidity: " + item->getText(4) + "\n"
" Pressure: " + item->getText(5) " Pressure: " + item->getText(5)
, finalcut::FMessageBox::Ok, 0, 0, this ); , finalcut::FMessageBox::Ok
, finalcut::FMessageBox::Reject
, finalcut::FMessageBox::Reject
, this );
info.show(); info.show();
} }

View File

@ -75,8 +75,8 @@ void Mandelbrot::draw()
const int xoffset{2}; const int xoffset{2};
const int yoffset{2}; const int yoffset{2};
const int Cols = int(getClientWidth()); const auto Cols = int(getClientWidth());
const int Lines = int(getClientHeight()); const auto Lines = int(getClientHeight());
int current_line{0}; int current_line{0};
if ( Cols < 2 || Lines < 2 ) if ( Cols < 2 || Lines < 2 )

View File

@ -291,8 +291,8 @@ void Menu::defaultCallback (const finalcut::FMenuList* mb)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Menu::adjustSize() void Menu::adjustSize()
{ {
const int pw = int(getDesktopWidth()); const auto pw = int(getDesktopWidth());
const int ph = int(getDesktopHeight()); const auto ph = int(getDesktopHeight());
setX (1 + (pw - int(getWidth())) / 2, false); setX (1 + (pw - int(getWidth())) / 2, false);
setY (1 + (ph - int(getHeight())) / 4, false); setY (1 + (ph - int(getHeight())) / 4, false);
finalcut::FDialog::adjustSize(); finalcut::FDialog::adjustSize();
@ -327,8 +327,7 @@ int main (int argc, char* argv[])
// Create main dialog object // Create main dialog object
Menu main_dlg {&app}; Menu main_dlg {&app};
main_dlg.setText ("Menu example"); main_dlg.setText ("Menu example");
main_dlg.setGeometry ( FPoint{int(1 + (app.getWidth() - 40) / 2), 2} main_dlg.setSize ({40, 6});
, FSize{40, 6} );
main_dlg.setShadow(); main_dlg.setShadow();
// Set dialog main_dlg as main widget // Set dialog main_dlg as main widget

View File

@ -537,8 +537,8 @@ void MouseDraw::adjustSize()
{ {
const std::size_t w{60}; const std::size_t w{60};
const std::size_t h{18}; const std::size_t h{18};
const int x = 1 + int((getParentWidget()->getWidth() - w) / 2); const int x = 1 + int((getDesktopWidth() - w) / 2);
const int y = 1 + int((getParentWidget()->getHeight() - h) / 2); const int y = 1 + int((getDesktopHeight() - h) / 2);
setGeometry (FPoint{x, y}, FSize{w, h}, false); setGeometry (FPoint{x, y}, FSize{w, h}, false);
finalcut::FDialog::adjustSize(); finalcut::FDialog::adjustSize();
} }
@ -590,7 +590,6 @@ int main (int argc, char* argv[])
// Create a simple dialog box // Create a simple dialog box
MouseDraw mouse_draw{&app}; MouseDraw mouse_draw{&app};
mouse_draw.setGeometry (FPoint{12, 4}, FSize{60, 18});
// Set dialog object mouse_draw as main widget // Set dialog object mouse_draw as main widget
finalcut::FWidget::setMainWidget(&mouse_draw); finalcut::FWidget::setMainWidget(&mouse_draw);

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <iomanip> #include <iomanip>
#include <memory> #include <memory>
#include <string> #include <string>
@ -93,14 +94,15 @@ void move (int xold, int yold, int xnew, int ynew)
finalcut::FString from{}; finalcut::FString from{};
finalcut::FString to{}; finalcut::FString to{};
finalcut::FString byte{}; finalcut::FString byte{};
const std::string ctrl_character[] =
{ constexpr std::array<const char*, 33> ctrl_character =
{{
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
"BS", "Tab", "LF", "VT", "FF", "CR", "SO", "SI", "BS", "Tab", "LF", "VT", "FF", "CR", "SO", "SI",
"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
"CAN", "EM", "SUB", "Esc", "FS", "GS", "RS", "US", "CAN", "EM", "SUB", "Esc", "FS", "GS", "RS", "US",
"Space" "Space"
}; }};
term_boundaries(xold, yold); term_boundaries(xold, yold);
term_boundaries(xnew, ynew); term_boundaries(xnew, ynew);
@ -209,8 +211,11 @@ DirectLogger::~DirectLogger() // destructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int main (int argc, char* argv[]) int main (int argc, char* argv[])
{ {
// Disable mouse // Disable mouse, color palette changes and terminal data requests
finalcut::FStartOptions::getFStartOptions().mouse_support = false; auto& start_options = finalcut::FStartOptions::getFStartOptions();
start_options.mouse_support = false;
start_options.color_change = false;
start_options.terminal_data_request = false;
// Create the application object // Create the application object
finalcut::FApplication term_app{argc, argv}; finalcut::FApplication term_app{argc, argv};

View File

@ -226,7 +226,7 @@ void RotoZoomer::onShow (finalcut::FShowEvent*)
end = system_clock::now(); end = system_clock::now();
generateReport(); generateReport();
flush(); flush();
quit(); close();
} }
} }
@ -261,7 +261,9 @@ void RotoZoomer::onKeyPress (finalcut::FKeyEvent* ev)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void RotoZoomer::onClose (finalcut::FCloseEvent* ev) void RotoZoomer::onClose (finalcut::FCloseEvent* ev)
{ {
if ( ! benchmark ) if ( benchmark )
ev->accept();
else
finalcut::FApplication::closeConfirmationDialog (this, ev); finalcut::FApplication::closeConfirmationDialog (this, ev);
} }
@ -305,6 +307,9 @@ int main (int argc, char* argv[])
|| strcmp(argv[1], "-b") == 0 ) ) || strcmp(argv[1], "-b") == 0 ) )
{ {
benchmark = true; benchmark = true;
// Disable terminal data requests
auto& start_options = finalcut::FStartOptions::getFStartOptions();
start_options.terminal_data_request = false;
} }
{ // Create the application object in this scope { // Create the application object in this scope
@ -317,8 +322,6 @@ int main (int argc, char* argv[])
if ( benchmark ) if ( benchmark )
roto.setGeometry (FPoint{1, 1}, FSize{80, 24}); roto.setGeometry (FPoint{1, 1}, FSize{80, 24});
else
roto.setGeometry (FPoint{5, 1}, FSize{72, 23});
roto.setShadow(); roto.setShadow();

View File

@ -63,7 +63,7 @@ class AttribDlg final : public finalcut::FDialog
private: private:
// Constants // Constants
static constexpr FColor UNDEFINED = static_cast<FColor>(-2); static constexpr auto UNDEFINED = static_cast<FColor>(-2);
// Method // Method
void adjustSize() override; void adjustSize() override;
@ -498,8 +498,7 @@ int main (int argc, char* argv[])
// This object will be automatically deleted by // This object will be automatically deleted by
// the parent object "app" (FObject destructor). // the parent object "app" (FObject destructor).
AttribDlg dialog{&app}; AttribDlg dialog{&app};
dialog.setSize (FSize{69, 21});
dialog.setGeometry (FPoint{6, 2}, FSize{69, 21});
dialog.setShadow(); dialog.setShadow();
// Create the attribute demo widget as a child object from the dialog // Create the attribute demo widget as a child object from the dialog

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <string> #include <string>
@ -50,14 +51,14 @@ struct Data
const fc::termcaps cap; const fc::termcaps cap;
}; };
static TermcapString strings[]; static std::array<TermcapString, 83> strings;
}; };
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// struct data - string data array // struct data - string data array
//---------------------------------------------------------------------- //----------------------------------------------------------------------
Data::TermcapString Data::strings[] = std::array<Data::TermcapString, 83> Data::strings =
{ {{
{ "t_bell", fc::t_bell }, { "t_bell", fc::t_bell },
{ "t_erase_chars", fc::t_erase_chars }, { "t_erase_chars", fc::t_erase_chars },
{ "t_clear_screen", fc::t_clear_screen }, { "t_clear_screen", fc::t_clear_screen },
@ -99,6 +100,7 @@ Data::TermcapString Data::strings[] =
{ "t_parm_right_cursor", fc::t_parm_right_cursor }, { "t_parm_right_cursor", fc::t_parm_right_cursor },
{ "t_save_cursor", fc::t_save_cursor }, { "t_save_cursor", fc::t_save_cursor },
{ "t_restore_cursor", fc::t_restore_cursor }, { "t_restore_cursor", fc::t_restore_cursor },
{ "t_cursor_style", fc::t_cursor_style },
{ "t_scroll_forward", fc::t_scroll_forward }, { "t_scroll_forward", fc::t_scroll_forward },
{ "t_scroll_reverse", fc::t_scroll_reverse }, { "t_scroll_reverse", fc::t_scroll_reverse },
{ "t_enter_ca_mode", fc::t_enter_ca_mode }, { "t_enter_ca_mode", fc::t_enter_ca_mode },
@ -140,7 +142,7 @@ Data::TermcapString Data::strings[] =
{ "t_keypad_xmit", fc::t_keypad_xmit }, { "t_keypad_xmit", fc::t_keypad_xmit },
{ "t_keypad_local", fc::t_keypad_local }, { "t_keypad_local", fc::t_keypad_local },
{ "t_key_mouse", fc::t_key_mouse } { "t_key_mouse", fc::t_key_mouse }
}; }};
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -174,11 +176,11 @@ void tcapString (const std::string& name, const char cap_str[])
return; return;
} }
const uInt len = uInt(std::strlen(cap_str)); const auto len = uInt(std::strlen(cap_str));
for (uInt i{0}; i < len; i++) for (uInt i{0}; i < len; i++)
{ {
const uChar c = uChar(cap_str[i]); const auto c = uChar(cap_str[i]);
if ( c > 127 ) if ( c > 127 )
{ {
@ -282,8 +284,7 @@ void numeric()
void string() void string()
{ {
std::cout << "\r\n[String]\r\n"; std::cout << "\r\n[String]\r\n";
const finalcut::FTermcap::tcap_map (&tcap_strings)[] \ const auto& tcap_strings = finalcut::FTermcap::strings;
= finalcut::FTermcap::strings;
for (const auto& entry : Data::strings) for (const auto& entry : Data::strings)
{ {

View File

@ -256,12 +256,11 @@ void MainWindow::onShow (finalcut::FShowEvent*)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MainWindow::onTimer (finalcut::FTimerEvent*) void MainWindow::onTimer (finalcut::FTimerEvent*)
{ {
wchar_t first_char[2];
std::size_t length = line1.getLength(); std::size_t length = line1.getLength();
first_char[0] = line1[0]; const wchar_t first_char1 = line1[0];
first_char[1] = line2[0]; const wchar_t first_char2 = line2[0];
line1 = line1.right(length - 1) + first_char[0]; line1 = line1.right(length - 1) + first_char1;
line2 = line2.right(length - 1) + first_char[1]; line2 = line2.right(length - 1) + first_char2;
redraw(); redraw();
flush(); flush();
} }

View File

@ -401,6 +401,8 @@ Treeview::~Treeview() // destructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Treeview::adjustSize() void Treeview::adjustSize()
{ {
finalcut::FDialog::adjustSize();
std::size_t h = getDesktopHeight() - 4; std::size_t h = getDesktopHeight() - 4;
setHeight (h, false); setHeight (h, false);
int x = int((getDesktopWidth() - getWidth()) / 2); int x = int((getDesktopWidth() - getWidth()) / 2);
@ -408,15 +410,13 @@ void Treeview::adjustSize()
if ( x < 1 ) if ( x < 1 )
x = 1; x = 1;
setX (x, false); setPos (FPoint{x, 3}, false);
if ( initialized ) if ( initialized )
{ {
listview.setHeight (getHeight() - 6, false); listview.setHeight (getHeight() - 6, true);
quit.setY(int(getHeight()) - 4); quit.setY(int(getHeight()) - 4);
} }
finalcut::FDialog::adjustSize();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -438,8 +438,7 @@ int main (int argc, char* argv[])
// Create main dialog object // Create main dialog object
Treeview d{&app}; Treeview d{&app};
d.setText (L"Continents"); d.setText (L"Continents");
d.setGeometry ( FPoint{int(1 + (app.getWidth() - 57) / 2), 3} d.setSize (FSize{57, 20});
, FSize{57, 20} );
d.setShadow(); d.setShadow();
// Set dialog d as main widget // Set dialog d as main widget

View File

@ -782,19 +782,19 @@ void MyDialog::initWidgetsCallbacks()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void MyDialog::adjustSize() void MyDialog::adjustSize()
{ {
const auto h = getParentWidget()->getHeight() - 4; finalcut::FDialog::adjustSize();
const auto h = getDesktopHeight() - 4;
setHeight (h, false); setHeight (h, false);
int x = int((getDesktopWidth() - getWidth()) / 2); auto x = int((getDesktopWidth() - getWidth()) / 2);
if ( x < 1 ) if ( x < 1 )
x = 1; x = 1;
setX (x, false); setPos (FPoint{x, 2}, false);
if ( initialized ) if ( initialized )
myList.setHeight (getHeight() - 3, false); myList.setHeight (getHeight() - 3, true);
finalcut::FDialog::adjustSize();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -823,7 +823,10 @@ void MyDialog::cb_about()
, line + L" FINAL CUT " + line + L"\n\n" , line + L" FINAL CUT " + line + L"\n\n"
L"Version " + libver + L"\n\n" L"Version " + libver + L"\n\n"
L"(c) 2020 by Markus Gans" L"(c) 2020 by Markus Gans"
, finalcut::FMessageBox::Ok, 0, 0, this ); , finalcut::FMessageBox::Ok
, finalcut::FMessageBox::Reject
, finalcut::FMessageBox::Reject
, this );
info.setCenterText(); info.setCenterText();
info.show(); info.show();
} }
@ -843,7 +846,10 @@ void MyDialog::cb_terminfo()
<< " Size: " << x << fc::Times << " Size: " << x << fc::Times
<< y << "\n" << y << "\n"
<< "Colors: " << finalcut::FTerm::getMaxColor() << "Colors: " << finalcut::FTerm::getMaxColor()
, finalcut::FMessageBox::Ok, 0, 0, this , finalcut::FMessageBox::Ok
, finalcut::FMessageBox::Reject
, finalcut::FMessageBox::Reject
, this
); );
info1.setHeadline("Terminal:"); info1.setHeadline("Terminal:");
info1.exec(); info1.exec();
@ -858,7 +864,10 @@ void MyDialog::cb_drives()
, "Generic: \n\n" , "Generic: \n\n"
"Network: \n\n" "Network: \n\n"
" CD:" " CD:"
, finalcut::FMessageBox::Ok, 0, 0, this , finalcut::FMessageBox::Ok
, finalcut::FMessageBox::Reject
, finalcut::FMessageBox::Reject
, this
); );
if ( finalcut::FTerm::isNewFont() ) if ( finalcut::FTerm::isNewFont() )
@ -1057,8 +1066,7 @@ int main (int argc, char* argv[])
// Create main dialog object d // Create main dialog object d
MyDialog d{&app}; MyDialog d{&app};
d.setText (title); d.setText (title);
d.setGeometry ( FPoint{int((app.getWidth() - 56) / 2), 2} d.setSize (FSize{56, app.getHeight() - 4});
, FSize{56, app.getHeight() - 4} );
d.setShadow(); d.setShadow();
// Set the dialog object d as the main widget of the application. // Set the dialog object d as the main widget of the application.

View File

@ -79,8 +79,7 @@ Watch::Watch (FWidget* parent)
// Avoids calling a virtual function from the constructor // Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP) // (CERT, OOP50-CPP)
FDialog::setText ("Watch"); FDialog::setText ("Watch");
const int pw = int(getParentWidget()->getWidth()); FDialog::setSize ({22, 13});
FDialog::setGeometry (FPoint{1 + (pw - 22) / 2, 3}, FSize{22, 13});
// Labels // Labels
time_label.setGeometry(FPoint{5, 2}, FSize{5, 1}); time_label.setGeometry(FPoint{5, 2}, FSize{5, 1});
@ -193,8 +192,9 @@ void Watch::cb_seconds()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Watch::adjustSize() void Watch::adjustSize()
{ {
const int pw = int(getParentWidget()->getWidth()); const int pw = int(getDesktopWidth());
setX (1 + (pw - 22) / 2, false); setX (1 + (pw - 22) / 2, false);
setY (3, false);
finalcut::FDialog::adjustSize(); finalcut::FDialog::adjustSize();
} }

View File

@ -243,6 +243,8 @@ class Window final : public finalcut::FDialog
Window::Window (finalcut::FWidget* parent) Window::Window (finalcut::FWidget* parent)
: finalcut::FDialog{parent} : finalcut::FDialog{parent}
{ {
setSize ({40, 6});
// Menu bar item // Menu bar item
File.setStatusbarMessage ("File management commands"); File.setStatusbarMessage ("File management commands");
@ -349,6 +351,8 @@ void Window::activateWindow (finalcut::FDialog* win) const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Window::adjustSize() void Window::adjustSize()
{ {
finalcut::FDialog::adjustSize();
const std::size_t w = getDesktopWidth(); const std::size_t w = getDesktopWidth();
const std::size_t h = getDesktopHeight(); const std::size_t h = getDesktopHeight();
const int X = int(1 + (w - 40) / 2); const int X = int(1 + (w - 40) / 2);
@ -375,8 +379,6 @@ void Window::adjustSize()
++iter; ++iter;
} }
finalcut::FDialog::adjustSize();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -574,8 +576,6 @@ int main (int argc, char* argv[])
// Create main dialog object // Create main dialog object
Window main_dlg {&app}; Window main_dlg {&app};
main_dlg.setText ("Main window"); main_dlg.setText ("Main window");
main_dlg.setGeometry ( FPoint{int(1 + (app.getWidth() - 40) / 2), 2}
, FSize{40, 6} );
// Set dialog main_dlg as main widget // Set dialog main_dlg as main widget
finalcut::FWidget::setMainWidget (&main_dlg); finalcut::FWidget::setMainWidget (&main_dlg);

View File

@ -11,14 +11,16 @@
#include <sys/kd.h> #include <sys/kd.h>
#endif #endif
#include <array>
namespace finalcut namespace finalcut
{ {
namespace fc namespace fc
{ {
constexpr struct unipair unicode_cp437_pairs[] = constexpr std::array<struct unipair, 282> unicode_cp437_pairs =
{ {{
// .----------- unicode // .----------- unicode
// | .---- fontpos // | .---- fontpos
// | | // | |
@ -304,10 +306,10 @@ constexpr struct unipair unicode_cp437_pairs[] =
{0x266a, 0x0d}, {0x266a, 0x0d},
{0x266b, 0x0e}, {0x266b, 0x0e},
{0x266c, 0x0e} {0x266c, 0x0e}
}; }};
constexpr struct unipair unicode_newfont_pairs[] = constexpr std::array<struct unipair, 299> unicode_newfont_pairs =
{ {{
// .----------- unicode // .----------- unicode
// | .---- fontpos // | .---- fontpos
// | | // | |
@ -610,7 +612,7 @@ constexpr struct unipair unicode_newfont_pairs[] =
{0xe1f9, 0xf9}, {0xe1f9, 0xf9},
{0xe1fb, 0xfb}, {0xe1fb, 0xfb},
{0xe1fc, 0xfc} {0xe1fc, 0xfc}
}; }};
} // namespace fc } // namespace fc

View File

@ -20,6 +20,7 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include "final/fbusyindicator.h" #include "final/fbusyindicator.h"
namespace finalcut namespace finalcut
@ -75,7 +76,7 @@ void FBusyIndicator::init()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FBusyIndicator::createIndicatorText() void FBusyIndicator::createIndicatorText()
{ {
FString line[4]{}; std::array<FString, 4> line{};
if ( FTerm::getEncoding() == fc::UTF8 ) if ( FTerm::getEncoding() == fc::UTF8 )
{ {

File diff suppressed because it is too large Load Diff

View File

@ -282,7 +282,16 @@ void FDialog::move (const FPoint& d_pos)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FDialog::moveUp (int n) inline bool FDialog::moveUp (int n)
{ {
move ({0, -n}); if ( isBottomOutside() )
{
const auto y_max = int(getMaxHeight());
FWindow::setY(y_max, false);
putArea (getTermPos(), getVWin());
restoreOverlaidWindows();
}
else
move ({0, -n});
return ! setPos_error; return ! setPos_error;
} }
@ -296,7 +305,16 @@ inline bool FDialog::moveDown (int n)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FDialog::moveLeft (int n) inline bool FDialog::moveLeft (int n)
{ {
move ({-n, 0}); if ( isLeftOutside() )
{
const auto x_max = int(getMaxWidth());
FWindow::setX(x_max, false);
putArea (getTermPos(), getVWin());
restoreOverlaidWindows();
}
else
move ({-n, 0});
return ! setPos_error; return ! setPos_error;
} }
@ -458,8 +476,9 @@ void FDialog::onKeyPress (FKeyEvent* ev)
if ( this == getMainWidget() ) if ( this == getMainWidget() )
return; return;
if ( ev->key() == fc::Fkey_escape if ( ! ev->isAccepted()
|| ev->key() == fc::Fkey_escape_mintty ) && ( ev->key() == fc::Fkey_escape
|| ev->key() == fc::Fkey_escape_mintty) )
{ {
ev->accept(); ev->accept();
@ -1385,48 +1404,58 @@ inline void FDialog::moveSizeKey (FKeyEvent* ev)
{ {
case fc::Fkey_up: case fc::Fkey_up:
moveUp(1); moveUp(1);
ev->accept();
break; break;
case fc::Fkey_down: case fc::Fkey_down:
moveDown(1); moveDown(1);
ev->accept();
break; break;
case fc::Fkey_left: case fc::Fkey_left:
moveLeft(1); moveLeft(1);
ev->accept();
break; break;
case fc::Fkey_right: case fc::Fkey_right:
moveRight(1); moveRight(1);
ev->accept();
break; break;
case fc::Fmkey_up: case fc::Fmkey_up:
case fc::Fkey_sr: case fc::Fkey_sr:
reduceHeight(1); reduceHeight(1);
ev->accept();
break; break;
case fc::Fmkey_down: case fc::Fmkey_down:
case fc::Fkey_sf: case fc::Fkey_sf:
expandHeight(1); expandHeight(1);
ev->accept();
break; break;
case fc::Fmkey_left: case fc::Fmkey_left:
case fc::Fkey_sleft: case fc::Fkey_sleft:
reduceWidth(1); reduceWidth(1);
ev->accept();
break; break;
case fc::Fmkey_right: case fc::Fmkey_right:
case fc::Fkey_sright: case fc::Fkey_sright:
expandWidth(1); expandWidth(1);
ev->accept();
break; break;
case fc::Fkey_return: case fc::Fkey_return:
case fc::Fkey_enter: case fc::Fkey_enter:
acceptMoveSize(); acceptMoveSize();
ev->accept();
break; break;
case fc::Fkey_escape: case fc::Fkey_escape:
case fc::Fkey_escape_mintty: case fc::Fkey_escape_mintty:
cancelMoveSize(); cancelMoveSize();
ev->accept();
return; return;
default: default:
@ -1470,6 +1499,24 @@ bool FDialog::isOutsideTerminal (const FPoint& pos) const
return false; return false;
} }
//----------------------------------------------------------------------
bool FDialog::isLeftOutside()
{
if ( getX() > int(getMaxWidth()) )
return true;
return false;
}
//----------------------------------------------------------------------
bool FDialog::isBottomOutside()
{
if ( getY() > int(getMaxHeight()) )
return true;
return false;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FDialog::isLowerRightResizeCorner (const mouseStates& ms) const bool FDialog::isLowerRightResizeCorner (const mouseStates& ms) const
{ {

View File

@ -366,10 +366,7 @@ FUserEvent::FUserEvent (fc::events ev_type, int user_event_id) // constructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FUserEvent::~FUserEvent() // destructor FUserEvent::~FUserEvent() // destructor
{ { }
if ( ! external_data_pointer && data_pointer )
delete data_pointer;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FUserEvent::getUserId() const int FUserEvent::getUserId() const

View File

@ -55,10 +55,10 @@ bool sortDirFirst ( const FFileDialog::FDirEntry& lhs
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString fileChooser ( FWidget* parent FString fileChooser ( FWidget* parent
, const FString& dirname , const FString& dirname
, const FString& filter , const FString& filter
, FFileDialog::DialogType type ) , FFileDialog::DialogType type )
{ {
FString ret{}; FString ret{};
FString path{dirname}; FString path{dirname};
@ -165,7 +165,7 @@ FFileDialog& FFileDialog::operator = (const FFileDialog& fdlg)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FFileDialog::getSelectedFile() const FString FFileDialog::getSelectedFile() const
{ {
const uLong n = uLong(filebrowser.currentItem() - 1); const uLong n = uLong(filebrowser.currentItem() - 1);
@ -257,17 +257,17 @@ void FFileDialog::onKeyPress (FKeyEvent* ev)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FFileDialog::fileOpenChooser ( FWidget* parent FString FFileDialog::fileOpenChooser ( FWidget* parent
, const FString& dirname , const FString& dirname
, const FString& filter ) , const FString& filter )
{ {
return fileChooser (parent, dirname, filter, FFileDialog::Open); return fileChooser (parent, dirname, filter, FFileDialog::Open);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FFileDialog::fileSaveChooser ( FWidget* parent FString FFileDialog::fileSaveChooser ( FWidget* parent
, const FString& dirname , const FString& dirname
, const FString& filter ) , const FString& filter )
{ {
return fileChooser (parent, dirname, filter, FFileDialog::Save); return fileChooser (parent, dirname, filter, FFileDialog::Save);
} }
@ -736,7 +736,7 @@ void FFileDialog::printPath (const FString& txt)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FFileDialog::getHomeDir() FString FFileDialog::getHomeDir()
{ {
struct passwd pwd{}; struct passwd pwd{};
struct passwd* pwd_ptr{}; struct passwd* pwd_ptr{};

View File

@ -20,6 +20,8 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include <array>
#include "final/fc.h" #include "final/fc.h"
#include "final/fkey_map.h" #include "final/fkey_map.h"
#include "final/ftypes.h" #include "final/ftypes.h"
@ -30,8 +32,8 @@ namespace finalcut
namespace fc namespace fc
{ {
FKeyMap fkey[] = std::array<FKeyMap, 174> fkey
{ {{
{ fc::Fkey_backspace , nullptr, "kb" }, // backspace key { fc::Fkey_backspace , nullptr, "kb" }, // backspace key
{ fc::Fkey_catab , nullptr, "ka" }, // clear-all-tabs key { fc::Fkey_catab , nullptr, "ka" }, // clear-all-tabs key
{ fc::Fkey_clear , nullptr, "kC" }, // clear-screen or erase key { fc::Fkey_clear , nullptr, "kC" }, // clear-screen or erase key
@ -210,12 +212,11 @@ FKeyMap fkey[] =
{ fc::Fkey_slash , ESC "Oo", "KP1"}, // keypad slash { fc::Fkey_slash , ESC "Oo", "KP1"}, // keypad slash
{ fc::Fkey_asterisk , ESC "Oj", "KP2"}, // keypad asterisk { fc::Fkey_asterisk , ESC "Oj", "KP2"}, // keypad asterisk
{ fc::Fkey_minus_sign, ESC "Om", "KP3"}, // keypad minus sign { fc::Fkey_minus_sign, ESC "Om", "KP3"}, // keypad minus sign
{ fc::Fkey_plus_sign , ESC "Ok", "KP4"}, // keypad plus sign { fc::Fkey_plus_sign , ESC "Ok", "KP4"} // keypad plus sign
{ 0 , nullptr, "\0" } }};
};
constexpr FMetakeyMap fmetakey[] = constexpr std::array<FMetakeyMap, 228> fmetakey =
{ {{
{ fc::Fmkey_ic , "\033[2;3~" }, // M-insert { fc::Fmkey_ic , "\033[2;3~" }, // M-insert
{ fc::Fmkey_ic , "\033\033[2~" }, // M-insert { fc::Fmkey_ic , "\033\033[2~" }, // M-insert
{ fc::Fmkey_dc , "\033[3;3~" }, // M-delete { fc::Fmkey_dc , "\033[3;3~" }, // M-delete
@ -443,12 +444,11 @@ constexpr FMetakeyMap fmetakey[] =
{ fc::Fmkey_left_curly_bracket , "\033{" }, // M-{ { fc::Fmkey_left_curly_bracket , "\033{" }, // M-{
{ fc::Fmkey_vertical_bar , "\033|" }, // M-| { fc::Fmkey_vertical_bar , "\033|" }, // M-|
{ fc::Fmkey_right_curly_bracket , "\033}" }, // M-} { fc::Fmkey_right_curly_bracket , "\033}" }, // M-}
{ fc::Fmkey_tilde , "\033~" }, // M-~ { fc::Fmkey_tilde , "\033~" } // M-~
{ 0 , "\0" } }};
};
constexpr FKeyName fkeyname[] = constexpr std::array<FKeyName, 388> fkeyname =
{ {{
{ fc::Fckey_a , "Ctrl+A" }, { fc::Fckey_a , "Ctrl+A" },
{ fc::Fckey_b , "Ctrl+B" }, { fc::Fckey_b , "Ctrl+B" },
{ fc::Fckey_c , "Ctrl+C" }, { fc::Fckey_c , "Ctrl+C" },
@ -836,9 +836,8 @@ constexpr FKeyName fkeyname[] =
{ fc::Fkey_mouse , "xterm mouse" }, { fc::Fkey_mouse , "xterm mouse" },
{ fc::Fkey_extended_mouse , "SGR extended mouse" }, { fc::Fkey_extended_mouse , "SGR extended mouse" },
{ fc::Fkey_urxvt_mouse , "urxvt mouse extension" }, { fc::Fkey_urxvt_mouse , "urxvt mouse extension" },
{ fc::Fkey_incomplete , "incomplete key string" }, { fc::Fkey_incomplete , "incomplete key string" }
{ 0 , "\0" } }};
};
} // namespace fc } // namespace fc

View File

@ -86,11 +86,20 @@ void FKeyboard::fetchKeyCode()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FKeyboard::getKeyName (const FKey keynum) const FString FKeyboard::getKeyName (const FKey keynum) const
{ {
for (std::size_t i{0}; fc::fkeyname[i].string[0] != 0; i++) const auto& key = std::find_if
if ( fc::fkeyname[i].num && fc::fkeyname[i].num == keynum ) (
return FString{fc::fkeyname[i].string}; fc::fkeyname.begin(),
fc::fkeyname.end(),
[&keynum] (fc::FKeyName kn)
{
return (kn.num > 0 && kn.num == keynum);
}
);
if ( key != fc::fkeyname.end() )
return FString{key->string};
if ( keynum > 32 && keynum < 127 ) if ( keynum > 32 && keynum < 127 )
return FString{char(keynum)}; return FString{char(keynum)};
@ -98,12 +107,6 @@ const FString FKeyboard::getKeyName (const FKey keynum) const
return FString{""}; return FString{""};
} }
//----------------------------------------------------------------------
void FKeyboard::setTermcapMap (fc::FKeyMap* keymap)
{
key_map = keymap;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FKeyboard::init() void FKeyboard::init()
{ {
@ -221,12 +224,12 @@ inline FKey FKeyboard::getTermcapKey()
assert ( FIFO_BUF_SIZE > 0 ); assert ( FIFO_BUF_SIZE > 0 );
if ( ! key_map ) if ( key_map.use_count() == 0 )
return NOT_SET; return NOT_SET;
for (std::size_t i{0}; key_map[i].tname[0] != 0; i++) for (auto&& entry : *key_map)
{ {
const char* k = key_map[i].string; const char* k = entry.string;
const std::size_t len = ( k ) ? std::strlen(k) : 0; const std::size_t len = ( k ) ? std::strlen(k) : 0;
if ( k && std::strncmp(k, fifo_buf, len) == 0 ) // found if ( k && std::strncmp(k, fifo_buf, len) == 0 ) // found
@ -240,7 +243,7 @@ inline FKey FKeyboard::getTermcapKey()
fifo_buf[n] = '\0'; fifo_buf[n] = '\0';
input_data_pending = bool(fifo_buf[0] != '\0'); input_data_pending = bool(fifo_buf[0] != '\0');
return fc::fkey[i].num; return entry.num;
} }
} }
@ -254,9 +257,9 @@ inline FKey FKeyboard::getMetaKey()
assert ( FIFO_BUF_SIZE > 0 ); assert ( FIFO_BUF_SIZE > 0 );
for (std::size_t i{0}; fc::fmetakey[i].string[0] != 0; i++) for (auto&& entry : fc::fmetakey)
{ {
const char* kmeta = fc::fmetakey[i].string; // The string is never null const char* kmeta = entry.string; // The string is never null
const std::size_t len = std::strlen(kmeta); const std::size_t len = std::strlen(kmeta);
if ( std::strncmp(kmeta, fifo_buf, len) == 0 ) // found if ( std::strncmp(kmeta, fifo_buf, len) == 0 ) // found
@ -279,7 +282,7 @@ inline FKey FKeyboard::getMetaKey()
fifo_buf[n] = '\0'; fifo_buf[n] = '\0';
input_data_pending = bool(fifo_buf[0] != '\0'); input_data_pending = bool(fifo_buf[0] != '\0');
return fc::fmetakey[i].num; return entry.num;
} }
} }

View File

@ -58,7 +58,7 @@ void FLogger::newlineReplace ( std::string& str
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const std::string FLogger::getTimeString() const std::string FLogger::getTimeString() const
{ {
char str[100]; char str[100];
const auto& now = std::chrono::system_clock::now(); const auto& now = std::chrono::system_clock::now();
@ -71,7 +71,7 @@ const std::string FLogger::getTimeString() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const std::string FLogger::getEOL() const std::string FLogger::getEOL() const
{ {
if ( getEnding() == FLog::LF ) if ( getEnding() == FLog::LF )
return "\n"; return "\n";

View File

@ -268,17 +268,17 @@ void FMenuBar::calculateDimensions() const
// find the maximum item width // find the maximum item width
for (auto&& item : getItemList()) for (auto&& item : getItemList())
{ {
int len = int(item->getTextWidth()); auto len = item->getTextWidth();
int item_width = len + 2; auto item_width = len + 2;
// set item geometry // set item geometry
item->setGeometry (item_pos, FSize{std::size_t(item_width), 1}, false); item->setGeometry (item_pos, FSize{item_width, 1}, false);
// set menu position // set menu position
if ( item->hasMenu() ) if ( item->hasMenu() )
item->getMenu()->setPos (item_pos, false); item->getMenu()->setPos (item_pos, false);
item_pos.x_ref() += item_width; item_pos.x_ref() += int(item_width);
} }
} }
@ -681,7 +681,7 @@ void FMenuBar::adjustItems() const
for (auto&& item : getItemList()) for (auto&& item : getItemList())
{ {
// get item width // get item width
int item_width = int(item->getWidth()); auto item_width = item->getWidth();
if ( item->hasMenu() ) if ( item->hasMenu() )
{ {
@ -694,7 +694,7 @@ void FMenuBar::adjustItems() const
menu->adjustItems(); menu->adjustItems();
} }
item_X += item_width; item_X += int(item_width);
} }
} }

View File

@ -606,7 +606,7 @@ void FMenuItem::createDialogList (FMenu* winmenu) const
{ {
auto win = static_cast<FDialog*>(*iter); auto win = static_cast<FDialog*>(*iter);
FMenuItem* win_item{}; FMenuItem* win_item{};
const uInt32 n = uInt32(std::distance(first, iter)); const auto n = uInt32(std::distance(first, iter));
// get the dialog title // get the dialog title
const auto& name = win->getText(); const auto& name = win->getText();

View File

@ -21,6 +21,7 @@
***********************************************************************/ ***********************************************************************/
#include <algorithm> #include <algorithm>
#include <array>
#include "final/fapplication.h" #include "final/fapplication.h"
#include "final/fbutton.h" #include "final/fbutton.h"
@ -30,8 +31,8 @@
namespace finalcut namespace finalcut
{ {
static const char* const button_text[] = constexpr std::array<const char* const, 8> button_text =
{ {{
nullptr, nullptr,
"&OK", "&OK",
"&Cancel", "&Cancel",
@ -39,9 +40,8 @@ static const char* const button_text[] =
"&No", "&No",
"&Abort", "&Abort",
"&Retry", "&Retry",
"&Ignore", "&Ignore"
nullptr }};
};
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FMessageBox // class FMessageBox
@ -51,7 +51,7 @@ static const char* const button_text[] =
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FMessageBox::FMessageBox (FWidget* parent) FMessageBox::FMessageBox (FWidget* parent)
: FDialog{parent} : FDialog{parent}
, button_digit{FMessageBox::Ok, 0, 0} , button_digit{FMessageBox::Ok, FMessageBox::Reject, FMessageBox::Reject}
{ {
setTitlebarText("Message for you"); setTitlebarText("Message for you");
init(); init();
@ -79,9 +79,9 @@ FMessageBox::FMessageBox (const FMessageBox& mbox)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FMessageBox::FMessageBox ( const FString& caption FMessageBox::FMessageBox ( const FString& caption
, const FString& message , const FString& message
, int button0 , ButtonType button0
, int button1 , ButtonType button1
, int button2 , ButtonType button2
, FWidget* parent ) , FWidget* parent )
: FDialog{parent} : FDialog{parent}
, text{message} , text{message}
@ -158,10 +158,10 @@ void FMessageBox::setText (const FString& txt)
if ( button[0] ) if ( button[0] )
button[0]->setY (int(getHeight()) - 4, false); button[0]->setY (int(getHeight()) - 4, false);
if ( button[1] && button_digit[1] != 0 ) if ( button[1] && button_digit[1] != FMessageBox::Reject )
button[1]->setY (int(getHeight()) - 4, false); button[1]->setY (int(getHeight()) - 4, false);
if ( button[2] && button_digit[2] != 0 ) if ( button[2] && button_digit[2] != FMessageBox::Reject )
button[2]->setY (int(getHeight()) - 4, false); button[2]->setY (int(getHeight()) - 4, false);
adjustButtons(); adjustButtons();
@ -195,9 +195,9 @@ void FMessageBox::adjustSize()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMessageBox::cb_processClick (int reply) void FMessageBox::cb_processClick (ButtonType reply)
{ {
done(reply); done(int(reply));
} }
@ -210,15 +210,18 @@ void FMessageBox::init()
if ( (button_digit[2] && ! button_digit[1]) if ( (button_digit[2] && ! button_digit[1])
|| (button_digit[1] && ! button_digit[0]) ) || (button_digit[1] && ! button_digit[0]) )
{ {
button_digit[0] = button_digit[1] = button_digit[2] = 0; button_digit[0] = button_digit[1] \
= button_digit[2] \
= FMessageBox::Reject;
} }
if ( button_digit[0] == 0 ) if ( button_digit[0] == FMessageBox::Reject )
button_digit[0] = FMessageBox::Ok; button_digit[0] = FMessageBox::Ok;
if ( button_digit[1] == 0 && button_digit[2] == 0 ) if ( button_digit[1] == FMessageBox::Reject
&& button_digit[2] == FMessageBox::Reject )
num_buttons = 1; num_buttons = 1;
else if ( button_digit[2] == 0 ) else if ( button_digit[2] == FMessageBox::Reject )
num_buttons = 2; num_buttons = 2;
else else
num_buttons = 3; num_buttons = 3;
@ -242,7 +245,7 @@ inline void FMessageBox::allocation()
button[0]->setHeight(1, false); button[0]->setHeight(1, false);
button[0]->setFocus(); button[0]->setFocus();
if ( button_digit[1] > 0 ) if ( button_digit[1] > FMessageBox::Reject )
{ {
button[1] = new FButton(this); button[1] = new FButton(this);
button[1]->setText(button_text[button_digit[1]]); button[1]->setText(button_text[button_digit[1]]);
@ -251,7 +254,7 @@ inline void FMessageBox::allocation()
button[1]->setHeight(1, false); button[1]->setHeight(1, false);
} }
if ( button_digit[2] > 0 ) if ( button_digit[2] > FMessageBox::Reject )
{ {
button[2] = new FButton(this); button[2] = new FButton(this);
button[2]->setText(button_text[button_digit[2]]); button[2]->setText(button_text[button_digit[2]]);
@ -278,7 +281,7 @@ inline void FMessageBox::deallocation()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FMessageBox::initCallbacks() inline void FMessageBox::initCallbacks()
{ {
if ( button[0] && button_digit[0] != 0 ) if ( button[0] && button_digit[0] != FMessageBox::Reject )
{ {
button[0]->addCallback button[0]->addCallback
( (
@ -288,7 +291,7 @@ inline void FMessageBox::initCallbacks()
); );
} }
if ( button[1] && button_digit[1] != 0 ) if ( button[1] && button_digit[1] != FMessageBox::Reject )
{ {
button[1]->addCallback button[1]->addCallback
( (
@ -298,7 +301,7 @@ inline void FMessageBox::initCallbacks()
); );
} }
if ( button[2] && button_digit[2] != 0 ) if ( button[2] && button_digit[2] != FMessageBox::Reject )
{ {
button[2]->addCallback button[2]->addCallback
( (
@ -350,7 +353,7 @@ void FMessageBox::draw()
int head_offset{0}; int head_offset{0};
int center_x{0}; int center_x{0};
// center the whole block // center the whole block
const int msg_x = int((getWidth() - max_line_width) / 2); const auto msg_x = int((getWidth() - max_line_width) / 2);
if ( FTerm::isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
@ -388,7 +391,7 @@ void FMessageBox::draw()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FMessageBox::resizeButtons() const void FMessageBox::resizeButtons() const
{ {
std::size_t len[3]{}; std::array<std::size_t, 3> len{};
std::size_t max_size{}; std::size_t max_size{};
for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++) for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++)
@ -447,7 +450,7 @@ void FMessageBox::adjustButtons()
setX (int((max_width - getWidth()) / 2)); setX (int((max_width - getWidth()) / 2));
} }
const int btn_x = int((getWidth() - btn_width) / 2); const auto btn_x = int((getWidth() - btn_width) / 2);
for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++) for (std::size_t n{0}; n < num_buttons && n < MAX_BUTTONS; n++)
{ {
@ -458,7 +461,7 @@ void FMessageBox::adjustButtons()
button[n]->setX(btn_x); button[n]->setX(btn_x);
else else
{ {
const int btn_size = int(button[n]->getWidth()); const auto btn_size = int(button[n]->getWidth());
button[n]->setX(btn_x + int(n) * (btn_size + int(gap))); button[n]->setX(btn_x + int(n) * (btn_size + int(gap)));
} }
} }

View File

@ -54,7 +54,7 @@ FMouse::FMouse()
// public methods of FMouse // public methods of FMouse
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FMouse::getClassName() const FString FMouse::getClassName() const
{ {
return "FMouse"; return "FMouse";
} }
@ -287,7 +287,7 @@ FMouseGPM::~FMouseGPM() // destructor
// public methods of FMouseX11 // public methods of FMouseX11
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FMouseGPM::getClassName() const FString FMouseGPM::getClassName() const
{ {
return "FMouseGPM"; return "FMouseGPM";
} }
@ -520,7 +520,7 @@ int FMouseGPM::gpmEvent (bool clear) const
// public methods of FMouseX11 // public methods of FMouseX11
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FMouseX11::getClassName() const FString FMouseX11::getClassName() const
{ {
return "FMouseX11"; return "FMouseX11";
} }
@ -698,7 +698,7 @@ void FMouseX11::setButtonState (const int btn, const struct timeval* time)
// public methods of FMouseSGR // public methods of FMouseSGR
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FMouseSGR::getClassName() const FString FMouseSGR::getClassName() const
{ {
return "FMouseSGR"; return "FMouseSGR";
} }
@ -928,7 +928,7 @@ void FMouseSGR::setReleasedButtonState (const int btn)
// public methods of FMouseUrxvt // public methods of FMouseUrxvt
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FMouseUrxvt::getClassName() const FString FMouseUrxvt::getClassName() const
{ {
return "FMouseUrxvt"; return "FMouseUrxvt";
} }

View File

@ -382,11 +382,17 @@ bool FObject::delAllTimers() const
// protected methods of FObject // protected methods of FObject
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FObject::onTimer (FTimerEvent*) void FObject::onTimer (FTimerEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive timer events for this object
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FObject::onUserEvent (FUserEvent*) void FObject::onUserEvent (FUserEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive user events for this object
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uInt FObject::processTimerEvent() uInt FObject::processTimerEvent()

View File

@ -531,11 +531,11 @@ FColor FOptiAttr::vga2ansi (FColor color)
color = 0; color = 0;
else if ( color < 16 ) else if ( color < 16 )
{ {
static const FColor lookup_table[] = constexpr std::array<FColor, 16> lookup_table =
{ {{
0, 4, 2, 6, 1, 5, 3, 7, 0, 4, 2, 6, 1, 5, 3, 7,
8, 12, 10, 14, 9, 13, 11, 15 8, 12, 10, 14, 9, 13, 11, 15
}; }};
color = lookup_table[color]; color = lookup_table[color];
} }

View File

@ -84,37 +84,37 @@ bool FRect::isEmpty() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FRect::getPos() const FPoint FRect::getPos() const
{ {
return { X1, Y1 }; return { X1, Y1 };
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FRect::getUpperLeftPos() const FPoint FRect::getUpperLeftPos() const
{ {
return { X1, Y1 }; return { X1, Y1 };
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FRect::getUpperRightPos() const FPoint FRect::getUpperRightPos() const
{ {
return { X2, Y1 }; return { X2, Y1 };
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FRect::getLowerLeftPos() const FPoint FRect::getLowerLeftPos() const
{ {
return { X1, Y2 }; return { X1, Y2 };
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FRect::getLowerRightPos() const FPoint FRect::getLowerRightPos() const
{ {
return { X2, Y2 }; return { X2, Y2 };
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FSize FRect::getSize() const FSize FRect::getSize() const
{ {
return { getWidth(), getHeight() }; return { getWidth(), getHeight() };
} }
@ -338,7 +338,7 @@ FRect FRect::combined (const FRect& r) const
// FRect non-member operators // FRect non-member operators
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FRect operator + (const FRect& r, const FSize& s) FRect operator + (const FRect& r, const FSize& s)
{ {
return { r.X1 return { r.X1
, r.Y1 , r.Y1
@ -347,7 +347,7 @@ const FRect operator + (const FRect& r, const FSize& s)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FRect operator - (const FRect& r, const FSize& s) FRect operator - (const FRect& r, const FSize& s)
{ {
return { r.X1 return { r.X1
, r.Y1 , r.Y1

View File

@ -409,13 +409,13 @@ char* FString::c_str()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const std::string FString::toString() const std::string FString::toString() const
{ {
return std::string(c_str(), length); return std::string(c_str(), length);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::toLower() const FString FString::toLower() const
{ {
FString s{*this}; FString s{*this};
auto to_lower = [] (wchar_t& c) auto to_lower = [] (wchar_t& c)
@ -427,7 +427,7 @@ const FString FString::toLower() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::toUpper() const FString FString::toUpper() const
{ {
FString s{*this}; FString s{*this};
auto to_upper = [] (wchar_t& c) auto to_upper = [] (wchar_t& c)
@ -455,7 +455,7 @@ sInt16 FString::toShort() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uInt16 FString::toUShort() const uInt16 FString::toUShort() const
{ {
const uLong num = uLong(toULong()); const uLong num = toULong();
if ( num > USHRT_MAX ) if ( num > USHRT_MAX )
throw std::overflow_error ("overflow"); throw std::overflow_error ("overflow");
@ -466,7 +466,7 @@ uInt16 FString::toUShort() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FString::toInt() const int FString::toInt() const
{ {
long num = toLong(); const long num = toLong();
if ( num > INT_MAX ) if ( num > INT_MAX )
throw std::overflow_error ("overflow"); throw std::overflow_error ("overflow");
@ -480,7 +480,7 @@ int FString::toInt() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
uInt FString::toUInt() const uInt FString::toUInt() const
{ {
const uLong num = uLong(toULong()); const uLong num = toULong();
if ( num > UINT_MAX ) if ( num > UINT_MAX )
throw std::overflow_error ("overflow"); throw std::overflow_error ("overflow");
@ -518,7 +518,7 @@ long FString::toLong() const
while ( std::iswdigit(std::wint_t(*p)) ) while ( std::iswdigit(std::wint_t(*p)) )
{ {
uChar d = uChar(*p - L'0'); auto d = uChar(*p - L'0');
if ( num > tenth_limit if ( num > tenth_limit
|| (num == tenth_limit && d > tenth_limit_digit) ) || (num == tenth_limit && d > tenth_limit_digit) )
@ -568,7 +568,7 @@ uLong FString::toULong() const
while ( std::iswdigit(std::wint_t(*p)) ) while ( std::iswdigit(std::wint_t(*p)) )
{ {
const uChar d = uChar(*p - L'0'); const auto d = uChar(*p - L'0');
if ( num > tenth_limit if ( num > tenth_limit
|| (num == tenth_limit && d > tenth_limit_digit) ) || (num == tenth_limit && d > tenth_limit_digit) )
@ -628,7 +628,7 @@ double FString::toDouble() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::ltrim() const FString FString::ltrim() const
{ {
const FString s{*this}; const FString s{*this};
@ -645,7 +645,7 @@ const FString FString::ltrim() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::rtrim() const FString FString::rtrim() const
{ {
FString s{*this}; FString s{*this};
@ -668,7 +668,7 @@ const FString FString::rtrim() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::trim() const FString FString::trim() const
{ {
// handle NULL and empty string // handle NULL and empty string
if ( ! (string && *string) ) if ( ! (string && *string) )
@ -679,7 +679,7 @@ const FString FString::trim() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::left (std::size_t len) const FString FString::left (std::size_t len) const
{ {
FString s{*this}; FString s{*this};
@ -697,7 +697,7 @@ const FString FString::left (std::size_t len) const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::right (std::size_t len) const FString FString::right (std::size_t len) const
{ {
const FString s{*this}; const FString s{*this};
@ -714,7 +714,7 @@ const FString FString::right (std::size_t len) const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::mid (std::size_t pos, std::size_t len) const FString FString::mid (std::size_t pos, std::size_t len) const
{ {
const FString s{*this}; const FString s{*this};
@ -771,7 +771,7 @@ FString& FString::setNumber (sInt64 num)
{ {
wchar_t buf[30]{}; wchar_t buf[30]{};
wchar_t* s = &buf[29]; // Pointer to the last character wchar_t* s = &buf[29]; // Pointer to the last character
uInt64 abs_num = static_cast<uInt64>(num); auto abs_num = static_cast<uInt64>(num);
if ( num < 0 ) if ( num < 0 )
abs_num = static_cast<uInt64>(-num); abs_num = static_cast<uInt64>(-num);
@ -847,7 +847,7 @@ FString& FString::setFormatedNumber (sInt64 num, char separator)
int n{0}; int n{0};
wchar_t buf[30]{}; wchar_t buf[30]{};
wchar_t* s = &buf[29]; // Pointer to the last character wchar_t* s = &buf[29]; // Pointer to the last character
uInt64 abs_num = static_cast<uInt64>(num); auto abs_num = static_cast<uInt64>(num);
if ( separator == 0 ) if ( separator == 0 )
separator = ' '; separator = ' ';
@ -1001,7 +1001,7 @@ const FString& FString::insert (const FString& s, std::size_t pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FString const FString::replace (const FString& from, const FString& to) const FString FString::replace (const FString& from, const FString& to) const
{ {
FString s{*this}; FString s{*this};
@ -1040,7 +1040,7 @@ FString const FString::replace (const FString& from, const FString& to) const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::replaceControlCodes() const FString FString::replaceControlCodes() const
{ {
FString s{*this}; FString s{*this};
@ -1066,7 +1066,7 @@ const FString FString::replaceControlCodes() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FString::expandTabs (int tabstop) const FString FString::expandTabs (int tabstop) const
{ {
FString instr{string}; FString instr{string};
FString outstr{}; FString outstr{};
@ -1079,8 +1079,8 @@ const FString FString::expandTabs (int tabstop) const
for (std::size_t i{0}; i < last; i++) for (std::size_t i{0}; i < last; i++)
{ {
const std::size_t len = tab_split[i].getLength(); const auto len = tab_split[i].getLength();
const std::size_t tab_len = std::size_t(tabstop); const auto tab_len = std::size_t(tabstop);
if ( i == last - 1 ) if ( i == last - 1 )
outstr += tab_split[i]; outstr += tab_split[i];
@ -1527,7 +1527,7 @@ inline const wchar_t* FString::_extractToken ( wchar_t* rest[]
// FString non-member operators // FString non-member operators
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const FString& s1, const FString& s2) FString operator + (const FString& s1, const FString& s2)
{ {
FString tmp{s1}; FString tmp{s1};
tmp._insert (tmp.length, s2.length, s2.wc_str()); tmp._insert (tmp.length, s2.length, s2.wc_str());
@ -1535,7 +1535,7 @@ const FString operator + (const FString& s1, const FString& s2)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const FString& s, const wchar_t c) FString operator + (const FString& s, const wchar_t c)
{ {
FString tmp1{s}; FString tmp1{s};
wchar_t tmp2[2]; wchar_t tmp2[2];
@ -1546,7 +1546,7 @@ const FString operator + (const FString& s, const wchar_t c)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const std::wstring& s1, const FString& s2) FString operator + (const std::wstring& s1, const FString& s2)
{ {
FString tmp{s1}; FString tmp{s1};
tmp._insert (tmp.length, s2.length, s2.wc_str()); tmp._insert (tmp.length, s2.length, s2.wc_str());
@ -1554,7 +1554,7 @@ const FString operator + (const std::wstring& s1, const FString& s2)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const wchar_t s1[], const FString& s2) FString operator + (const wchar_t s1[], const FString& s2)
{ {
FString tmp{s1}; FString tmp{s1};
tmp._insert (tmp.length, s2.length, s2.wc_str()); tmp._insert (tmp.length, s2.length, s2.wc_str());
@ -1562,7 +1562,7 @@ const FString operator + (const wchar_t s1[], const FString& s2)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const std::string& s1, const FString& s2) FString operator + (const std::string& s1, const FString& s2)
{ {
FString tmp{s1}; FString tmp{s1};
tmp._insert (tmp.length, s2.length, s2.wc_str()); tmp._insert (tmp.length, s2.length, s2.wc_str());
@ -1570,7 +1570,7 @@ const FString operator + (const std::string& s1, const FString& s2)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const char s1[], const FString& s2) FString operator + (const char s1[], const FString& s2)
{ {
FString tmp{s1}; FString tmp{s1};
tmp._insert (tmp.length, s2.length, s2.wc_str()); tmp._insert (tmp.length, s2.length, s2.wc_str());
@ -1578,7 +1578,7 @@ const FString operator + (const char s1[], const FString& s2)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const wchar_t c, const FString& s) FString operator + (const wchar_t c, const FString& s)
{ {
FString tmp{c}; FString tmp{c};
tmp._insert (1, s.length, s.wc_str()); tmp._insert (1, s.length, s.wc_str());
@ -1586,7 +1586,7 @@ const FString operator + (const wchar_t c, const FString& s)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const char c, const FString& s) FString operator + (const char c, const FString& s)
{ {
FString tmp{c}; FString tmp{c};
tmp._insert (1, s.length, s.wc_str()); tmp._insert (1, s.length, s.wc_str());
@ -1594,7 +1594,7 @@ const FString operator + (const char c, const FString& s)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString operator + (const FString& s, const char c) FString operator + (const FString& s, const char c)
{ {
FString tmp1{s}; FString tmp1{s};
wchar_t tmp2[2]; wchar_t tmp2[2];
@ -1607,7 +1607,7 @@ const FString operator + (const FString& s, const char c)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::ostream& operator << (std::ostream& outstr, const FString& s) std::ostream& operator << (std::ostream& outstr, const FString& s)
{ {
const std::size_t width = std::size_t(outstr.width()); const auto width = std::size_t(outstr.width());
if ( s.length > 0 ) if ( s.length > 0 )
{ {
@ -1641,7 +1641,7 @@ std::istream& operator >> (std::istream& instr, FString& s)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::wostream& operator << (std::wostream& outstr, const FString& s) std::wostream& operator << (std::wostream& outstr, const FString& s)
{ {
const std::size_t width = std::size_t(outstr.width()); const auto width = std::size_t(outstr.width());
if ( s.length > 0 ) if ( s.length > 0 )
{ {

View File

@ -158,7 +158,7 @@ std::size_t FTerm::getColumnNumber()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTerm::getKeyName (FKey keynum) FString FTerm::getKeyName (FKey keynum)
{ {
return keyboard->getKeyName (keynum); return keyboard->getKeyName (keynum);
} }
@ -202,7 +202,7 @@ int FTerm::getMaxColor()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FTerm::FColorPalettePtr& FTerm::getColorPaletteTheme() FTerm::FColorPalettePtr& FTerm::getColorPaletteTheme()
{ {
static FColorPalettePtr* color_theme = new FColorPalettePtr(); static auto color_theme = new FColorPalettePtr();
return *color_theme; return *color_theme;
} }
@ -820,16 +820,15 @@ int FTerm::openConsole()
int fd = data->getTTYFileDescriptor(); int fd = data->getTTYFileDescriptor();
const char* termfilename = data->getTermFileName(); const char* termfilename = data->getTermFileName();
static const char* terminal_devices[] = constexpr std::array<const char*, 6> terminal_devices =
{ {{
"/proc/self/fd/0", "/proc/self/fd/0",
"/dev/tty", "/dev/tty",
"/dev/tty0", "/dev/tty0",
"/dev/vc/0", "/dev/vc/0",
"/dev/systty", "/dev/systty",
"/dev/console", "/dev/console"
nullptr }};
};
if ( fd >= 0 ) // console is already opened if ( fd >= 0 ) // console is already opened
return 0; return 0;
@ -837,9 +836,9 @@ int FTerm::openConsole()
if ( ! *termfilename || ! fsys ) if ( ! *termfilename || ! fsys )
return 0; return 0;
for (std::size_t i{0}; terminal_devices[i] != nullptr; i++) for (auto&& entry : terminal_devices)
{ {
fd = fsys->open(terminal_devices[i], O_RDWR, 0); fd = fsys->open(entry, O_RDWR, 0);
data->setTTYFileDescriptor(fd); data->setTTYFileDescriptor(fd);
if ( fd >= 0 ) if ( fd >= 0 )
@ -1191,11 +1190,11 @@ wchar_t FTerm::charEncode (wchar_t c, fc::encoding enc)
{ {
wchar_t ch_enc = c; wchar_t ch_enc = c;
for (std::size_t i{0}; i <= fc::last_char_item; i++) for (auto&& entry : fc::character)
{ {
if ( fc::character[i][fc::UTF8] == uInt(c) ) if ( entry[fc::UTF8] == uInt(c) )
{ {
ch_enc = wchar_t(fc::character[i][enc]); ch_enc = wchar_t(entry[enc]);
break; break;
} }
} }
@ -1235,7 +1234,7 @@ bool FTerm::scrollTermReverse()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FTerm::defaultPutChar& FTerm::putchar() FTerm::defaultPutChar& FTerm::putchar()
{ {
static defaultPutChar* fputchar = new defaultPutChar(); static auto fputchar = new defaultPutChar();
return *fputchar; return *fputchar;
} }
@ -1408,8 +1407,8 @@ void FTerm::init_alt_charset()
for (std::size_t n{0}; TCAP(fc::t_acs_chars)[n]; n += 2) for (std::size_t n{0}; TCAP(fc::t_acs_chars)[n]; n += 2)
{ {
// insert the VT100 key/value pairs into a map // insert the VT100 key/value pairs into a map
const uChar p1 = uChar(TCAP(fc::t_acs_chars)[n]); const auto p1 = uChar(TCAP(fc::t_acs_chars)[n]);
const uChar p2 = uChar(TCAP(fc::t_acs_chars)[n + 1]); const auto p2 = uChar(TCAP(fc::t_acs_chars)[n + 1]);
vt100_alt_char[p1] = p2; vt100_alt_char[p1] = p2;
} }
} }
@ -1421,19 +1420,18 @@ void FTerm::init_alt_charset()
}; };
// Update array 'character' with discovered VT100 pairs // Update array 'character' with discovered VT100 pairs
for (std::size_t n{0}; n <= fc::last_key_item; n++ ) for (auto&& pair : fc::vt100_key_to_utf8)
{ {
const uChar keyChar = uChar(fc::vt100_key_to_utf8[n][vt100_key]); const auto keyChar = uChar(pair[vt100_key]);
const uChar altChar = uChar(vt100_alt_char[keyChar]); const auto altChar = uChar(vt100_alt_char[keyChar]);
const uInt utf8char = uInt(fc::vt100_key_to_utf8[n][utf8_char]); const auto utf8char = uInt(pair[utf8_char]);
const fc::encoding num{fc::NUM_OF_ENCODINGS}; const auto p = std::find_if ( fc::character.begin()
, fc::character.end()
uInt* p = std::find ( fc::character[0] , [&utf8char] (std::array<uInt, 4> entry)
, fc::character[fc::last_char_item] + num { return entry[0] == utf8char; } );
, utf8char ); if ( p != fc::character.end() ) // found in character
if ( p != fc::character[fc::last_char_item] + num ) // found in character
{ {
const int item = int(std::distance(fc::character[0], p) / num); const auto item = std::size_t(std::distance(fc::character.begin(), p));
if ( altChar ) // update alternate character set if ( altChar ) // update alternate character set
fc::character[item][fc::VT100] = altChar; fc::character[item][fc::VT100] = altChar;
@ -1506,24 +1504,24 @@ void FTerm::init_cygwin_charmap()
return; return;
// PC encoding changes // PC encoding changes
for (std::size_t i{0}; i <= fc::last_char_item; i++ ) for (auto&& entry : fc::character)
{ {
if ( fc::character[i][fc::UTF8] == fc::BlackUpPointingTriangle ) // ▲ if ( entry[fc::UTF8] == fc::BlackUpPointingTriangle ) // ▲
fc::character[i][fc::PC] = 0x18; entry[fc::PC] = 0x18;
if ( fc::character[i][fc::UTF8] == fc::BlackDownPointingTriangle ) // ▼ if ( entry[fc::UTF8] == fc::BlackDownPointingTriangle ) // ▼
fc::character[i][fc::PC] = 0x19; entry[fc::PC] = 0x19;
if ( fc::character[i][fc::UTF8] == fc::InverseBullet // ◘ if ( entry[fc::UTF8] == fc::InverseBullet // ◘
|| fc::character[i][fc::UTF8] == fc::InverseWhiteCircle // ◙ || entry[fc::UTF8] == fc::InverseWhiteCircle // ◙
|| fc::character[i][fc::UTF8] == fc::UpDownArrow // ↕ || entry[fc::UTF8] == fc::UpDownArrow // ↕
|| fc::character[i][fc::UTF8] == fc::LeftRightArrow // ↔ || entry[fc::UTF8] == fc::LeftRightArrow // ↔
|| fc::character[i][fc::UTF8] == fc::DoubleExclamationMark // ‼ || entry[fc::UTF8] == fc::DoubleExclamationMark // ‼
|| fc::character[i][fc::UTF8] == fc::BlackRectangle // ▬ || entry[fc::UTF8] == fc::BlackRectangle // ▬
|| fc::character[i][fc::UTF8] == fc::RightwardsArrow // → || entry[fc::UTF8] == fc::RightwardsArrow // →
|| fc::character[i][fc::UTF8] == fc::Section // § || entry[fc::UTF8] == fc::Section // §
|| fc::character[i][fc::UTF8] == fc::SquareRoot ) // SquareRoot √ || entry[fc::UTF8] == fc::SquareRoot ) // SquareRoot √
fc::character[i][fc::PC] = fc::character[i][fc::ASCII]; entry[fc::PC] = entry[fc::ASCII];
} }
// General encoding changes // General encoding changes
@ -1560,9 +1558,9 @@ void FTerm::init_teraterm_charmap()
if ( ! isTeraTerm() ) if ( ! isTeraTerm() )
return; return;
for (std::size_t i{0}; i <= fc::last_char_item; i++ ) for (auto&& entry : fc::character)
if ( fc::character[i][fc::PC] < 0x20 ) if ( entry[fc::PC] < 0x20 )
fc::character[i][fc::PC] = fc::character[i][fc::ASCII]; entry[fc::PC] = entry[fc::ASCII];
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -274,11 +274,11 @@ wchar_t cp437_to_unicode (uChar c)
constexpr std::size_t UNICODE = 1; constexpr std::size_t UNICODE = 1;
wchar_t ucs = c; wchar_t ucs = c;
for (std::size_t i{0}; i <= fc::last_cp437_item; i++) for (auto&& entry : fc::cp437_ucs)
{ {
if ( fc::cp437_ucs[i][CP437] == c ) // found if ( entry[CP437] == c ) // found
{ {
ucs = fc::cp437_ucs[i][UNICODE]; ucs = entry[UNICODE];
break; break;
} }
} }
@ -293,11 +293,11 @@ uChar unicode_to_cp437 (wchar_t ucs)
constexpr std::size_t UNICODE = 1; constexpr std::size_t UNICODE = 1;
uChar c{'?'}; uChar c{'?'};
for (std::size_t i{0}; i <= fc::last_cp437_item; i++) for (auto&& entry : fc::cp437_ucs)
{ {
if ( fc::cp437_ucs[i][UNICODE] == ucs ) // found if ( entry[UNICODE] == ucs ) // found
{ {
c = uChar(fc::cp437_ucs[i][CP437]); c = uChar(entry[CP437]);
break; break;
} }
} }
@ -306,7 +306,7 @@ uChar unicode_to_cp437 (wchar_t ucs)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString getFullWidth (const FString& str) FString getFullWidth (const FString& str)
{ {
// Converts half-width to full-width characters // Converts half-width to full-width characters
@ -322,10 +322,10 @@ const FString getFullWidth (const FString& str)
} }
else else
{ {
for (std::size_t i{0}; i <= fc::last_halfwidth_item; i++) for (auto&& entry : fc::halfwidth_fullwidth)
{ {
if ( fc::halfwidth_fullwidth[i][HALF] == c ) // found if ( entry[HALF] == c ) // found
c = fc::halfwidth_fullwidth[i][FULL]; c = entry[FULL];
} }
} }
} }
@ -334,7 +334,7 @@ const FString getFullWidth (const FString& str)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString getHalfWidth (const FString& str) FString getHalfWidth (const FString& str)
{ {
// Converts full-width to half-width characters // Converts full-width to half-width characters
@ -350,10 +350,10 @@ const FString getHalfWidth (const FString& str)
} }
else else
{ {
for (std::size_t i{0}; i <= fc::last_halfwidth_item; i++) for (auto&& entry : fc::halfwidth_fullwidth)
{ {
if ( fc::halfwidth_fullwidth[i][FULL] == c ) // found if ( entry[FULL] == c ) // found
c = fc::halfwidth_fullwidth[i][HALF]; c = entry[HALF];
} }
} }
} }
@ -362,9 +362,9 @@ const FString getHalfWidth (const FString& str)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString getColumnSubString ( const FString& str FString getColumnSubString ( const FString& str
, std::size_t col_pos , std::size_t col_pos
, std::size_t col_len ) , std::size_t col_len )
{ {
FString s{str}; FString s{str};
std::size_t col_first{1}; std::size_t col_first{1};

View File

@ -43,7 +43,7 @@ FTermBuffer::~FTermBuffer() // destructor
// public methods of FTermBuffer // public methods of FTermBuffer
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTermBuffer::toString() const FString FTermBuffer::toString() const
{ {
std::wstring wide_string{}; std::wstring wide_string{};
wide_string.reserve(data.size()); wide_string.reserve(data.size());
@ -62,7 +62,7 @@ const FString FTermBuffer::toString() const
int FTermBuffer::write (const FString& string) int FTermBuffer::write (const FString& string)
{ {
assert ( ! string.isNull() ); assert ( ! string.isNull() );
const int len = int(string.getLength()); const auto len = int(string.getLength());
for (auto&& c : string) for (auto&& c : string)
{ {

View File

@ -224,8 +224,9 @@ void FTermcap::termcapStrings()
// Get termcap strings // Get termcap strings
// Read termcap output strings // Read termcap output strings
for (std::size_t i{0}; strings[i].tname[0] != 0; i++)
strings[i].string = getString(strings[i].tname); for (auto&& entry : strings)
entry.string = getString(entry.tname);
const auto& ho = TCAP(fc::t_cursor_home); const auto& ho = TCAP(fc::t_cursor_home);
@ -239,10 +240,8 @@ void FTermcap::termcapKeys()
// Get termcap keys // Get termcap keys
// Read termcap key sequences up to the self-defined values // Read termcap key sequences up to the self-defined values
for ( std::size_t i{0}; for (auto&& entry : fc::fkey)
fc::fkey[i].string == nullptr && fc::fkey[i].tname[0] != 0; entry.string = getString(entry.tname);
i++ )
fc::fkey[i].string = getString(fc::fkey[i].tname);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -257,8 +256,8 @@ int FTermcap::_tputs (const char* str, int affcnt, fn_putc putc)
// private Data Member of FTermcap - termcap capabilities // private Data Member of FTermcap - termcap capabilities
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FTermcap::tcap_map FTermcap::strings[] = FTermcap::TCapMapType FTermcap::strings =
{ {{
// .------------- term string // .------------- term string
// | .-------- Tcap-code // | .-------- Tcap-code
// | | // variable name -> description // | | // variable name -> description
@ -347,9 +346,8 @@ FTermcap::tcap_map FTermcap::strings[] =
{ nullptr, "ac" }, // acs_chars -> graphics charset pairs (vt100) { nullptr, "ac" }, // acs_chars -> graphics charset pairs (vt100)
{ nullptr, "ks" }, // keypad_xmit -> enter 'key-board_transmit' mode { nullptr, "ks" }, // keypad_xmit -> enter 'key-board_transmit' mode
{ nullptr, "ke" }, // keypad_local -> leave 'key-board_transmit' mode { nullptr, "ke" }, // keypad_local -> leave 'key-board_transmit' mode
{ nullptr, "Km" }, // key_mouse -> Mouse event has occurred { nullptr, "Km" } // key_mouse -> Mouse event has occurred
{ nullptr, "\0" } }};
};
/* /*
* (P) indicates that padding may be specified * (P) indicates that padding may be specified

View File

@ -171,9 +171,9 @@ void FTermFreeBSD::initCharMap()
if ( ! isFreeBSDConsole() ) if ( ! isFreeBSDConsole() )
return; return;
for (std::size_t i{0}; i <= fc::last_char_item; i++) for (auto&& entry : fc::character)
if ( fc::character[i][fc::PC] < 0x1c ) if ( entry[fc::PC] < 0x1c )
fc::character[i][fc::PC] = fc::character[i][fc::ASCII]; entry[fc::PC] = entry[fc::ASCII];
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -217,14 +217,14 @@ void FTermLinux::initCharMap()
if ( screen_unicode_map.entry_ct > 0 && screen_unicode_map.entries ) if ( screen_unicode_map.entry_ct > 0 && screen_unicode_map.entries )
{ {
for (std::size_t i{0}; i <= fc::last_char_item; i++ ) for (auto&& entry : fc::character)
{ {
const auto ucs = wchar_t(fc::character[i][fc::UTF8]); const auto ucs = wchar_t(entry[fc::UTF8]);
const sInt16 fontpos = getFontPos(ucs); const sInt16 fontpos = getFontPos(ucs);
// Fix for a non-cp437 Linux console with PC charset encoding // Fix for a non-cp437 Linux console with PC charset encoding
if ( fontpos > 255 || fontpos == NOT_FOUND ) if ( fontpos > 255 || fontpos == NOT_FOUND )
fc::character[i][fc::PC] = fc::character[i][fc::ASCII]; entry[fc::PC] = entry[fc::ASCII];
// Character substitutions for missing characters // Character substitutions for missing characters
if ( fontpos == NOT_FOUND ) if ( fontpos == NOT_FOUND )
@ -700,7 +700,7 @@ int FTermLinux::setScreenFont ( const uChar fontdata[], uInt count
for (std::size_t i{0}; i < count; i++) for (std::size_t i{0}; i < count; i++)
std::memcpy ( font.data + bytes_per_line * 32 * i std::memcpy ( font.data + bytes_per_line * 32 * i
, &fontdata[i * font.height] , &fontdata[i * font.height]
, font.height); , font.height );
} }
// Font operation // Font operation
@ -932,8 +932,8 @@ void FTermLinux::getVGAPalette()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermLinux::setVGADefaultPalette() void FTermLinux::setVGADefaultPalette()
{ {
constexpr rgb defaultColor[16] = constexpr std::array<rgb, 16> defaultColor =
{ {{
{0x00, 0x00, 0x00}, {0xaa, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0xaa, 0x00, 0x00},
{0x00, 0xaa, 0x00}, {0xaa, 0x55, 0x00}, {0x00, 0xaa, 0x00}, {0xaa, 0x55, 0x00},
{0x00, 0x00, 0xaa}, {0xaa, 0x00, 0xaa}, {0x00, 0x00, 0xaa}, {0xaa, 0x00, 0xaa},
@ -942,7 +942,7 @@ void FTermLinux::setVGADefaultPalette()
{0x55, 0xff, 0x55}, {0xff, 0xff, 0x55}, {0x55, 0xff, 0x55}, {0xff, 0xff, 0x55},
{0x55, 0x55, 0xff}, {0xff, 0x55, 0xff}, {0x55, 0x55, 0xff}, {0xff, 0x55, 0xff},
{0x55, 0xff, 0xff}, {0xff, 0xff, 0xff} {0x55, 0xff, 0xff}, {0xff, 0xff, 0xff}
}; }};
for (std::size_t index{0}; index < 16; index++) for (std::size_t index{0}; index < 16; index++)
{ {

View File

@ -743,7 +743,7 @@ void FTermXTerminal::oscPostfix() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTermXTerminal::captureXTermFont() const FString FTermXTerminal::captureXTermFont() const
{ {
initCheck(FString{}); initCheck(FString{});
@ -787,7 +787,7 @@ const FString FTermXTerminal::captureXTermFont() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTermXTerminal::captureXTermTitle() const FString FTermXTerminal::captureXTermTitle() const
{ {
initCheck(FString{}); initCheck(FString{});

View File

@ -54,7 +54,7 @@ FTextView::~FTextView() // destructor
// public methods of FTextView // public methods of FTextView
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTextView::getText() const FString FTextView::getText() const
{ {
if ( data.empty() ) if ( data.empty() )
return FString{""}; return FString{""};
@ -149,7 +149,7 @@ void FTextView::scrollTo (int x, int y)
if ( changeX && isHorizontallyScrollable() ) if ( changeX && isHorizontallyScrollable() )
{ {
const int xoffset_end = int(max_line_width - getTextWidth()); const auto xoffset_end = int(max_line_width - getTextWidth());
xoffset = x; xoffset = x;
if ( xoffset < 0 ) if ( xoffset < 0 )
@ -167,7 +167,7 @@ void FTextView::scrollTo (int x, int y)
if ( changeY && isVerticallyScrollable() ) if ( changeY && isVerticallyScrollable() )
{ {
const int yoffset_end = int(getRows() - getTextHeight()); const auto yoffset_end = int(getRows() - getTextHeight());
yoffset = y; yoffset = y;
if ( yoffset < 0 ) if ( yoffset < 0 )
@ -335,7 +335,7 @@ void FTextView::clear()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTextView::onKeyPress (FKeyEvent* ev) void FTextView::onKeyPress (FKeyEvent* ev)
{ {
const int idx = int(ev->key()); const auto idx = int(ev->key());
if ( key_map.find(idx) != key_map.end() ) if ( key_map.find(idx) != key_map.end() )
{ {
@ -504,8 +504,8 @@ void FTextView::adjustSize()
FWidget::adjustSize(); FWidget::adjustSize();
const std::size_t width = getWidth(); const std::size_t width = getWidth();
const std::size_t height = getHeight(); const std::size_t height = getHeight();
const int last_line = int(getRows()); const auto last_line = int(getRows());
const int max_width = int(max_line_width); const auto max_width = int(max_line_width);
if ( xoffset >= max_width - int(width) - nf_offset ) if ( xoffset >= max_width - int(width) - nf_offset )
xoffset = max_width - int(width) - nf_offset - 1; xoffset = max_width - int(width) - nf_offset - 1;

View File

@ -111,7 +111,7 @@ FVTerm& FVTerm::operator << (const FTermBuffer& term_buffer)
// public methods of FVTerm // public methods of FVTerm
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FVTerm::getPrintCursor() FPoint FVTerm::getPrintCursor()
{ {
const auto& win = getPrintArea(); const auto& win = getPrintArea();
@ -130,8 +130,8 @@ void FVTerm::setTermXY (int x, int y) const
if ( term_pos->getX() == x && term_pos->getY() == y ) if ( term_pos->getX() == x && term_pos->getY() == y )
return; return;
const int term_width = int(FTerm::getColumnNumber()); const auto term_width = int(FTerm::getColumnNumber());
const int term_height = int(FTerm::getLineNumber()); const auto term_height = int(FTerm::getLineNumber());
if ( x >= term_width && term_width > 0 ) if ( x >= term_width && term_width > 0 )
{ {
@ -434,7 +434,7 @@ int FVTerm::print (const std::vector<FChar>& term_string)
int FVTerm::print (FTermArea* area, const std::vector<FChar>& term_string) int FVTerm::print (FTermArea* area, const std::vector<FChar>& term_string)
{ {
int len{0}; int len{0};
const uInt tabstop = uInt(FTerm::getTabstop()); const auto tabstop = uInt(FTerm::getTabstop());
if ( ! area ) if ( ! area )
return -1; return -1;
@ -734,10 +734,10 @@ void FVTerm::resizeArea ( const FRect& box
const int offset_left = box.getX(); const int offset_left = box.getX();
const int offset_top = box.getY(); const int offset_top = box.getY();
const int width = int(box.getWidth()); const auto width = int(box.getWidth());
const int height = int(box.getHeight()); const auto height = int(box.getHeight());
const int rsw = int(shadow.getWidth()); const auto rsw = int(shadow.getWidth());
const int bsh = int(shadow.getHeight()); const auto bsh = int(shadow.getHeight());
assert ( offset_top >= 0 ); assert ( offset_top >= 0 );
assert ( width > 0 && width + rsw > 0 ); assert ( width > 0 && width + rsw > 0 );
@ -827,8 +827,8 @@ void FVTerm::restoreVTerm (const FRect& box)
int x = box.getX() - 1; int x = box.getX() - 1;
int y = box.getY() - 1; int y = box.getY() - 1;
int w = int(box.getWidth()); auto w = int(box.getWidth());
int h = int(box.getHeight()); auto h = int(box.getHeight());
if ( x < 0 ) if ( x < 0 )
x = 0; x = 0;
@ -970,8 +970,8 @@ void FVTerm::getArea (const FRect& box, const FTermArea* area)
const int x = box.getX(); const int x = box.getX();
const int y = box.getY(); const int y = box.getY();
const int w = int(box.getWidth()); const auto w = int(box.getWidth());
const int h = int(box.getHeight()); const auto h = int(box.getHeight());
const int dx = x - area->offset_left + 1; const int dx = x - area->offset_left + 1;
const int dy = y - area->offset_top + 1; const int dy = y - area->offset_top + 1;
int y_end{}; int y_end{};
@ -1040,8 +1040,8 @@ void FVTerm::putArea (const FTermArea* area) const
for (int y{0}; y < y_end; y++) // Line loop for (int y{0}; y < y_end; y++) // Line loop
{ {
bool modified{false}; bool modified{false};
int line_xmin = int(area->changes[y].xmin); auto line_xmin = int(area->changes[y].xmin);
int line_xmax = int(area->changes[y].xmax); auto line_xmax = int(area->changes[y].xmax);
if ( line_xmin > line_xmax ) if ( line_xmin > line_xmax )
continue; continue;
@ -1289,7 +1289,7 @@ void FVTerm::clearArea (FTermArea* area, int fillchar) const
return; return;
} }
const uInt w = uInt(area->width + area->right_shadow); const auto w = uInt(area->width + area->right_shadow);
if ( area->right_shadow == 0 ) if ( area->right_shadow == 0 )
{ {
@ -1795,7 +1795,7 @@ bool FVTerm::isInsideArea (const FPoint& pos, const FTermArea* area)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FChar FVTerm::generateCharacter (const FPoint& pos) FChar FVTerm::generateCharacter (const FPoint& pos)
{ {
// Generates characters for a given position considering all areas // Generates characters for a given position considering all areas
@ -1865,7 +1865,7 @@ const FChar FVTerm::generateCharacter (const FPoint& pos)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FChar FVTerm::getCharacter ( character_type char_type FChar FVTerm::getCharacter ( character_type char_type
, const FPoint& pos , const FPoint& pos
, FVTerm* obj ) , FVTerm* obj )
{ {
@ -1925,14 +1925,14 @@ const FChar FVTerm::getCharacter ( character_type char_type
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FChar FVTerm::getCoveredCharacter (const FPoint& pos, FVTerm* obj) FChar FVTerm::getCoveredCharacter (const FPoint& pos, FVTerm* obj)
{ {
// Gets the covered character for a given position // Gets the covered character for a given position
return getCharacter (covered_character, pos, obj); return getCharacter (covered_character, pos, obj);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FChar FVTerm::getOverlappedCharacter (const FPoint& pos, FVTerm* obj) FChar FVTerm::getOverlappedCharacter (const FPoint& pos, FVTerm* obj)
{ {
// Gets the overlapped character for a given position // Gets the overlapped character for a given position
return getCharacter (overlapped_character, pos, obj); return getCharacter (overlapped_character, pos, obj);

View File

@ -242,7 +242,7 @@ std::vector<bool>& FWidget::doubleFlatLine_ref (fc::sides side)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FPoint FWidget::getPrintPos() FPoint FWidget::getPrintPos()
{ {
const auto& cur = getPrintCursor(); const auto& cur = getPrintCursor();
return { cur.getX() - woffset.getX1() - getX() + 1 return { cur.getX() - woffset.getX1() - getX() + 1
@ -721,7 +721,7 @@ void FWidget::setDoubleFlatLine (fc::sides side, int pos, bool bit)
assert ( pos >= 1 ); assert ( pos >= 1 );
uLong length{}; uLong length{};
const uLong index = uLong(pos - 1); const auto index = uLong(pos - 1);
switch ( side ) switch ( side )
{ {
@ -957,7 +957,8 @@ void FWidget::show()
show_root_widget = this; show_root_widget = this;
} }
draw(); // Draw the widget adjustSize(); // Alignment before drawing
draw(); // Draw the widget
flags.hidden = false; flags.hidden = false;
flags.shown = true; flags.shown = true;
@ -1209,8 +1210,8 @@ void FWidget::setParentOffset()
void FWidget::setTermOffset() void FWidget::setTermOffset()
{ {
const auto& r = getRootWidget(); const auto& r = getRootWidget();
const int w = int(r->getWidth()); const auto w = int(r->getWidth());
const int h = int(r->getHeight()); const auto h = int(r->getHeight());
woffset.setCoordinates (0, 0, w - 1, h - 1); woffset.setCoordinates (0, 0, w - 1, h - 1);
} }
@ -1585,55 +1586,94 @@ bool FWidget::event (FEvent* ev)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onKeyPress (FKeyEvent*) void FWidget::onKeyPress (FKeyEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive key press events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onKeyUp (FKeyEvent*) void FWidget::onKeyUp (FKeyEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive key up events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onKeyDown (FKeyEvent*) void FWidget::onKeyDown (FKeyEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive key down events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onMouseDown (FMouseEvent*) void FWidget::onMouseDown (FMouseEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive mouse down events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onMouseUp (FMouseEvent*) void FWidget::onMouseUp (FMouseEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive mouse up events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onMouseDoubleClick (FMouseEvent*) void FWidget::onMouseDoubleClick (FMouseEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive mouse double clicks events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onWheel (FWheelEvent*) void FWidget::onWheel (FWheelEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive mouse wheel events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onMouseMove (FMouseEvent*) void FWidget::onMouseMove (FMouseEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive mouse move events for the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onFocusIn (FFocusEvent*) void FWidget::onFocusIn (FFocusEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive a widget focus event (get focus)
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onFocusOut (FFocusEvent*) void FWidget::onFocusOut (FFocusEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive a widget focus event (lost focus)
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onChildFocusIn (FFocusEvent*) void FWidget::onChildFocusIn (FFocusEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive a child widget focus event (get focus)
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onChildFocusOut (FFocusEvent*) void FWidget::onChildFocusOut (FFocusEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive a child widget focus event (lost focus)
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onAccel (FAccelEvent*) void FWidget::onAccel (FAccelEvent*)
{ } {
// This event handler can be reimplemented in a subclass to receive
// an event when an acceleration key is pressed for this widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onResize (FResizeEvent* ev) void FWidget::onResize (FResizeEvent* ev)
@ -1646,15 +1686,23 @@ void FWidget::onResize (FResizeEvent* ev)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onShow (FShowEvent*) void FWidget::onShow (FShowEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive a widget show event
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onHide (FHideEvent*) void FWidget::onHide (FHideEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive a widget hide event
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::onClose (FCloseEvent* ev) void FWidget::onClose (FCloseEvent* ev)
{ {
// This event handler can be reimplemented in a subclass
// to receive a widget close event
ev->accept(); ev->accept();
} }
@ -1914,7 +1962,10 @@ bool FWidget::changeFocus ( FWidget* follower, FWidget* parent
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::draw() void FWidget::draw()
{ } {
// This method must be reimplemented in a subclass
// for drawing the widget
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWidget::drawWindows() const void FWidget::drawWindows() const

View File

@ -97,7 +97,7 @@ std::size_t getHotkeyPos (const FString& src, FString& dest)
// Find hotkey position in string // Find hotkey position in string
// + generate a new string without the '&'-sign // + generate a new string without the '&'-sign
constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); constexpr auto NOT_SET = static_cast<std::size_t>(-1);
std::size_t hotkeypos{NOT_SET}; std::size_t hotkeypos{NOT_SET};
std::size_t i{0}; std::size_t i{0};

View File

@ -815,19 +815,31 @@ bool FWindow::event (FEvent* ev)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWindow::onWindowActive (FEvent*) void FWindow::onWindowActive (FEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive activation events for this window
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWindow::onWindowInactive (FEvent*) void FWindow::onWindowInactive (FEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive deactivation events for this window
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWindow::onWindowRaised (FEvent*) void FWindow::onWindowRaised (FEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive window raising events for this window
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWindow::onWindowLowered (FEvent*) void FWindow::onWindowLowered (FEvent*)
{ } {
// This event handler can be reimplemented in a subclass
// to receive window lowering events for this window
}
// private methods of FWindow // private methods of FWindow

View File

@ -62,7 +62,7 @@ public:
// Disable copy assignment operator (=) // Disable copy assignment operator (=)
emptyFString& operator = (const emptyFString&) = delete; emptyFString& operator = (const emptyFString&) = delete;
static const FString getClassName(); static FString getClassName();
static bool isNull(); static bool isNull();
static const FString& get(); static const FString& get();
static void clear(); static void clear();
@ -74,7 +74,7 @@ private:
// emptyFString inline functions // emptyFString inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString emptyFString::getClassName() inline FString emptyFString::getClassName()
{ return "emptyFString"; } { return "emptyFString"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -110,7 +110,7 @@ class FApplication : public FWidget
FApplication& operator = (const FApplication&) = delete; FApplication& operator = (const FApplication&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
int getArgc() const; int getArgc() const;
char** getArgv() const; char** getArgv() const;
static FApplication* getApplicationObject(); static FApplication* getApplicationObject();
@ -229,7 +229,7 @@ FApplication* getFApplication();
// FApplication inline functions // FApplication inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FApplication::getClassName() const inline FString FApplication::getClassName() const
{ return "FApplication"; } { return "FApplication"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -82,7 +82,7 @@ class FBusyIndicator : public FToolTip
FBusyIndicator& operator = (const FBusyIndicator&) = delete; FBusyIndicator& operator = (const FBusyIndicator&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Inquiries // Inquiries
bool isRunning() const; bool isRunning() const;
@ -113,7 +113,7 @@ class FBusyIndicator : public FToolTip
// FBusyIndicator inline functions // FBusyIndicator inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FBusyIndicator::getClassName() const inline FString FBusyIndicator::getClassName() const
{ return "FBusyIndicator"; } { return "FBusyIndicator"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -77,7 +77,7 @@ class FButton : public FWidget
FButton& operator = (const FString&); FButton& operator = (const FString&);
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
FString getText() const; FString getText() const;
// Mutators // Mutators
@ -134,7 +134,7 @@ class FButton : public FWidget
private: private:
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Methods // Methods
void init(); void init();
@ -174,7 +174,7 @@ class FButton : public FWidget
// FButton inline functions // FButton inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FButton::getClassName() const inline FString FButton::getClassName() const
{ return "FButton"; } { return "FButton"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -78,7 +78,7 @@ class FButtonGroup : public FScrollView
FButtonGroup& operator = (const FButtonGroup&) = delete; FButtonGroup& operator = (const FButtonGroup&) = delete;
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
FToggleButton* getFirstButton(); FToggleButton* getFirstButton();
FToggleButton* getLastButton(); FToggleButton* getLastButton();
FToggleButton* getButton (int) const; FToggleButton* getButton (int) const;
@ -119,7 +119,7 @@ class FButtonGroup : public FScrollView
private: private:
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Inquiries // Inquiries
bool isRadioButton (const FToggleButton*) const; bool isRadioButton (const FToggleButton*) const;
@ -139,7 +139,7 @@ class FButtonGroup : public FScrollView
// FButtonGroup inline functions // FButtonGroup inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FButtonGroup::getClassName() const inline FString FButtonGroup::getClassName() const
{ return "FButtonGroup"; } { return "FButtonGroup"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -147,7 +147,7 @@ class FCallback
FCallback& operator = (const FCallback&) = delete; FCallback& operator = (const FCallback&) = delete;
// Accessors // Accessors
const FString getClassName() const; FString getClassName() const;
std::size_t getCallbackCount() const; std::size_t getCallbackCount() const;
// Methods // Methods
@ -220,7 +220,7 @@ class FCallback
// FCallback inline functions // FCallback inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FCallback::getClassName() const inline FString FCallback::getClassName() const
{ return "FCallback"; } { return "FCallback"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -36,17 +36,10 @@ namespace finalcut
namespace fc namespace fc
{ {
extern uInt character[][fc::NUM_OF_ENCODINGS]; extern std::array<std::array<uInt, fc::NUM_OF_ENCODINGS>, 115> character;
extern const std::size_t last_char_item; extern const std::array<std::array<int, 2>, 39> vt100_key_to_utf8;
extern const std::array<std::array<wchar_t, 2>, 256> cp437_ucs;
extern const int vt100_key_to_utf8[][2]; extern const std::array<std::array<wchar_t, 2>, 227> halfwidth_fullwidth;
extern const std::size_t last_key_item;
extern const wchar_t cp437_ucs[][2];
extern const std::size_t last_cp437_item;
extern const wchar_t halfwidth_fullwidth[][2];
extern const std::size_t last_halfwidth_item;
} // namespace fc } // namespace fc

View File

@ -78,7 +78,7 @@ class FCheckBox : public FToggleButton
FCheckBox& operator = (const FCheckBox&) = delete; FCheckBox& operator = (const FCheckBox&) = delete;
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
private: private:
// Methods // Methods
@ -91,7 +91,7 @@ class FCheckBox : public FToggleButton
// FCheckBox inline functions // FCheckBox inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FCheckBox::getClassName() const inline FString FCheckBox::getClassName() const
{ return "FCheckBox"; } { return "FCheckBox"; }
} // namespace finalcut } // namespace finalcut

View File

@ -78,7 +78,7 @@ class FCheckMenuItem : public FMenuItem
FCheckMenuItem& operator = (const FCheckMenuItem&) = delete; FCheckMenuItem& operator = (const FCheckMenuItem&) = delete;
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
private: private:
// Methods // Methods
@ -89,7 +89,7 @@ class FCheckMenuItem : public FMenuItem
// FCheckMenuItem inline functions // FCheckMenuItem inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FCheckMenuItem::getClassName() const inline FString FCheckMenuItem::getClassName() const
{ return "FCheckMenuItem"; } { return "FCheckMenuItem"; }
} // namespace finalcut } // namespace finalcut

View File

@ -65,7 +65,7 @@ class FColorPair
FColorPair& operator = (const FColorPair& pair) = default; FColorPair& operator = (const FColorPair& pair) = default;
// Accessor // Accessor
const FString getClassName() const FString getClassName() const
{ return "FColorPair"; } { return "FColorPair"; }
FColor getForegroundColor() const FColor getForegroundColor() const

View File

@ -59,7 +59,7 @@ class FColorPalette
virtual ~FColorPalette(); virtual ~FColorPalette();
// Accessor // Accessor
virtual const FString getClassName() const; virtual FString getClassName() const;
// Methods // Methods
virtual void setColorPalette() = 0; virtual void setColorPalette() = 0;
@ -76,7 +76,7 @@ class FColorPalette
// FColorPalette inline functions // FColorPalette inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FColorPalette::getClassName() const inline FString FColorPalette::getClassName() const
{ return "FColorPalette"; } { return "FColorPalette"; }
@ -107,7 +107,7 @@ class default8ColorPalette final : public FColorPalette
~default8ColorPalette(); ~default8ColorPalette();
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
// Methods // Methods
void setColorPalette() override; void setColorPalette() override;
@ -116,7 +116,7 @@ class default8ColorPalette final : public FColorPalette
// default8ColorPalette inline functions // default8ColorPalette inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString default8ColorPalette::getClassName() const inline FString default8ColorPalette::getClassName() const
{ return "default8ColorPalette"; } { return "default8ColorPalette"; }
@ -147,7 +147,7 @@ class default16ColorPalette final : public FColorPalette
~default16ColorPalette(); ~default16ColorPalette();
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
// Methods // Methods
void setColorPalette() override; void setColorPalette() override;
@ -156,7 +156,7 @@ class default16ColorPalette final : public FColorPalette
// default16ColorPalette inline functions // default16ColorPalette inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString default16ColorPalette::getClassName() const inline FString default16ColorPalette::getClassName() const
{ return "default16ColorPalette"; } { return "default16ColorPalette"; }
/* Inheritance diagram /* Inheritance diagram
@ -186,7 +186,7 @@ class default16DarkColorPalette final : public FColorPalette
~default16DarkColorPalette(); ~default16DarkColorPalette();
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
// Methods // Methods
void setColorPalette() override; void setColorPalette() override;
@ -195,7 +195,7 @@ class default16DarkColorPalette final : public FColorPalette
// default16ColorPalette inline functions // default16ColorPalette inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString default16DarkColorPalette::getClassName() const inline FString default16DarkColorPalette::getClassName() const
{ return "default16DarkColorPalette"; } { return "default16DarkColorPalette"; }
} // namespace finalcut } // namespace finalcut

View File

@ -84,7 +84,7 @@ class FDropDownListBox : public FWindow
FDropDownListBox& operator = (const FDropDownListBox&) = delete; FDropDownListBox& operator = (const FDropDownListBox&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Mutators // Mutators
void setGeometry ( const FPoint&, const FSize& void setGeometry ( const FPoint&, const FSize&
@ -115,7 +115,7 @@ class FDropDownListBox : public FWindow
// FDropDownListBox inline functions // FDropDownListBox inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FDropDownListBox::getClassName() const inline FString FDropDownListBox::getClassName() const
{ return "FDropDownListBox"; } { return "FDropDownListBox"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -148,7 +148,7 @@ class FComboBox : public FWidget
// Overloaded operators // Overloaded operators
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
std::size_t getCount() const; std::size_t getCount() const;
FString getText() const; FString getText() const;
template <typename DT> template <typename DT>
@ -239,7 +239,7 @@ bool closeComboBox (FDropDownListBox*, const FPoint&);
// FComboBox inline functions // FComboBox inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FComboBox::getClassName() const inline FString FComboBox::getClassName() const
{ return "FComboBox"; } { return "FComboBox"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -124,7 +124,7 @@ class FDataAccess
virtual ~FDataAccess(); virtual ~FDataAccess();
// Accessors // Accessors
virtual const FString getClassName() const virtual FString getClassName() const
{ {
return "FDataAccess"; return "FDataAccess";
} }
@ -225,7 +225,7 @@ class FData : public FDataAccess
} }
// Accessors // Accessors
const FString getClassName() const override FString getClassName() const override
{ {
return "FData"; return "FData";
} }

View File

@ -91,8 +91,8 @@ class FDialog : public FWindow
FDialog& operator = (const FDialog&) = delete; FDialog& operator = (const FDialog&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
virtual const FString getText() const; virtual FString getText() const;
// Mutators // Mutators
bool setDialogWidget (bool); bool setDialogWidget (bool);
@ -200,6 +200,8 @@ class FDialog : public FWindow
void raiseActivateDialog(); void raiseActivateDialog();
void lowerActivateDialog(); void lowerActivateDialog();
bool isOutsideTerminal (const FPoint&) const; bool isOutsideTerminal (const FPoint&) const;
bool isLeftOutside();
bool isBottomOutside();
bool isLowerRightResizeCorner (const mouseStates&) const; bool isLowerRightResizeCorner (const mouseStates&) const;
void resizeMouseDown (const mouseStates&); void resizeMouseDown (const mouseStates&);
void resizeMouseUpMove (const mouseStates&, bool = false); void resizeMouseUpMove (const mouseStates&, bool = false);
@ -237,11 +239,11 @@ class FDialog : public FWindow
// FDialog inline functions // FDialog inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FDialog::getClassName() const inline FString FDialog::getClassName() const
{ return "FDialog"; } { return "FDialog"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FDialog::getText() const inline FString FDialog::getText() const
{ return tb_text; } { return tb_text; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -84,7 +84,7 @@ class FDialogListMenu : public FMenu
FDialogListMenu& operator = (const FDialogListMenu&) = delete; FDialogListMenu& operator = (const FDialogListMenu&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
private: private:
// Method // Method
@ -94,7 +94,7 @@ class FDialogListMenu : public FMenu
// FDialogListMenu inline functions // FDialogListMenu inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FDialogListMenu::getClassName() const inline FString FDialogListMenu::getClassName() const
{ return "FDialogListMenu"; } { return "FDialogListMenu"; }
} // namespace finalcut } // namespace finalcut

View File

@ -80,6 +80,8 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include <memory>
#include "final/fc.h" #include "final/fc.h"
#include "final/fdata.h" #include "final/fdata.h"
#include "final/fpoint.h" #include "final/fpoint.h"
@ -185,9 +187,9 @@ class FWheelEvent : public FEvent // wheel event
int getWheel() const; int getWheel() const;
private: private:
FPoint p; FPoint p{};
FPoint tp; FPoint tp{};
int w; int w{};
}; };
@ -354,9 +356,12 @@ class FUserEvent : public FEvent // user event
void setData (T&&); void setData (T&&);
private: private:
// Using-declaration
using FDataAccessPtr = std::shared_ptr<FDataAccess>;
// Data members
int uid{0}; int uid{0};
FDataAccess* data_pointer{nullptr}; FDataAccessPtr data_pointer{nullptr};
bool external_data_pointer{false};
}; };
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -377,15 +382,14 @@ inline clean_fdata_t<T>& FUserEvent::getData() const
template <typename T> template <typename T>
inline void FUserEvent::setFDataObject (T&& fdata) inline void FUserEvent::setFDataObject (T&& fdata)
{ {
external_data_pointer = true; data_pointer.reset(&(std::forward<T>(fdata)));
data_pointer = &(std::forward<T>(fdata));
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template <typename T> template <typename T>
inline void FUserEvent::setData (T&& data) inline void FUserEvent::setData (T&& data)
{ {
external_data_pointer = false; data_pointer.reset(makeFData(std::forward<T>(data)));
data_pointer = makeFData(std::forward<T>(data));
} }
} // namespace finalcut } // namespace finalcut

View File

@ -112,10 +112,10 @@ class FFileDialog : public FDialog
FFileDialog& operator = (const FFileDialog&); FFileDialog& operator = (const FFileDialog&);
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
const FString getPath() const; FString getPath() const;
const FString getFilter() const; FString getFilter() const;
const FString getSelectedFile() const; FString getSelectedFile() const;
bool getShowHiddenFiles() const; bool getShowHiddenFiles() const;
// Mutators // Mutators
@ -129,12 +129,12 @@ class FFileDialog : public FDialog
void onKeyPress (FKeyEvent*) override; void onKeyPress (FKeyEvent*) override;
// Methods // Methods
static const FString fileOpenChooser ( FWidget* static FString fileOpenChooser ( FWidget*
, const FString& = FString() , const FString& = FString()
, const FString& = FString() ); , const FString& = FString() );
static const FString fileSaveChooser ( FWidget* static FString fileSaveChooser ( FWidget*
, const FString& = FString() , const FString& = FString()
, const FString& = FString() ); , const FString& = FString() );
protected: protected:
// Method // Method
@ -203,7 +203,7 @@ class FFileDialog : public FDialog
void selectDirectoryEntry (const char* const); void selectDirectoryEntry (const char* const);
int changeDir (const FString&); int changeDir (const FString&);
void printPath (const FString&); void printPath (const FString&);
static const FString getHomeDir(); static FString getHomeDir();
// Callback methods // Callback methods
void cb_processActivate(); void cb_processActivate();
@ -232,23 +232,23 @@ class FFileDialog : public FDialog
, const FFileDialog::FDirEntry& ); , const FFileDialog::FDirEntry& );
friend bool sortDirFirst ( const FFileDialog::FDirEntry& friend bool sortDirFirst ( const FFileDialog::FDirEntry&
, const FFileDialog::FDirEntry& ); , const FFileDialog::FDirEntry& );
friend const FString fileChooser ( FWidget* friend FString fileChooser ( FWidget*
, const FString& , const FString&
, const FString& , const FString&
, FFileDialog::DialogType); , FFileDialog::DialogType);
}; };
// FMessageBox inline functions // FMessageBox inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FFileDialog::getClassName() const inline FString FFileDialog::getClassName() const
{ return "FFileDialog"; } { return "FFileDialog"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FFileDialog::getPath() const inline FString FFileDialog::getPath() const
{ return directory; } { return directory; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FFileDialog::getFilter() const inline FString FFileDialog::getFilter() const
{ return filter_pattern; } { return filter_pattern; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -33,9 +33,9 @@ namespace finalcut
namespace fc namespace fc
{ {
extern FKeyMap fkey[]; extern std::array<FKeyMap, 174> fkey;
extern const FMetakeyMap fmetakey[]; extern const std::array<FMetakeyMap, 228> fmetakey;
extern const FKeyName fkeyname[]; extern const std::array<FKeyName, 388> fkeyname;
} // namespace fc } // namespace fc

View File

@ -36,7 +36,11 @@
#endif #endif
#include <sys/time.h> #include <sys/time.h>
#include <array>
#include <functional> #include <functional>
#include <memory>
#include "final/fstring.h" #include "final/fstring.h"
#include "final/ftypes.h" #include "final/ftypes.h"
@ -99,16 +103,17 @@ class FKeyboard final
FKeyboard& operator = (const FKeyboard&) = delete; FKeyboard& operator = (const FKeyboard&) = delete;
// Accessors // Accessors
const FString getClassName() const; FString getClassName() const;
FKey getKey() const; FKey getKey() const;
const FString getKeyName (const FKey) const; FString getKeyName (const FKey) const;
keybuffer& getKeyBuffer(); keybuffer& getKeyBuffer();
timeval* getKeyPressedTime(); timeval* getKeyPressedTime();
static uInt64 getKeypressTimeout(); static uInt64 getKeypressTimeout();
static uInt64 getReadBlockingTime(); static uInt64 getReadBlockingTime();
// Mutators // Mutators
void setTermcapMap (fc::FKeyMap*); template <typename T>
void setTermcapMap (const T&);
static void setKeypressTimeout (const uInt64); static void setKeypressTimeout (const uInt64);
static void setReadBlockingTime (const uInt64); static void setReadBlockingTime (const uInt64);
void enableUTF8(); void enableUTF8();
@ -132,6 +137,9 @@ class FKeyboard final
void escapeKeyHandling(); void escapeKeyHandling();
private: private:
// Using-declaration
using FKeyMapPtr = std::shared_ptr<std::array<fc::FKeyMap, 174>>;
// Constants // Constants
static constexpr FKey NOT_SET = static_cast<FKey>(-1); static constexpr FKey NOT_SET = static_cast<FKey>(-1);
@ -176,7 +184,7 @@ class FKeyboard final
static uInt64 read_blocking_time; static uInt64 read_blocking_time;
static uInt64 key_timeout; static uInt64 key_timeout;
static uInt64 interval_timeout; static uInt64 interval_timeout;
fc::FKeyMap* key_map{nullptr}; FKeyMapPtr key_map{};
FKey key{0}; FKey key{0};
uChar read_character{}; uChar read_character{};
char fifo_buf[FIFO_BUF_SIZE]{'\0'}; char fifo_buf[FIFO_BUF_SIZE]{'\0'};
@ -191,7 +199,7 @@ class FKeyboard final
// FKeyboard inline functions // FKeyboard inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FKeyboard::getClassName() const inline FString FKeyboard::getClassName() const
{ return "FKeyboard"; } { return "FKeyboard"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -214,6 +222,11 @@ inline uInt64 FKeyboard::getKeypressTimeout()
inline uInt64 FKeyboard::getReadBlockingTime() inline uInt64 FKeyboard::getReadBlockingTime()
{ return read_blocking_time; } { return read_blocking_time; }
//----------------------------------------------------------------------
template <typename T>
inline void FKeyboard::setTermcapMap (const T& keymap)
{ key_map = std::make_shared<T>(keymap); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FKeyboard::setKeypressTimeout (const uInt64 timeout) inline void FKeyboard::setKeypressTimeout (const uInt64 timeout)
{ key_timeout = timeout; } { key_timeout = timeout; }

View File

@ -87,7 +87,7 @@ class FLabel : public FWidget
const FLabel& operator >> (FString&) const; const FLabel& operator >> (FString&) const;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
FWidget* getAccelWidget(); FWidget* getAccelWidget();
fc::text_alignment getAlignment() const; fc::text_alignment getAlignment() const;
FString& getText(); FString& getText();
@ -127,7 +127,7 @@ class FLabel : public FWidget
private: private:
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Methods // Methods
void init(); void init();
@ -165,7 +165,7 @@ inline FLabel& FLabel::operator << (const typeT& s)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FLabel::getClassName() const inline FString FLabel::getClassName() const
{ return "FLabel"; } { return "FLabel"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -103,7 +103,7 @@ class FLineEdit : public FWidget
const FLineEdit& operator >> (FString&) const; const FLineEdit& operator >> (FString&) const;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
FString getText() const; FString getText() const;
std::size_t getMaxLength() const; std::size_t getMaxLength() const;
std::size_t getCursorPosition() const; std::size_t getCursorPosition() const;
@ -175,7 +175,7 @@ class FLineEdit : public FWidget
}; };
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Methods // Methods
void init(); void init();
@ -237,7 +237,7 @@ inline FLineEdit& FLineEdit::operator << (const typeT& s)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FLineEdit::getClassName() const inline FString FLineEdit::getClassName() const
{ return "FLineEdit"; } { return "FLineEdit"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -48,6 +48,7 @@
#error "Only <final/final.h> can be included directly." #error "Only <final/final.h> can be included directly."
#endif #endif
#include <memory>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
@ -83,7 +84,7 @@ class FListBoxItem
FListBoxItem& operator = (const FListBoxItem&); FListBoxItem& operator = (const FListBoxItem&);
// Accessors // Accessors
virtual const FString getClassName() const; virtual FString getClassName() const;
virtual FString getText() const; virtual FString getText() const;
template <typename DT> template <typename DT>
clean_fdata_t<DT>& getData() const; clean_fdata_t<DT>& getData() const;
@ -97,9 +98,12 @@ class FListBoxItem
void clear(); void clear();
private: private:
// Using-declaration
using FDataAccessPtr = std::shared_ptr<FDataAccess>;
// Data members // Data members
FString text{}; FString text{};
FDataAccess* data_pointer{nullptr}; FDataAccessPtr data_pointer{};
fc::brackets_type brackets{fc::NoBrackets}; fc::brackets_type brackets{fc::NoBrackets};
bool selected{false}; bool selected{false};
@ -117,7 +121,7 @@ inline FListBoxItem::FListBoxItem (const FString& txt, DT&& data)
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FListBoxItem::getClassName() const inline FString FListBoxItem::getClassName() const
{ return "FListBoxItem"; } { return "FListBoxItem"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -139,7 +143,8 @@ inline void FListBoxItem::setText (const FString& txt)
template <typename DT> template <typename DT>
inline void FListBoxItem::setData (DT&& data) inline void FListBoxItem::setData (DT&& data)
{ {
data_pointer = makeFData(std::forward<DT>(data)); const auto data_obj = makeFData(std::forward<DT>(data));
data_pointer.reset(data_obj);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -179,7 +184,7 @@ class FListBox : public FWidget
FListBox& operator = (const FListBox&) = delete; FListBox& operator = (const FListBox&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
std::size_t getCount() const; std::size_t getCount() const;
FListBoxItem& getItem (std::size_t); FListBoxItem& getItem (std::size_t);
const FListBoxItem& getItem (std::size_t) const; const FListBoxItem& getItem (std::size_t) const;
@ -415,7 +420,7 @@ inline FListBox::FListBox ( Container container
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FListBox::getClassName() const inline FString FListBox::getClassName() const
{ return "FListBox"; } { return "FListBox"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -48,6 +48,7 @@
#endif #endif
#include <list> #include <list>
#include <memory>
#include <stack> #include <stack>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
@ -86,7 +87,7 @@ class FListViewItem : public FObject
FListViewItem& operator = (const FListViewItem&); FListViewItem& operator = (const FListViewItem&);
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
uInt getColumnCount() const; uInt getColumnCount() const;
int getSortColumn() const; int getSortColumn() const;
FString getText (int) const; FString getText (int) const;
@ -113,6 +114,9 @@ class FListViewItem : public FObject
void collapse(); void collapse();
private: private:
// Using-declaration
using FDataAccessPtr = std::shared_ptr<FDataAccess>;
// Inquiry // Inquiry
bool isExpandable() const; bool isExpandable() const;
bool isCheckable() const; bool isCheckable() const;
@ -127,7 +131,7 @@ class FListViewItem : public FObject
// Data members // Data members
FStringList column_list{}; FStringList column_list{};
FDataAccess* data_pointer{nullptr}; FDataAccessPtr data_pointer{};
iterator root{}; iterator root{};
std::size_t visible_lines{1}; std::size_t visible_lines{1};
bool expandable{false}; bool expandable{false};
@ -159,7 +163,7 @@ inline FListViewItem::FListViewItem ( const FStringList& cols
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FListViewItem::getClassName() const inline FString FListViewItem::getClassName() const
{ return "FListViewItem"; } { return "FListViewItem"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -177,7 +181,8 @@ inline clean_fdata_t<DT>& FListViewItem::getData() const
template <typename DT> template <typename DT>
inline void FListViewItem::setData (DT&& data) inline void FListViewItem::setData (DT&& data)
{ {
data_pointer = makeFData(std::forward<DT>(data)); const auto data_obj = makeFData(std::forward<DT>(data));
data_pointer = data_obj;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -237,7 +242,7 @@ class FListViewIterator
bool operator != (const FListViewIterator&) const; bool operator != (const FListViewIterator&) const;
// Accessor // Accessor
const FString getClassName() const; FString getClassName() const;
int& getPosition(); int& getPosition();
// Methods // Methods
@ -273,7 +278,7 @@ inline bool FListViewIterator::operator != (const FListViewIterator& rhs) const
{ return node != rhs.node; } { return node != rhs.node; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FListViewIterator::getClassName() const inline FString FListViewIterator::getClassName() const
{ return "FListViewIterator"; } { return "FListViewIterator"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -304,7 +309,7 @@ class FListView : public FWidget
FListView& operator = (const FListView&) = delete; FListView& operator = (const FListView&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
std::size_t getCount() const; std::size_t getCount() const;
fc::text_alignment getColumnAlignment (int) const; fc::text_alignment getColumnAlignment (int) const;
FString getColumnText (int) const; FString getColumnText (int) const;
@ -545,7 +550,7 @@ struct FListView::Header
// FListView inline functions // FListView inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FListView::getClassName() const inline FString FListView::getClassName() const
{ return "FListView"; } { return "FListView"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -84,7 +84,7 @@ class FLog : public std::stringbuf
FLog& operator << (IOManip); FLog& operator << (IOManip);
FLog& operator << (LogLevel); FLog& operator << (LogLevel);
virtual const FString getClassName() const; virtual FString getClassName() const;
virtual void info (const std::string&) = 0; virtual void info (const std::string&) = 0;
virtual void warn (const std::string&) = 0; virtual void warn (const std::string&) = 0;
virtual void error (const std::string&) = 0; virtual void error (const std::string&) = 0;
@ -130,7 +130,7 @@ inline FLog& FLog::operator << (IOManip pf)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FLog::getClassName() const inline FString FLog::getClassName() const
{ return "FLog"; } { return "FLog"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -72,7 +72,7 @@ class FLogger : public FLog
~FLogger() override; ~FLogger() override;
// Methods // Methods
const FString getClassName() const override; FString getClassName() const override;
void info (const std::string&) override; void info (const std::string&) override;
void warn (const std::string&) override; void warn (const std::string&) override;
void error (const std::string&) override; void error (const std::string&) override;
@ -86,8 +86,8 @@ class FLogger : public FLog
private: private:
// Methods // Methods
void newlineReplace (std::string&, const std::string&) const; void newlineReplace (std::string&, const std::string&) const;
const std::string getTimeString() const; std::string getTimeString() const;
const std::string getEOL() const; std::string getEOL() const;
void printLogLine (const std::string&); void printLogLine (const std::string&);
// Data member // Data member
@ -97,7 +97,7 @@ class FLogger : public FLog
// FLogger inline functions // FLogger inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FLogger::getClassName() const inline FString FLogger::getClassName() const
{ return "FLogger"; } { return "FLogger"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -91,7 +91,7 @@ class FMenu : public FWindow, public FMenuList
FMenu& operator = (const FMenu&) = delete; FMenu& operator = (const FMenu&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
FString getText() const; FString getText() const;
FMenuItem* getItem(); FMenuItem* getItem();
@ -133,7 +133,7 @@ class FMenu : public FWindow, public FMenuList
private: private:
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
static constexpr bool SELECT_ITEM = true; static constexpr bool SELECT_ITEM = true;
// Typedef // Typedef
@ -248,7 +248,7 @@ std::tuple<bool, bool> closeOpenMenus (FMenu*, const FPoint&);
// FMenu inline functions // FMenu inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMenu::getClassName() const inline FString FMenu::getClassName() const
{ return "FMenu"; } { return "FMenu"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -83,7 +83,7 @@ class FMenuBar : public FWindow, public FMenuList
FMenuBar& operator = (const FMenuBar&) = delete; FMenuBar& operator = (const FMenuBar&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Methods // Methods
void resetColors() override; void resetColors() override;
@ -103,7 +103,7 @@ class FMenuBar : public FWindow, public FMenuList
private: private:
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Typedef // Typedef
typedef struct typedef struct
@ -157,7 +157,7 @@ class FMenuBar : public FWindow, public FMenuList
// FMenuBar inline functions // FMenuBar inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMenuBar::getClassName() const inline FString FMenuBar::getClassName() const
{ return "FMenuBar"; } { return "FMenuBar"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -88,7 +88,7 @@ class FMenuItem : public FWidget
FMenuItem& operator = (const FMenuItem&) = delete; FMenuItem& operator = (const FMenuItem&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
FKey getHotkey() const; FKey getHotkey() const;
FMenu* getMenu() const; FMenu* getMenu() const;
std::size_t getTextLength() const; std::size_t getTextLength() const;
@ -196,7 +196,7 @@ class FMenuItem : public FWidget
// FMenuItem inline functions // FMenuItem inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMenuItem::getClassName() const inline FString FMenuItem::getClassName() const
{ return "FMenuItem"; } { return "FMenuItem"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -71,7 +71,7 @@ class FMenuList
FMenuList& operator = (const FMenuList&) = delete; FMenuList& operator = (const FMenuList&) = delete;
// Accessors // Accessors
virtual const FString getClassName() const; virtual FString getClassName() const;
std::size_t getCount() const; std::size_t getCount() const;
FMenuItem* getItem (int) const; FMenuItem* getItem (int) const;
FMenuItem* getSelectedItem() const; FMenuItem* getSelectedItem() const;
@ -104,7 +104,7 @@ class FMenuList
// FMenuList inline functions // FMenuList inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMenuList::getClassName() const inline FString FMenuList::getClassName() const
{ return "FMenuList"; } { return "FMenuList"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -92,7 +92,7 @@ class FMessageBox : public FDialog
explicit FMessageBox (FWidget* = nullptr); explicit FMessageBox (FWidget* = nullptr);
FMessageBox (const FMessageBox&); // copy constructor FMessageBox (const FMessageBox&); // copy constructor
FMessageBox ( const FString&, const FString& FMessageBox ( const FString&, const FString&
, int, int, int , ButtonType, ButtonType, ButtonType
, FWidget* = nullptr ); , FWidget* = nullptr );
// Destructor // Destructor
~FMessageBox() override; ~FMessageBox() override;
@ -101,10 +101,10 @@ class FMessageBox : public FDialog
FMessageBox& operator = (const FMessageBox&); FMessageBox& operator = (const FMessageBox&);
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
const FString getTitlebarText() const; FString getTitlebarText() const;
const FString getHeadline() const; FString getHeadline() const;
const FString getText() const override; FString getText() const override;
// Mutator // Mutator
void setTitlebarText (const FString&); void setTitlebarText (const FString&);
@ -119,22 +119,22 @@ class FMessageBox : public FDialog
static int info ( FWidget* static int info ( FWidget*
, const FString& , const FString&
, const messageType& , const messageType&
, int = FMessageBox::Ok , ButtonType = FMessageBox::Ok
, int = 0 , ButtonType = FMessageBox::Reject
, int = 0 ); , ButtonType = FMessageBox::Reject );
template <typename messageType> template <typename messageType>
static int error ( FWidget* static int error ( FWidget*
, const messageType& , const messageType&
, int = FMessageBox::Ok , ButtonType = FMessageBox::Ok
, int = 0 , ButtonType = FMessageBox::Reject
, int = 0 ); , ButtonType = FMessageBox::Reject );
protected: protected:
// Method // Method
void adjustSize() override; void adjustSize() override;
// Callback method // Callback method
void cb_processClick (int); void cb_processClick (ButtonType);
private: private:
// Constants // Constants
@ -157,7 +157,7 @@ class FMessageBox : public FDialog
FButton* button[MAX_BUTTONS]{nullptr}; FButton* button[MAX_BUTTONS]{nullptr};
std::size_t max_line_width{0}; std::size_t max_line_width{0};
FColor emphasis_color{getColorTheme()->dialog_emphasis_fg}; FColor emphasis_color{getColorTheme()->dialog_emphasis_fg};
int button_digit[MAX_BUTTONS]{0}; ButtonType button_digit[MAX_BUTTONS]{FMessageBox::Reject};
std::size_t num_buttons{0}; std::size_t num_buttons{0};
std::size_t text_num_lines{0}; std::size_t text_num_lines{0};
bool center_text{false}; bool center_text{false};
@ -166,22 +166,22 @@ class FMessageBox : public FDialog
// FMessageBox inline functions // FMessageBox inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMessageBox::getClassName() const inline FString FMessageBox::getClassName() const
{ return "FMessageBox"; } { return "FMessageBox"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMessageBox::getTitlebarText() const inline FString FMessageBox::getTitlebarText() const
{ {
const FString& title = FDialog::getText(); // initialize text const FString& title = FDialog::getText(); // initialize text
return title; return title;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMessageBox::getHeadline() const inline FString FMessageBox::getHeadline() const
{ return headline_text; } { return headline_text; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMessageBox::getText() const inline FString FMessageBox::getText() const
{ return text; } { return text; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -205,9 +205,9 @@ template <typename messageType>
int FMessageBox::info ( FWidget* parent int FMessageBox::info ( FWidget* parent
, const FString& caption , const FString& caption
, const messageType& message , const messageType& message
, int button0 , ButtonType button0
, int button1 , ButtonType button1
, int button2 ) , ButtonType button2 )
{ {
FMessageBox mbox ( caption FMessageBox mbox ( caption
, FString() << message , FString() << message
@ -221,9 +221,9 @@ int FMessageBox::info ( FWidget* parent
template <typename messageType> template <typename messageType>
int FMessageBox::error ( FWidget* parent int FMessageBox::error ( FWidget* parent
, const messageType& message , const messageType& message
, int button0 , ButtonType button0
, int button1 , ButtonType button1
, int button2 ) , ButtonType button2 )
{ {
const FString caption{"Error message"}; const FString caption{"Error message"};

View File

@ -102,7 +102,7 @@ class FMouse
{ } { }
// Accessors // Accessors
virtual const FString getClassName() const; virtual FString getClassName() const;
const FPoint& getPos() const; const FPoint& getPos() const;
void clearEvent(); void clearEvent();
@ -215,7 +215,7 @@ class FMouseGPM final : public FMouse
~FMouseGPM() override; ~FMouseGPM() override;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Mutators // Mutators
void setStdinNo(int); void setStdinNo(int);
@ -283,7 +283,7 @@ class FMouseX11 final : public FMouse
~FMouseX11() override = default; ~FMouseX11() override = default;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Inquiry // Inquiry
bool hasData() override; bool hasData() override;
@ -342,7 +342,7 @@ class FMouseSGR final : public FMouse
~FMouseSGR() override = default; ~FMouseSGR() override = default;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Inquiry // Inquiry
bool hasData() override; bool hasData() override;
@ -401,7 +401,7 @@ class FMouseUrxvt final : public FMouse
~FMouseUrxvt() override = default; ~FMouseUrxvt() override = default;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
// Inquiry // Inquiry
bool hasData() override; bool hasData() override;
@ -466,7 +466,7 @@ class FMouseControl
FMouseControl& operator = (const FMouseControl&) = delete; FMouseControl& operator = (const FMouseControl&) = delete;
// Accessors // Accessors
virtual const FString getClassName() const; virtual FString getClassName() const;
const FPoint& getPos(); const FPoint& getPos();
void clearEvent(); void clearEvent();
@ -526,7 +526,7 @@ class FMouseControl
// FMouseControl inline functions // FMouseControl inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FMouseControl::getClassName() const inline FString FMouseControl::getClassName() const
{ return "FMouseControl"; } { return "FMouseControl"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -79,7 +79,7 @@ class FObject
typedef FObjectList::const_iterator const_iterator; typedef FObjectList::const_iterator const_iterator;
// Constants // Constants
static constexpr std::size_t UNLIMITED = static_cast<std::size_t>(-1); static constexpr auto UNLIMITED = static_cast<std::size_t>(-1);
// Constructor // Constructor
explicit FObject (FObject* = nullptr); explicit FObject (FObject* = nullptr);
@ -94,7 +94,7 @@ class FObject
FObject& operator = (const FObject&) = delete; FObject& operator = (const FObject&) = delete;
// Accessors // Accessors
virtual const FString getClassName() const; virtual FString getClassName() const;
FObject* getParent() const; FObject* getParent() const;
FObject* getChild (int) const; FObject* getChild (int) const;
FObjectList& getChildren(); FObjectList& getChildren();
@ -176,7 +176,7 @@ class FObject
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FObject::getClassName() const inline FString FObject::getClassName() const
{ return "FObject"; } { return "FObject"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -107,7 +107,7 @@ class FOptiAttr final
FOptiAttr& operator = (const FOptiAttr&) = delete; FOptiAttr& operator = (const FOptiAttr&) = delete;
// Accessors // Accessors
const FString getClassName() const; FString getClassName() const;
// Mutators // Mutators
void setTermEnvironment (const termEnv&); void setTermEnvironment (const termEnv&);
@ -318,7 +318,7 @@ class FOptiAttr final
// FOptiAttr inline functions // FOptiAttr inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FOptiAttr::getClassName() const inline FString FOptiAttr::getClassName() const
{ return "FOptiAttr"; } { return "FOptiAttr"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -92,7 +92,7 @@ class FOptiMove final
~FOptiMove(); ~FOptiMove();
// Accessors // Accessors
const FString getClassName() const; FString getClassName() const;
uInt getCursorHomeLength() const; uInt getCursorHomeLength() const;
uInt getCarriageReturnLength() const; uInt getCarriageReturnLength() const;
uInt getCursorToLLLength() const; uInt getCursorToLLLength() const;
@ -224,7 +224,7 @@ class FOptiMove final
// FOptiMove inline functions // FOptiMove inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FOptiMove::getClassName() const inline FString FOptiMove::getClassName() const
{ return "FOptiMove"; } { return "FOptiMove"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -66,7 +66,7 @@ class FPoint
FPoint& operator -= (const FPoint&); FPoint& operator -= (const FPoint&);
// Accessors // Accessors
virtual const FString getClassName(); virtual FString getClassName();
int getX() const; int getX() const;
int getY() const; int getY() const;
void setX (int); void setX (int);
@ -93,9 +93,9 @@ class FPoint
// Friend operator functions // Friend operator functions
friend bool operator == (const FPoint&, const FPoint&); friend bool operator == (const FPoint&, const FPoint&);
friend bool operator != (const FPoint&, const FPoint&); friend bool operator != (const FPoint&, const FPoint&);
friend const FPoint operator + (const FPoint&, const FPoint&); friend FPoint operator + (const FPoint&, const FPoint&);
friend const FPoint operator - (const FPoint&, const FPoint&); friend FPoint operator - (const FPoint&, const FPoint&);
friend const FPoint operator - (const FPoint&); friend FPoint operator - (const FPoint&);
friend std::ostream& operator << (std::ostream&, const FPoint&); friend std::ostream& operator << (std::ostream&, const FPoint&);
friend std::istream& operator >> (std::istream&, FPoint&); friend std::istream& operator >> (std::istream&, FPoint&);
}; };
@ -121,7 +121,7 @@ inline FPoint::FPoint (int x, int y)
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FPoint::getClassName() inline FString FPoint::getClassName()
{ return "FPoint"; } { return "FPoint"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -155,15 +155,15 @@ inline bool operator != (const FPoint& p1, const FPoint& p2)
{ return p1.xpos != p2.xpos || p1.ypos != p2.ypos; } { return p1.xpos != p2.xpos || p1.ypos != p2.ypos; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint operator + (const FPoint& p1, const FPoint& p2) inline FPoint operator + (const FPoint& p1, const FPoint& p2)
{ return {p1.xpos + p2.xpos, p1.ypos + p2.ypos}; } { return {p1.xpos + p2.xpos, p1.ypos + p2.ypos}; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint operator - (const FPoint& p1, const FPoint& p2) inline FPoint operator - (const FPoint& p1, const FPoint& p2)
{ return {p1.xpos - p2.xpos, p1.ypos - p2.ypos}; } { return {p1.xpos - p2.xpos, p1.ypos - p2.ypos}; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint operator - (const FPoint& p) inline FPoint operator - (const FPoint& p)
{ return {-p.xpos, -p.ypos}; } { return {-p.xpos, -p.ypos}; }
} // namespace finalcut } // namespace finalcut

View File

@ -69,7 +69,7 @@ class FProgressbar : public FWidget
~FProgressbar() override; ~FProgressbar() override;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
std::size_t getPercentage() const; std::size_t getPercentage() const;
// Mutators // Mutators
@ -90,7 +90,7 @@ class FProgressbar : public FWidget
private: private:
// Constants // Constants
static constexpr std::size_t NOT_SET = static_cast<std::size_t>(-1); static constexpr auto NOT_SET = static_cast<std::size_t>(-1);
// Methods // Methods
void init(); void init();
@ -108,7 +108,7 @@ class FProgressbar : public FWidget
// FProgressbar inline functions // FProgressbar inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FProgressbar::getClassName() const inline FString FProgressbar::getClassName() const
{ return "FProgressbar"; } { return "FProgressbar"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -78,7 +78,7 @@ class FRadioButton : public FToggleButton
FRadioButton& operator = (const FRadioButton&) = delete; FRadioButton& operator = (const FRadioButton&) = delete;
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
private: private:
// Methods // Methods
@ -92,7 +92,7 @@ class FRadioButton : public FToggleButton
// FRadioButton inline functions // FRadioButton inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FRadioButton::getClassName() const inline FString FRadioButton::getClassName() const
{ return "FRadioButton"; } { return "FRadioButton"; }
} // namespace finalcut } // namespace finalcut

View File

@ -78,7 +78,7 @@ class FRadioMenuItem : public FMenuItem
FRadioMenuItem& operator = (const FRadioMenuItem&) = delete; FRadioMenuItem& operator = (const FRadioMenuItem&) = delete;
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
private: private:
// Methods // Methods
@ -89,7 +89,7 @@ class FRadioMenuItem : public FMenuItem
// FRadioMenuItem inline functions // FRadioMenuItem inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FRadioMenuItem::getClassName() const inline FString FRadioMenuItem::getClassName() const
{ return "FRadioMenuItem"; } { return "FRadioMenuItem"; }
} // namespace finalcut } // namespace finalcut

View File

@ -74,21 +74,21 @@ class FRect
FRect& operator = (FRect&&) noexcept; FRect& operator = (FRect&&) noexcept;
// Accessors // Accessors
virtual const FString getClassName(); virtual FString getClassName();
int getX1() const; int getX1() const;
int getY1() const; int getY1() const;
int getX2() const; int getX2() const;
int getY2() const; int getY2() const;
int getX() const; int getX() const;
int getY() const; int getY() const;
const FPoint getPos() const; FPoint getPos() const;
const FPoint getUpperLeftPos() const; FPoint getUpperLeftPos() const;
const FPoint getUpperRightPos() const; FPoint getUpperRightPos() const;
const FPoint getLowerLeftPos() const; FPoint getLowerLeftPos() const;
const FPoint getLowerRightPos() const; FPoint getLowerRightPos() const;
std::size_t getWidth() const; std::size_t getWidth() const;
std::size_t getHeight() const; std::size_t getHeight() const;
const FSize getSize() const; FSize getSize() const;
// Mutators // Mutators
void setX1 (int); void setX1 (int);
@ -138,8 +138,8 @@ class FRect
int Y2{-1}; int Y2{-1};
// Friend operator functions // Friend operator functions
friend const FRect operator + (const FRect&, const FSize&); friend FRect operator + (const FRect&, const FSize&);
friend const FRect operator - (const FRect&, const FSize&); friend FRect operator - (const FRect&, const FSize&);
friend bool operator == (const FRect&, const FRect&); friend bool operator == (const FRect&, const FRect&);
friend bool operator != (const FRect&, const FRect&); friend bool operator != (const FRect&, const FRect&);
friend std::ostream& operator << (std::ostream&, const FRect&); friend std::ostream& operator << (std::ostream&, const FRect&);
@ -172,7 +172,7 @@ inline FRect::FRect (int x, int y, std::size_t width, std::size_t height)
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FRect::getClassName() inline FString FRect::getClassName()
{ return "FRect"; } { return "FRect"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -100,7 +100,7 @@ class FScrollbar : public FWidget
FScrollbar& operator = (const FScrollbar&) = delete; FScrollbar& operator = (const FScrollbar&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
int getValue() const; int getValue() const;
sType getScrollType() const; sType getScrollType() const;
@ -203,7 +203,7 @@ void initScrollbar ( FScrollbarPtr& bar
// FScrollbar inline functions // FScrollbar inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FScrollbar::getClassName() const inline FString FScrollbar::getClassName() const
{ return "FScrollbar"; } { return "FScrollbar"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -80,14 +80,14 @@ class FScrollView : public FWidget
FScrollView& operator = (const FScrollView&) = delete; FScrollView& operator = (const FScrollView&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
std::size_t getViewportWidth() const; std::size_t getViewportWidth() const;
std::size_t getViewportHeight() const; std::size_t getViewportHeight() const;
const FSize getViewportSize() const; FSize getViewportSize() const;
std::size_t getScrollWidth() const; std::size_t getScrollWidth() const;
std::size_t getScrollHeight() const; std::size_t getScrollHeight() const;
const FSize getScrollSize() const; FSize getScrollSize() const;
const FPoint getScrollPos() const; FPoint getScrollPos() const;
int getScrollX() const; int getScrollX() const;
int getScrollY() const; int getScrollY() const;
@ -191,7 +191,7 @@ class FScrollView : public FWidget
// FScrollView inline functions // FScrollView inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FScrollView::getClassName() const inline FString FScrollView::getClassName() const
{ return "FScrollView"; } { return "FScrollView"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -203,7 +203,7 @@ inline std::size_t FScrollView::getViewportHeight() const
{ return getHeight() - horizontal_border_spacing; } { return getHeight() - horizontal_border_spacing; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FSize FScrollView::getViewportSize() const inline FSize FScrollView::getViewportSize() const
{ return FSize(getViewportWidth(), getViewportHeight()); } { return FSize(getViewportWidth(), getViewportHeight()); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -215,11 +215,11 @@ inline std::size_t FScrollView::getScrollHeight() const
{ return scroll_geometry.getHeight(); } { return scroll_geometry.getHeight(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FSize FScrollView::getScrollSize() const inline FSize FScrollView::getScrollSize() const
{ return scroll_geometry.getSize(); } { return scroll_geometry.getSize(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FPoint FScrollView::getScrollPos() const inline FPoint FScrollView::getScrollPos() const
{ return viewport_geometry.getPos(); } { return viewport_geometry.getPos(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -71,7 +71,7 @@ class FSize
FSize& operator -= (const FSize&); FSize& operator -= (const FSize&);
// Accessors // Accessors
virtual const FString getClassName(); virtual FString getClassName();
std::size_t getWidth() const; std::size_t getWidth() const;
std::size_t getHeight() const; std::size_t getHeight() const;
std::size_t getArea() const; std::size_t getArea() const;
@ -103,8 +103,8 @@ class FSize
friend bool operator != (const FSize&, const FSize&); friend bool operator != (const FSize&, const FSize&);
friend bool operator >= (const FSize&, const FSize&); friend bool operator >= (const FSize&, const FSize&);
friend bool operator > (const FSize&, const FSize&); friend bool operator > (const FSize&, const FSize&);
friend const FSize operator + (const FSize&, const FSize&); friend FSize operator + (const FSize&, const FSize&);
friend const FSize operator - (const FSize&, const FSize&); friend FSize operator - (const FSize&, const FSize&);
friend std::ostream& operator << (std::ostream&, const FSize&); friend std::ostream& operator << (std::ostream&, const FSize&);
friend std::istream& operator >> (std::istream&, FSize&); friend std::istream& operator >> (std::istream&, FSize&);
@ -130,7 +130,7 @@ inline FSize::FSize (std::size_t w, std::size_t h)
{ } { }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FSize::getClassName() inline FString FSize::getClassName()
{ return "FSize"; } { return "FSize"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -180,7 +180,7 @@ inline bool operator > (const FSize& s1, const FSize& s2)
{ return s1.width > s2.width && s1.height > s2.height; } { return s1.width > s2.width && s1.height > s2.height; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FSize operator + (const FSize& s1, const FSize& s2) inline FSize operator + (const FSize& s1, const FSize& s2)
{ {
constexpr std::size_t max = std::numeric_limits<std::size_t>::max(); constexpr std::size_t max = std::numeric_limits<std::size_t>::max();
const std::size_t w = ( s1.width < max - s2.width) ? s1.width + s2.width : max; const std::size_t w = ( s1.width < max - s2.width) ? s1.width + s2.width : max;
@ -189,7 +189,7 @@ inline const FSize operator + (const FSize& s1, const FSize& s2)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FSize operator - (const FSize& s1, const FSize& s2) inline FSize operator - (const FSize& s1, const FSize& s2)
{ {
const std::size_t w = ( s1.width >= s2.width ) ? s1.width - s2.width : 0; const std::size_t w = ( s1.width >= s2.width ) ? s1.width - s2.width : 0;
const std::size_t h = ( s1.height >= s2.height ) ? s1.height - s2.height : 0; const std::size_t h = ( s1.height >= s2.height ) ? s1.height - s2.height : 0;

View File

@ -80,7 +80,7 @@ class FSpinBox : public FWidget
FSpinBox& operator = (const FSpinBox&) = delete; FSpinBox& operator = (const FSpinBox&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
sInt64 getValue() const; sInt64 getValue() const;
FString getPrefix() const; FString getPrefix() const;
FString getSuffix() const; FString getSuffix() const;
@ -161,7 +161,7 @@ class FSpinBox : public FWidget
// FSpinBox inline functions // FSpinBox inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FSpinBox::getClassName() const inline FString FSpinBox::getClassName() const
{ return "FSpinBox"; } { return "FSpinBox"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -65,7 +65,7 @@ class FStartOptions final
FStartOptions& operator = (const FStartOptions&) = delete; FStartOptions& operator = (const FStartOptions&) = delete;
// Accessors // Accessors
static const FString getClassName(); static FString getClassName();
static FStartOptions& getFStartOptions(); static FStartOptions& getFStartOptions();
// Mutator // Mutator
@ -102,7 +102,7 @@ class FStartOptions final
}; };
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FStartOptions::getClassName() inline FString FStartOptions::getClassName()
{ return "FStartOptions"; } { return "FStartOptions"; }
} // namespace finalcut } // namespace finalcut

View File

@ -87,7 +87,7 @@ class FStatusKey : public FWidget
FStatusKey& operator = (const FStatusKey&) = delete; FStatusKey& operator = (const FStatusKey&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
virtual FKey getKey() const; virtual FKey getKey() const;
virtual FString getText() const; virtual FString getText() const;
@ -128,7 +128,7 @@ class FStatusKey : public FWidget
// FStatusKey inline functions // FStatusKey inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FStatusKey::getClassName() const inline FString FStatusKey::getClassName() const
{ return "FStatusKey"; } { return "FStatusKey"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -196,7 +196,7 @@ class FStatusBar : public FWindow
FStatusBar& operator = (const FStatusBar&) = delete; FStatusBar& operator = (const FStatusBar&) = delete;
// Accessors // Accessors
const FString getClassName() const override; FString getClassName() const override;
FStatusKey* getStatusKey (int) const; FStatusKey* getStatusKey (int) const;
FString getMessage() const; FString getMessage() const;
std::size_t getCount() const; std::size_t getCount() const;
@ -255,7 +255,7 @@ class FStatusBar : public FWindow
// FStatusBar inline functions // FStatusBar inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FStatusBar::getClassName() const inline FString FStatusBar::getClassName() const
{ return "FStatusBar"; } { return "FStatusBar"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -159,7 +159,7 @@ class FString
operator const char* () const { return c_str(); } operator const char* () const { return c_str(); }
// Accessor // Accessor
virtual const FString getClassName() const; virtual FString getClassName() const;
// inquiries // inquiries
bool isNull() const; bool isNull() const;
@ -185,10 +185,10 @@ class FString
wchar_t* wc_str(); wchar_t* wc_str();
const char* c_str() const; const char* c_str() const;
char* c_str(); char* c_str();
const std::string toString() const; std::string toString() const;
const FString toLower() const; FString toLower() const;
const FString toUpper() const; FString toUpper() const;
sInt16 toShort() const; sInt16 toShort() const;
uInt16 toUShort() const; uInt16 toUShort() const;
@ -199,13 +199,13 @@ class FString
float toFloat() const; float toFloat() const;
double toDouble() const; double toDouble() const;
const FString ltrim() const; FString ltrim() const;
const FString rtrim() const; FString rtrim() const;
const FString trim() const; FString trim() const;
const FString left (std::size_t) const; FString left (std::size_t) const;
const FString right (std::size_t) const; FString right (std::size_t) const;
const FString mid (std::size_t, std::size_t) const; FString mid (std::size_t, std::size_t) const;
FStringList split (const FString&) const; FStringList split (const FString&) const;
FString& setString (const FString&); FString& setString (const FString&);
@ -224,10 +224,10 @@ class FString
const FString& insert (const FString&, int); const FString& insert (const FString&, int);
const FString& insert (const FString&, std::size_t); const FString& insert (const FString&, std::size_t);
const FString replace (const FString&, const FString&) const; FString replace (const FString&, const FString&) const;
const FString replaceControlCodes() const; FString replaceControlCodes() const;
const FString expandTabs (int = 8) const; FString expandTabs (int = 8) const;
FString removeDel() const; FString removeDel() const;
FString removeBackspaces() const; FString removeBackspaces() const;
@ -261,15 +261,15 @@ class FString
static const wchar_t const_null_char; static const wchar_t const_null_char;
// Friend Non-member operator functions // Friend Non-member operator functions
friend const FString operator + (const FString&, const FString&); friend FString operator + (const FString&, const FString&);
friend const FString operator + (const FString&, const wchar_t); friend FString operator + (const FString&, const wchar_t);
friend const FString operator + (const std::wstring&, const FString&); friend FString operator + (const std::wstring&, const FString&);
friend const FString operator + (const wchar_t[], const FString&); friend FString operator + (const wchar_t[], const FString&);
friend const FString operator + (const std::string&, const FString&); friend FString operator + (const std::string&, const FString&);
friend const FString operator + (const char[], const FString&); friend FString operator + (const char[], const FString&);
friend const FString operator + (const wchar_t, const FString&); friend FString operator + (const wchar_t, const FString&);
friend const FString operator + (const char, const FString&); friend FString operator + (const char, const FString&);
friend const FString operator + (const FString&, const char); friend FString operator + (const FString&, const char);
friend std::ostream& operator << (std::ostream&, const FString&); friend std::ostream& operator << (std::ostream&, const FString&);
friend std::istream& operator >> (std::istream&, FString& s); friend std::istream& operator >> (std::istream&, FString& s);
@ -366,7 +366,7 @@ inline bool FString::operator > (const CharT& s) const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FString::getClassName() const inline FString FString::getClassName() const
{ return "FString"; } { return "FString"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -80,7 +80,7 @@ class FStringStream : public std::wiostream
// Move assignment operator (=) // Move assignment operator (=)
FStringStream& operator = (FStringStream&& sstream) noexcept; FStringStream& operator = (FStringStream&& sstream) noexcept;
virtual const FString getClassName() const; virtual FString getClassName() const;
void swap (FStringStream&) noexcept; void swap (FStringStream&) noexcept;
void clear(); void clear();
std::wstringbuf* rdbuf() const; std::wstringbuf* rdbuf() const;
@ -93,7 +93,7 @@ class FStringStream : public std::wiostream
// FStringStream inline functions // FStringStream inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FStringStream::getClassName() const inline FString FStringStream::getClassName() const
{ return "FStringStream"; } { return "FStringStream"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -70,7 +70,7 @@ class FStyle
} }
// Accessor // Accessor
const FString getClassName() const FString getClassName() const
{ return "FStyle"; } { return "FStyle"; }
FColor getStyle() const FColor getStyle() const

View File

@ -78,7 +78,7 @@ class FSwitch : public FToggleButton
FSwitch& operator = (const FSwitch&) = delete; FSwitch& operator = (const FSwitch&) = delete;
// Accessor // Accessor
const FString getClassName() const override; FString getClassName() const override;
// Mutator // Mutator
void setText (const FString&) override; void setText (const FString&) override;
@ -102,7 +102,7 @@ class FSwitch : public FToggleButton
// FSwitch inline functions // FSwitch inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FSwitch::getClassName() const inline FString FSwitch::getClassName() const
{ return "FSwitch"; } { return "FSwitch"; }
} // namespace finalcut } // namespace finalcut

View File

@ -178,10 +178,10 @@ class FTerm final
FTerm& operator = (const FTerm&) = delete; FTerm& operator = (const FTerm&) = delete;
// Accessors // Accessors
static const FString getClassName(); static FString getClassName();
static std::size_t getLineNumber(); static std::size_t getLineNumber();
static std::size_t getColumnNumber(); static std::size_t getColumnNumber();
static const FString getKeyName (FKey); static FString getKeyName (FKey);
static int getTTYFileDescriptor(); static int getTTYFileDescriptor();
static const char* getTermType(); static const char* getTermType();
static const char* getTermFileName(); static const char* getTermFileName();
@ -406,9 +406,9 @@ bool isReverseNewFontchar (wchar_t);
bool hasFullWidthSupports(); bool hasFullWidthSupports();
wchar_t cp437_to_unicode (uChar); wchar_t cp437_to_unicode (uChar);
uChar unicode_to_cp437 (wchar_t); uChar unicode_to_cp437 (wchar_t);
const FString getFullWidth (const FString&); FString getFullWidth (const FString&);
const FString getHalfWidth (const FString&); FString getHalfWidth (const FString&);
const FString getColumnSubString (const FString&, std::size_t, std::size_t); FString getColumnSubString (const FString&, std::size_t, std::size_t);
std::size_t getLengthFromColumnWidth (const FString&, std::size_t); std::size_t getLengthFromColumnWidth (const FString&, std::size_t);
std::size_t getColumnWidth (const FString&, std::size_t); std::size_t getColumnWidth (const FString&, std::size_t);
std::size_t getColumnWidth (const FString&); std::size_t getColumnWidth (const FString&);
@ -419,7 +419,7 @@ std::size_t getColumnWidth (const FTermBuffer&);
// FTerm inline functions // FTerm inline functions
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FString FTerm::getClassName() inline FString FTerm::getClassName()
{ return "FTerm"; } { return "FTerm"; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -462,7 +462,7 @@ inline void FTerm::putstringf (const char format[], Args&&... args)
if ( ! fsys ) if ( ! fsys )
getFSystem(); // Trying to set fsys getFSystem(); // Trying to set fsys
const std::size_t count = std::size_t(size); const auto count = std::size_t(size);
std::vector<char> buf(count); std::vector<char> buf(count);
std::snprintf (&buf[0], count, format, std::forward<Args>(args)...); std::snprintf (&buf[0], count, format, std::forward<Args>(args)...);

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