Debian Codegraph @

foned/FunctionArea.h

raw symbols SCIP
1 #cxx . . $ `<file>/foned/FunctionArea.h`/ifndef _FunctionArea_h_
2 #define _FunctionArea_h_cxx . . $ `foned/FunctionArea.h:2:9`!
3 /* FunctionArea.h
4 *
5 * Copyright (C) 1992-2005,2007-2012,2015-2018,2020-2022 Paul Boersma
6 *
7 * This code is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This code is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this work. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "DataGui.h"cxx . . $ `<file>/sys/DataGui.h`/
22 #include "FunctionEditor.h"cxx . . $ `<file>/foned/FunctionEditor.h`/
23
24 Thing_definecxx . . $ autoSomeThing# (FunctionArea, DataGui) {
25 /*
26 Accessors.
27 */
28 public: // all readonly
29 Functioncxx . . $ Function# functioncxx . . $ structFunctionArea#function(8985a8e07d4255bd).() const { Thing_castcxx . . $ structDataGui#data(e8441e10bf3a9c6e). (Function, function, ourcxx . . $ `melder/melder.h:42:9`! data()); return function; }
30 FunctionEditorcxx . . $ FunctionEditor# functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() const { Thing_castcxx . . $ `sys/Thing.h:246:9`! (FunctionEditor, functionEditor, ourcxx . . $ `melder/melder.h:42:9`! boss()); return functionEditor; }
31 double startWindowcxx . . $ structFunctionArea#startWindow(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> startWindowcxx . . $ structFunctionEditor#startWindow.; }
32 double endWindowcxx . . $ structFunctionArea#endWindow(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> endWindowcxx . . $ structFunctionEditor#endWindow.; }
33 double startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> startSelectioncxx . . $ structFunctionEditor#startSelection.; }
34 double endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> endSelectioncxx . . $ structFunctionEditor#endSelection.; }
35 double tmincxx . . $ structFunctionArea#tmin(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> tmincxx . . $ structFunctionEditor#tmin.; }
36 double tmaxcxx . . $ structFunctionArea#tmax(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> tmaxcxx . . $ structFunctionEditor#tmax.; }
37 Graphicscxx . . $ Graphics# graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> graphicscxx . . $ structFunctionEditor#graphics..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(); }
38
39 /*
40 Initialization.
41 */
42 public:
43 friend void FunctionArea_initcxx . . $ FunctionArea_init(fcb57ab2b3c1d4b0). (FunctionAreacxx . . $ FunctionArea# me, bool editable, Functioncxx . . $ Function# optionalFunctionToCopy, FunctionEditorcxx . . $ FunctionEditor# boss) {
44 DataGui_initcxx . . $ DataGui_init(9b97872e44568997). (me, nullptr, editable, boss);
45 mycxx . . $ `melder/melder.h:44:9`! _optionalFunctionCopycxx . . $ structFunctionArea#_optionalFunctionCopy. =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). Data_copycxx . . $ Data_copy(97a542a26794c80e). (optionalFunctionToCopy);
46 }
47 bool functionHasBeenCopiedcxx . . $ structFunctionArea#functionHasBeenCopied(c9857a73d68e59ba). () {
48 return !! ourcxx . . $ `melder/melder.h:42:9`! _optionalFunctionCopycxx . . $ structFunctionArea#_optionalFunctionCopy.;
49 }
50 private:
51 autoFunctioncxx . . $ autoFunction# _optionalFunctionCopycxx . . $ structFunctionArea#_optionalFunctionCopy.;
52
53 public:
54 void functionChangedcxx . . $ structFunctionArea#functionChanged(18c8ee0a6873bee4). (Functioncxx . . $ Function# newFunction) {
55 ourcxx . . $ `melder/melder.h:42:9`! setDatacxx . . $ structDataGui#setData(fde123624714e72). (ourcxx . . $ `melder/melder.h:42:9`! _optionalFunctionCopycxx . . $ structFunctionArea#_optionalFunctionCopy. ? ourcxx . . $ `melder/melder.h:42:9`! _optionalFunctionCopycxx . . $ structFunctionArea#_optionalFunctionCopy..getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).() : newFunction);
56 ourcxx . . $ `melder/melder.h:42:9`! v_invalidateAllDerivedDataCachescxx . . $ structFunctionArea#v_invalidateAllDerivedDataCaches(49f6e7a06ebc5aa8). ();
57 ourcxx . . $ `melder/melder.h:42:9`! v_computeAuxiliaryDatacxx . . $ structFunctionArea#v_computeAuxiliaryData(49f6e7a06ebc5aa8). ();
58 }
59 void invalidateAllDerivedDataCachescxx . . $ structFunctionArea#invalidateAllDerivedDataCaches(49f6e7a06ebc5aa8). () {
60 ourcxx . . $ `melder/melder.h:42:9`! v_invalidateAllDerivedDataCachescxx . . $ structFunctionArea#v_invalidateAllDerivedDataCaches(49f6e7a06ebc5aa8). ();
61 }
62 virtual void v_windowChangedcxx . . $ structFunctionArea#v_windowChanged(49f6e7a06ebc5aa8). () { }
63
64 protected:
65 virtual void v_invalidateAllDerivedDataCachescxx . . $ structFunctionArea#v_invalidateAllDerivedDataCaches(49f6e7a06ebc5aa8). () { } // derived classes can call inherited at end
66 virtual void v_computeAuxiliaryDatacxx . . $ structFunctionArea#v_computeAuxiliaryData(49f6e7a06ebc5aa8). () { } // derived classes can call inherited at start
67
68 public:
69 /*
70 To be called just before drawing or tracking:
71 */
72 void setGlobalYRange_fractioncxx . . $ structFunctionArea#setGlobalYRange_fraction(bc12c9ec15586e6a). (double ymin_fraction, double ymax_fraction) {
73 ourcxx . . $ `melder/melder.h:42:9`! _ymin_fractioncxx . . $ structFunctionArea#_ymin_fraction. = ymin_fraction;
74 ourcxx . . $ `melder/melder.h:42:9`! _ymax_fractioncxx . . $ structFunctionArea#_ymax_fraction. = ymax_fraction;
75 }
76 /*
77 FunctionArea_setViewport() is used both for drawing and for mousing.
78 */
79 friend void FunctionArea_setViewportcxx . . $ FunctionArea_setViewport(e9e5ddf62bc86a1a). (constFunctionAreacxx . . $ constFunctionArea# me) {
80 Graphics_setViewportcxx . . $ Graphics_setViewport(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), mycxx . . $ `melder/melder.h:44:9`! left_pxltcxx . . $ structFunctionArea#left_pxlt(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! right_pxltcxx . . $ structFunctionArea#right_pxlt(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! bottom_pxltcxx . . $ structFunctionArea#bottom_pxlt(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! top_pxltcxx . . $ structFunctionArea#top_pxlt(21b6c25e127938e2).());
81 }
82 friend void FunctionArea_drawOnecxx . . $ FunctionArea_drawOne(88b39197b202d92f). (FunctionAreacxx . . $ FunctionArea# me) {
83 FunctionArea_prepareCanvascxx . . $ FunctionArea_prepareCanvas(88b39197b202d92f). (me);
84 FunctionArea_drawInsidecxx . . $ FunctionArea_drawInside(88b39197b202d92f). (me);
85 }
86 friend void FunctionArea_drawTwocxx . . $ FunctionArea_drawTwo(7a6077e804b01a0a). (FunctionAreacxx . . $ FunctionArea# me, FunctionAreacxx . . $ FunctionArea# you) {
87 FunctionArea_prepareCanvascxx . . $ FunctionArea_prepareCanvas(88b39197b202d92f). (me);
88 FunctionArea_drawInsidecxx . . $ FunctionArea_drawInside(88b39197b202d92f). (me);
89 FunctionArea_drawInsidecxx . . $ FunctionArea_drawInside(88b39197b202d92f). (you);
90 }
91 friend void FunctionArea_prepareCanvascxx . . $ FunctionArea_prepareCanvas(88b39197b202d92f). (FunctionAreacxx . . $ FunctionArea# me) {
92 FunctionArea_setViewportcxx . . $ FunctionArea_setViewport(e9e5ddf62bc86a1a). (me);
93 FunctionArea_drawBackgroundcxx . . $ FunctionArea_drawBackground(e9e5ddf62bc86a1a). (me);
94 }
95 friend void FunctionArea_drawInsidecxx . . $ FunctionArea_drawInside(88b39197b202d92f). (FunctionAreacxx . . $ FunctionArea# me) {
96 mycxx . . $ `melder/melder.h:44:9`! v_drawInsidecxx . . $ structFunctionArea#v_drawInside(49f6e7a06ebc5aa8). ();
97 }
98 friend void FunctionArea_drawBackgroundcxx . . $ FunctionArea_drawBackground(e9e5ddf62bc86a1a). (constFunctionAreacxx . . $ constFunctionArea# me) {
99 FunctionArea_eraseBackgroundcxx . . $ FunctionArea_eraseBackground(e9e5ddf62bc86a1a). (me);
100 FunctionArea_highlightSelectionBackgroundcxx . . $ FunctionArea_highlightSelectionBackground(e9e5ddf62bc86a1a). (me);
101 FunctionArea_drawFramecxx . . $ FunctionArea_drawFrame(e9e5ddf62bc86a1a). (me);
102 }
103 friend void FunctionArea_eraseBackgroundcxx . . $ FunctionArea_eraseBackground(e9e5ddf62bc86a1a). (constFunctionAreacxx . . $ constFunctionArea# me) {
104 Graphics_setWindowcxx . . $ Graphics_setWindow(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 0.0, 1.0, 0.0, 1.0);
105 Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), DataGuiColour_AREA_BACKGROUNDcxx . . $ DataGuiColour_AREA_BACKGROUND.);
106 Graphics_fillRectanglecxx . . $ Graphics_fillRectangle(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 0.0, 1.0, 0.0, 1.0);
107 Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), DataGuiColour_NONEDITABLEcxx . . $ DataGuiColour_NONEDITABLE.);
108 }
109 friend void FunctionArea_highlightSelectionBackgroundcxx . . $ FunctionArea_highlightSelectionBackground(e9e5ddf62bc86a1a). (constFunctionAreacxx . . $ constFunctionArea# me) {
110 Graphics_setWindowcxx . . $ Graphics_setWindow(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionArea#startWindow(21b6c25e127938e2).(), mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionArea#endWindow(21b6c25e127938e2).(), 0.0, 1.0);
111 mycxx . . $ `melder/melder.h:44:9`! v_specializedHighlightBackgroundcxx . . $ structFunctionArea#v_specializedHighlightBackground(83f5f38750778ac8). ();
112 double left = mycxx . . $ `melder/melder.h:44:9`! startSelectioncxx . . $ structFunctionArea#startSelection(21b6c25e127938e2).(), right = mycxx . . $ `melder/melder.h:44:9`! endSelectioncxx . . $ structFunctionArea#endSelection(21b6c25e127938e2).();
113 if (left < right && left < mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionArea#endWindow(21b6c25e127938e2).() && right > mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionArea#startWindow(21b6c25e127938e2).()) {
114 Melder_clipLeftcxx . . $ Melder_clipLeft(6245cd023a7d1552). (mycxx . . $ `melder/melder.h:44:9`! startWindowcxx . . $ structFunctionArea#startWindow(21b6c25e127938e2).(), & left);
115 Melder_clipRightcxx . . $ Melder_clipRight(5b63ce711df1ade7). (& right, mycxx . . $ `melder/melder.h:44:9`! endWindowcxx . . $ structFunctionArea#endWindow(21b6c25e127938e2).());
116 Graphics_highlightcxx . . $ Graphics_highlight(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), left, right, 0.0, 1.0);
117 }
118 }
119 friend void FunctionArea_drawFramecxx . . $ FunctionArea_drawFrame(e9e5ddf62bc86a1a). (constFunctionAreacxx . . $ constFunctionArea# me) {
120 Graphics_setWindowcxx . . $ Graphics_setWindow(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 0.0, 1.0, 0.0, 1.0);
121 if (mycxx . . $ `melder/melder.h:44:9`! editablecxx . . $ structDataGui#editable(50ce9a9e25b4a850).()) {
122 Graphics_setLineWidthcxx . . $ Graphics_setLineWidth(2514a1c07b6be5e2). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 2.0);
123 Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), DataGuiColour_EDITABLE_FRAMEcxx . . $ DataGuiColour_EDITABLE_FRAME.);
124 } else {
125 Graphics_setLineWidthcxx . . $ Graphics_setLineWidth(2514a1c07b6be5e2). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 1.0);
126 Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), DataGuiColour_NONEDITABLE_FRAMEcxx . . $ DataGuiColour_NONEDITABLE_FRAME.);
127 }
128 Graphics_rectanglecxx . . $ Graphics_rectangle(72bdb7937dbb13da). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 0.0, 1.0, 0.0, 1.0);
129 Graphics_setColourcxx . . $ Graphics_setColour(eb47b9513d3f4721). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), DataGuiColour_NONEDITABLEcxx . . $ DataGuiColour_NONEDITABLE.);
130 Graphics_setLineWidthcxx . . $ Graphics_setLineWidth(2514a1c07b6be5e2). (mycxx . . $ `melder/melder.h:44:9`! graphicscxx . . $ structFunctionArea#graphics(5af6864da672d398).(), 1.0);
131 }
132 friend void FunctionArea_drawRightMarkcxx . . $ FunctionArea_drawRightMark(df9b3f4958966f01). (FunctionAreacxx . . $ FunctionArea# me, double yWC, conststring32cxx . . $ conststring32# yWC_string, conststring32cxx . . $ conststring32# units, int verticalAlignment);
133 friend void FunctionArea_drawLegend_cxx . . $ FunctionArea_drawLegend_(b4cb387346b51cd7). (FunctionAreacxx . . $ FunctionArea# me,
134 conststring32cxx . . $ conststring32# cattableText1, MelderColourcxx . . $ MelderColour# colour1,
135 conststring32cxx . . $ conststring32# cattableText2, MelderColourcxx . . $ MelderColour# colour2,
136 conststring32cxx . . $ conststring32# cattableText3, MelderColourcxx . . $ MelderColour# colour3,
137 conststring32cxx . . $ conststring32# cattableText4, MelderColourcxx . . $ MelderColour# colour4
138 );
139
140 private:
141 virtual void v_specializedHighlightBackgroundcxx . . $ structFunctionArea#v_specializedHighlightBackground(83f5f38750778ac8). () const { }
142 protected:
143 virtual void v_drawInsidecxx . . $ structFunctionArea#v_drawInside(49f6e7a06ebc5aa8). () { }
144 public:
145 void setSelectioncxx . . $ structFunctionArea#setSelection(bc12c9ec15586e6a). (double startSelection, double endSelection) {
146 Melder_sortcxx . . $ Melder_sort(80e3bfca93a78d58). (& startSelection, & endSelection);
147 ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> startSelectioncxx . . $ structFunctionEditor#startSelection. = startSelection;
148 ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> endSelectioncxx . . $ structFunctionEditor#endSelection. = endSelection;
149 }
150 bool isClickAnchorcxx . . $ structFunctionArea#isClickAnchor. = false;
151 bool y_fraction_globalIsInsidecxx . . $ structFunctionArea#y_fraction_globalIsInside(b32f3370ca1a96a1). (double globalY_fraction) const {
152 const double y_pxlt = globalY_fraction_to_pxltcxx . . $ structFunctionArea#globalY_fraction_to_pxlt(7e3a3c6b59947c6d). (globalY_fraction);
153 return y_pxlt >= ourcxx . . $ `melder/melder.h:42:9`! bottom_pxltcxx . . $ structFunctionArea#bottom_pxlt(21b6c25e127938e2).() && y_pxlt < ourcxx . . $ `melder/melder.h:42:9`! top_pxltcxx . . $ structFunctionArea#top_pxlt(21b6c25e127938e2).();
154 }
155 double y_fraction_globalToLocalcxx . . $ structFunctionArea#y_fraction_globalToLocal(7e3a3c6b59947c6d). (double globalY_fraction) const {
156 const double y_pxlt = globalY_fraction_to_pxltcxx . . $ structFunctionArea#globalY_fraction_to_pxlt(7e3a3c6b59947c6d). (globalY_fraction);
157 return (y_pxlt - ourcxx . . $ `melder/melder.h:42:9`! bottom_pxltcxx . . $ structFunctionArea#bottom_pxlt(21b6c25e127938e2).()) / (ourcxx . . $ `melder/melder.h:42:9`! top_pxltcxx . . $ structFunctionArea#top_pxlt(21b6c25e127938e2).() - ourcxx . . $ `melder/melder.h:42:9`! bottom_pxltcxx . . $ structFunctionArea#bottom_pxlt(21b6c25e127938e2).());
158 }
159 double functionViewerRight_WCcxx . . $ structFunctionArea#functionViewerRight_WC(21b6c25e127938e2). () const {
160 return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> functionViewerRight_WCcxx . . $ structFunctionEditor#functionViewerRight_WC(21b6c25e127938e2).();
161 }
162 private:
163 double _ymin_fractioncxx . . $ structFunctionArea#_ymin_fraction., _ymax_fractioncxx . . $ structFunctionArea#_ymax_fraction.;
164 double globalY_fraction_to_pxltcxx . . $ structFunctionArea#globalY_fraction_to_pxlt(7e3a3c6b59947c6d). (double globalY_fraction) const {
165 return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> dataBottom_pxltcxx . . $ structFunctionEditor#dataBottom_pxlt(21b6c25e127938e2).() +
166 globalY_fraction * (ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> dataTop_pxltcxx . . $ structFunctionEditor#dataTop_pxlt(21b6c25e127938e2).() - ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> dataBottom_pxltcxx . . $ structFunctionEditor#dataBottom_pxlt(21b6c25e127938e2).());
167 }
168 double left_pxltcxx . . $ structFunctionArea#left_pxlt(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> dataLeft_pxltcxx . . $ structFunctionEditor#dataLeft_pxlt(21b6c25e127938e2).(); }
169 double right_pxltcxx . . $ structFunctionArea#right_pxlt(21b6c25e127938e2).() const { return ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).() -> dataRight_pxltcxx . . $ structFunctionEditor#dataRight_pxlt(21b6c25e127938e2).(); }
170 double bottom_pxltcxx . . $ structFunctionArea#bottom_pxlt(21b6c25e127938e2).() const {
171 return globalY_fraction_to_pxltcxx . . $ structFunctionArea#globalY_fraction_to_pxlt(7e3a3c6b59947c6d). (_ymin_fractioncxx . . $ structFunctionArea#_ymin_fraction.);
172 }
173 double top_pxltcxx . . $ structFunctionArea#top_pxlt(21b6c25e127938e2).() const {
174 constexpr double legendMargin = 23.0;
175 return globalY_fraction_to_pxltcxx . . $ structFunctionArea#globalY_fraction_to_pxlt(7e3a3c6b59947c6d). (ourcxx . . $ `melder/melder.h:42:9`! _ymax_fractioncxx . . $ structFunctionArea#_ymax_fraction.) - legendMargin;
176 }
177 public:
178 virtual void v_form_pictureSelectioncxx . . $ structFunctionArea#v_form_pictureSelection(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand#);
179 virtual void v_ok_pictureSelectioncxx . . $ structFunctionArea#v_ok_pictureSelection(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand#);
180 virtual void v_do_pictureSelectioncxx . . $ structFunctionArea#v_do_pictureSelection(2b98fae8e13abb61). (EditorCommandcxx . . $ EditorCommand#);
181
182 virtual bool v_mousecxx . . $ structFunctionArea#v_mouse(3d5a26054778c78d). (GuiDrawingArea_MouseEventcxx . . $ GuiDrawingArea_MouseEvent# event, double x_world, double localY_fraction) {
183 (void) localY_fraction;
184 return FunctionEditor_defaultMouseInWideDataViewcxx . . $ FunctionEditor_defaultMouseInWideDataView(f60eeae5fe5430ba). (ourcxx . . $ `melder/melder.h:42:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).(), event, x_world);
185 }
186
187 public:
188 /*
189 The data handling functions assume that editable functions
190 are identical to or part of the data of the editor,
191 hence that if the function changes, the data has changed.
192 */
193 friend void FunctionArea_savecxx . . $ FunctionArea_save(7511dfaa04acd353). (FunctionAreacxx . . $ FunctionArea# me, conststring32cxx . . $ conststring32# undoText) {
194 Melder_assertcxx . . $ structDataGui#editable(50ce9a9e25b4a850). (mycxx . . $ `melder/melder.h:44:9`! editable());
195 Editor_savecxx . . $ Editor_save(ed6f6b1571b749af). (mycxx . . $ `melder/melder.h:44:9`! functionEditorcxx . . $ structFunctionArea#functionEditor(985d6162d6c279b).(), undoText);
196 }
197 friend void FunctionArea_broadcastDataChangedcxx . . $ FunctionArea_broadcastDataChanged(88b39197b202d92f). (FunctionAreacxx . . $ FunctionArea# me) {
198 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (mycxx . . $ `melder/melder.h:44:9`! editable());
199 Editor_broadcastDataChangedcxx . . $ Editor_broadcastDataChanged(c0154a85f79216c7). (mycxx . . $ `melder/melder.h:44:9`! bosscxx . . $ structDataGui#boss(ebca83c96e4202ef).());
200 }
201
202 virtual double maximumInitialLengthOfWindowcxx . . $ structFunctionArea#maximumInitialLengthOfWindow(31fa7155c10fdd13).() { return undefinedcxx . . $ undefined.; }
203
204 virtual void v_updateTextcxx . . $ structFunctionArea#v_updateText(49f6e7a06ebc5aa8). () { }
205
206 #include "FunctionArea_prefs.h"cxx . . $ `<file>/foned/FunctionArea_prefs.h`/
207 };
208
209 #define DEFINE_FunctionAreacxx . . $ `foned/FunctionArea.h:209:9`!(which, FunctionAreaType, variableName) \
210 auto##FunctionAreaType & variableName() { \
211 return * reinterpret_cast <auto##FunctionAreaType *> (& ourcxx . . $ `melder/melder.h:42:9`! functionAreas [which]); \
212 }
213
214 #define DEFINE_FunctionArea_createcxx . . $ `foned/FunctionArea.h:214:9`!(FunctionAreaType, FunctionType) \
215 inline auto##FunctionAreaType FunctionAreaType##_create (bool editable, FunctionType functionToCopy, FunctionEditor boss) { \
216 auto##FunctionAreaType me = Thing_newcxx . . $ `sys/Thing.h:514:9`! (FunctionAreaType); \
217 FunctionArea_init (me.get(), editable, functionToCopy, boss); \
218 return me; \
219 }
220
221 typedef MelderCallbackcxx . . $ MelderCallback# <void, structFunctionAreacxx . . $ structFunctionArea#, EditorCommandcxx . . $ EditorCommand#, UiFormcxx . . $ UiForm#, integercxx . . $ integer# /*narg*/, Stackelcxx . . $ Stackel# /*args*/, conststring32cxx . . $ conststring32#,
222 Interpretercxx . . $ Interpreter#> FunctionAreaCommandCallbackcxx . . $ FunctionAreaCommandCallback#;
223
224 GuiMenuItemcxx . . $ GuiMenuItem# FunctionAreaMenu_addCommandcxx . . $ FunctionAreaMenu_addCommand(e6bf179389aae652). (EditorMenucxx . . $ EditorMenu# me, conststring32cxx . . $ conststring32# itemTitle /* cattable */, uint32cxx . . $ uint32# flags,
225 FunctionAreaCommandCallbackcxx . . $ FunctionAreaCommandCallback# commandCallback, FunctionAreacxx . . $ FunctionArea# commandBoss);
226
227 #if defined (macintosh)
228 #define FunctionArea_legend_LINES U"—"
229 #define FunctionArea_legend_SPECKLES U"• •"
230 #define FunctionArea_legend_LINES_SPECKLES U"–\\s{●}–"
231 #define FunctionArea_legend_POLES U" ⃒ ⃒ ⃒"
232 #define FunctionArea_legend_WAVEFORM U"\u301C"
233 #define FunctionArea_legend_GREYS U"\\s{▩}"
234 #define FunctionArea_legend_TEXTGRID U"☵"
235 #elif defined (_WIN32)
236 #define FunctionArea_legend_LINES U"—"
237 #define FunctionArea_legend_SPECKLES U"\\s{• •}"
238 #define FunctionArea_legend_LINES_SPECKLES U"–●–"
239 #define FunctionArea_legend_POLES U"|||"
240 #define FunctionArea_legend_WAVEFORM U"~"
241 #define FunctionArea_legend_GREYS U"\\s{▒}"
242 #define FunctionArea_legend_TEXTGRID U"☵"
243 #else
244 #define FunctionArea_legend_LINEScxx . . $ `foned/FunctionArea.h:244:10`! U"—"
245 #define FunctionArea_legend_SPECKLEScxx . . $ `foned/FunctionArea.h:245:10`! U"• •"
246 #define FunctionArea_legend_LINES_SPECKLEScxx . . $ `foned/FunctionArea.h:246:10`! U"–●–"
247 #define FunctionArea_legend_POLEScxx . . $ `foned/FunctionArea.h:247:10`! U"|||"
248 #define FunctionArea_legend_WAVEFORMcxx . . $ `foned/FunctionArea.h:248:10`! U"\u301C"
249 #define FunctionArea_legend_GREYScxx . . $ `foned/FunctionArea.h:249:10`! U"\\s{▒}"
250 #define FunctionArea_legend_TEXTGRIDcxx . . $ `foned/FunctionArea.h:250:10`! U"☵"
251 #endif
252
253 inline void FunctionArea_drawLegendcxx . . $ FunctionArea_drawLegend(b4cb387346b51cd7). (FunctionAreacxx . . $ FunctionArea# me,
254 conststring32cxx . . $ conststring32# cattableText1, MelderColourcxx . . $ MelderColour# colour1,
255 conststring32cxx . . $ conststring32# cattableText2 = U"", MelderColourcxx . . $ MelderColour# colour2 = Melder_BLACKcxx . . $ Melder_BLACK.,
256 conststring32cxx . . $ conststring32# cattableText3 = U"", MelderColourcxx . . $ MelderColour# colour3 = Melder_BLACKcxx . . $ Melder_BLACK.,
257 conststring32cxx . . $ conststring32# cattableText4 = U"", MelderColourcxx . . $ MelderColour# colour4 = Melder_BLACKcxx . . $ Melder_BLACK.
258 ) {
259 FunctionArea_drawLegend_cxx . . $ FunctionArea_drawLegend_(b4cb387346b51cd7). (me,
260 cattableText1, colour1,
261 cattableText2, colour2,
262 cattableText3, colour3,
263 cattableText4, colour4
264 ); // this looks strange, but friend function cannot have default parameters unless defined when declared
265 }
266
267 void FunctionArea_garnishPicturecxx . . $ FunctionArea_garnishPicture(88b39197b202d92f). (FunctionAreacxx . . $ FunctionArea# me); // optionally selection times and selection hairs
268
269 /* End of file FunctionArea.h */
270 #endif