Debian Codegraph @

sys/praat_objectMenus.cpp

raw symbols SCIP
1 /* praat_objectMenus.cpp
2 *
3 * Copyright (C) 1992-2026 Paul Boersma
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "praatP.h"cxx . . $ `<file>/sys/praatP.h`/
20 #include "praatM.h"cxx . . $ `<file>/sys/praatM.h`/
21 #include "praat_script.h"cxx . . $ `<file>/sys/praat_script.h`/
22 #include "ScriptEditor.h"cxx . . $ `<file>/sys/ScriptEditor.h`/
23 #include "NotebookEditor.h"cxx . . $ `<file>/sys/NotebookEditor.h`/
24 #include "ButtonEditor.h"cxx . . $ `<file>/sys/ButtonEditor.h`/
25 #include "DataEditor.h"cxx . . $ `<file>/sys/DataEditor.h`/
26 #include "site.h"cxx . . $ `<file>/sys/site.h`/
27 #include "GraphicsP.h"cxx . . $ `<file>/sys/GraphicsP.h`/
28 #include "DemoEditor.h"cxx . . $ `<file>/sys/DemoEditor.h`/
29
30 #define EDITORcxx . . $ `sys/praat_objectMenus.cpp:30:9`! theCurrentPraatObjects -> list [IOBJECT]. editors
31
32 /********** Callbacks of the fixed buttons. **********/
33
34 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT_Remove) {
35 WHERE_DOWNcxx . . $ `sys/praat.h:199:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!)
36 praat_removeObjectcxx . . $ praat_removeObject(1624ee8275b10bda). (IOBJECT);
37 praat_showcxx . . $ praat_show(49f6e7a06ebc5aa8). ();
38 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
39 }
40
41 FORMcxx . . $ `sys/praatM.h:79:9`! (MODIFY_Rename, U"Rename object", U"Rename...") {
42 TEXTFIELDcxx . . $ `sys/praatM.h:144:9`! (newName, U"New name", U"", 3)
43 OKcxx . . $ `sys/praatM.h:327:9`!
44 WHEREcxx . . $ `sys/praat.h:198:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!)
45 SET_STRINGcxx . . $ `sys/praatM.h:344:9`! (newName, NAMEcxx . . $ `sys/praat.h:208:9`!)
46 DOcxx . . $ `sys/praatM.h:354:9`!
47 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 0)
48 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nNo object selected. Cannot rename.");
49 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. > 1)
50 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nCannot rename more than one object at a time.");
51 WHEREcxx . . $ `sys/praat.h:198:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!)
52 break;
53 static MelderStringcxx . . $ MelderString# string;
54 MelderString_copycxx . . $ MelderString_copy(65be51a793e0ff96). (& string, newName);
55 praat_cleanUpNamecxx . . $ praat_cleanUpName(d6cb0530b34b3d29). (string.stringcxx . . $ MelderString#string.);
56 static MelderStringcxx . . $ MelderString# fullName;
57 MelderString_copycxx . . $ MelderString_copy(65be51a793e0ff96). (& fullName, Thing_classNamecxx . . $ Thing_className(fbb3dc34e3ef688d). (OBJECTcxx . . $ `sys/praat.h:203:9`!), U" ", string.stringcxx . . $ MelderString#string.);
58 if (! str32equcxx . . $ `melder/melder_str32.h:122:9`! (fullName.stringcxx . . $ MelderString#string., FULL_NAMEcxx . . $ `sys/praat.h:205:9`!)) {
59 theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> listcxx . . $ structPraatObjects#list. [IOBJECT]. namecxx . . $ structPraat_Object#name. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dup_fcxx . . $ Melder_dup_f(87bf156b1f548402). (fullName.stringcxx . . $ MelderString#string.);
60 autoMelderStringcxx . . $ autoMelderString# listNamecxx . . $ autoMelderString#autoMelderString(49f6e7a06ebc5aa8).;
61 MelderString_appendcxx . . $ MelderString_append(65be51a793e0ff96). (& listName, IDcxx . . $ `sys/praat.h:206:9`!, U". ", fullName.stringcxx . . $ MelderString#string.);
62 praat_list_renameAndSelectcxx . . $ praat_list_renameAndSelect(cfe533a552fd45e9). (IOBJECT, listName.stringcxx . . $ MelderString#string.);
63 for (int ieditor = 0; ieditor < praat_MAXNUM_EDITORScxx . . $ `sys/praat.h:121:9`!; ieditor ++)
64 if (EDITORcxx . . $ `sys/praat_objectMenus.cpp:30:9`! [ieditor])
65 Thing_setNamecxx . . $ Thing_setName(b5a42e5e01c267b5). (EDITORcxx . . $ `sys/praat_objectMenus.cpp:30:9`! [ieditor], listName.stringcxx . . $ MelderString#string.);
66 Thing_setNamecxx . . $ Thing_setName(b5a42e5e01c267b5). (OBJECTcxx . . $ `sys/praat.h:203:9`!, string.stringcxx . . $ MelderString#string.);
67 }
68 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
69 }
70
71 FORMcxx . . $ `sys/praatM.h:79:9`! (NEW1_Copy, U"Copy object", U"Copy...") {
72 TEXTFIELDcxx . . $ `sys/praatM.h:144:9`! (newName, U"Name of new object", U"", 3)
73 OKcxx . . $ `sys/praatM.h:327:9`!
74 WHEREcxx . . $ `sys/praat.h:198:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!)
75 SET_STRINGcxx . . $ `sys/praatM.h:344:9`! (newName, NAMEcxx . . $ `sys/praat.h:208:9`!)
76 DOcxx . . $ `sys/praatM.h:354:9`!
77 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 0)
78 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nNo object selected. Cannot copy.");
79 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. > 1)
80 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nCannot copy more than one object at a time.");
81 if (interpreter)
82 interpreter -> returnTypecxx . . $ structInterpreter#returnType. = kInterpreter_ReturnTypecxx . . $ kInterpreter_ReturnType#::OBJECT_cxx . . $ kInterpreter_ReturnType#OBJECT_.;
83 WHEREcxx . . $ `sys/praat.h:198:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!)
84 praat_newcxx . . $ praat_new(1e9b2ae553a98dd1). (Data_copycxx . . $ Data_copy(97a542a26794c80e). ((Daatacxx . . $ Daata#) OBJECTcxx . . $ `sys/praat.h:203:9`!), newNamecxx . . $ MelderArg#MelderArg(ff00d524ab0355ec).);
85 END_WITH_NEW_DATAcxx . . $ `sys/praatM.h:394:9`!
86 }
87
88 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_Info) {
89 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
90 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 0)
91 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nNo object selected. Cannot query.");
92 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. > 1)
93 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nCannot query more than one object at a time.");
94 WHEREcxx . . $ `sys/praat.h:198:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!) Thing_infoWithIdAndFilecxx . . $ Thing_infoWithIdAndFile(deb45308b1f72d29). (OBJECTcxx . . $ `sys/praat.h:203:9`!, IDcxx . . $ `sys/praat.h:206:9`!, & theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> listcxx . . $ structPraatObjects#list. [IOBJECT]. filecxx . . $ structPraat_Object#file.);
95 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
96 }
97
98 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__Inspect) {
99 PRAATcxx . . $ `sys/praatM.h:1385:9`!
100 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 0)
101 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Selection changed!\nNo object selected. Cannot inspect.");
102 if (theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> batchcxx . . $ structPraatApplication#batch.) {
103 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Cannot inspect data from batch.");
104 } else {
105 WHEREcxx . . $ `sys/praat.h:198:9`! (SELECTEDcxx . . $ `sys/praat.h:200:9`!) {
106 autoDataEditorcxx . . $ autoDataEditor# editor = DataEditor_createcxx . . $ DataEditor_create(5c508204efd4b98). (ID_AND_FULL_NAMEcxx . . $ `sys/praat.h:207:9`!, OBJECTcxx . . $ `sys/praat.h:203:9`!);
107 praat_installEditorcxx . . $ praat_installEditor(66c68acc57a91daa). (editor.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), IOBJECT);
108 editor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
109 }
110 }
111 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
112 }
113
114 /********** The fixed menus. **********/
115
116 static GuiMenucxx . . $ GuiMenu# praatMenucxx . . $ praatMenu., editMenucxx . . $ editMenu., windowMenucxx . . $ windowMenu., newMenucxx . . $ newMenu., readMenucxx . . $ readMenu., goodiesMenucxx . . $ goodiesMenu., preferencesMenucxx . . $ preferencesMenu., technicalMenucxx . . $ technicalMenu., applicationHelpMenucxx . . $ applicationHelpMenu., helpMenucxx . . $ helpMenu.;
117
118 GuiMenucxx . . $ GuiMenu# praat_objects_resolveMenucxx . . $ praat_objects_resolveMenu(b07c1ab83d47ef20). (conststring32cxx . . $ conststring32# menu) {
119 return
120 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Praat") || str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Control") ? praatMenucxx . . $ praatMenu. :
121 #if cocoacxx . . $ `sys/Gui.h:35:10`!
122 str32equ (menu, U"Edit") ? editMenu :
123 str32equ (menu, U"Window") ? windowMenu :
124 #endif
125 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"New") || str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Create") ? newMenucxx . . $ newMenu. :
126 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Open") || str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Read") ? readMenucxx . . $ readMenu. :
127 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Help") ? helpMenucxx . . $ helpMenu. :
128 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Goodies") ? goodiesMenucxx . . $ goodiesMenu. :
129 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Settings") || str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Preferences") ? preferencesMenucxx . . $ preferencesMenu. :
130 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"Technical") ? technicalMenucxx . . $ technicalMenu. :
131 #ifdef macintosh
132 str32equ (menu, U"ApplicationHelp") ? applicationHelpMenu :
133 #else
134 str32equcxx . . $ `melder/melder_str32.h:122:9`! (menu, U"ApplicationHelp") ? helpMenucxx . . $ helpMenu. :
135 #endif
136 newMenucxx . . $ newMenu.; // default
137 }
138
139 /********** Callbacks of the Praat menu. **********/
140
141 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__About) {
142 PRAATcxx . . $ `sys/praatM.h:1385:9`!
143 praat_showLogocxx . . $ praat_showLogo(49f6e7a06ebc5aa8). ();
144 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
145 }
146
147 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__newScript) {
148 PRAATcxx . . $ `sys/praatM.h:1385:9`!
149 autoScriptEditorcxx . . $ autoScriptEditor# scriptEditor = ScriptEditor_createFromTextcxx . . $ ScriptEditor_createFromText(53cc301a35858397). (nullptr, nullptr);
150 scriptEditor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
151 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
152 }
153
154 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__newNotebook) {
155 PRAATcxx . . $ `sys/praatM.h:1385:9`!
156 autoNotebookEditorcxx . . $ autoNotebookEditor# notebookEditor = NotebookEditor_createFromTextcxx . . $ NotebookEditor_createFromText(2ab91d38f0848c38). (nullptr);
157 notebookEditor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
158 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
159 }
160
161 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__openScript) {
162 PRAATcxx . . $ `sys/praatM.h:1385:9`!
163 autoScriptEditorcxx . . $ autoScriptEditor# scriptEditor = ScriptEditor_createFromTextcxx . . $ ScriptEditor_createFromText(53cc301a35858397). (nullptr, nullptr);
164 TextEditor_showOpencxx . . $ TextEditor_showOpen(22283699a15c80c8). (scriptEditor.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
165 scriptEditor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
166 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
167 }
168
169 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__openNotebook) {
170 PRAATcxx . . $ `sys/praatM.h:1385:9`!
171 autoNotebookEditorcxx . . $ autoNotebookEditor# notebookEditor = NotebookEditor_createFromTextcxx . . $ NotebookEditor_createFromText(2ab91d38f0848c38). (nullptr);
172 TextEditor_showOpencxx . . $ TextEditor_showOpen(22283699a15c80c8). (notebookEditor.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
173 notebookEditor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
174 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
175 }
176
177 static ButtonEditorcxx . . $ ButtonEditor# theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor.;
178
179 static void cb_ButtonEditor_destructioncxx . . $ cb_ButtonEditor_destruction(c0154a85f79216c7). (Editorcxx . . $ Editor# /* editor */) {
180 theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor. = nullptr;
181 }
182
183 DIRECTcxx . . $ `sys/praatM.h:412:9`! (PRAAT__editButtons) {
184 PRAATcxx . . $ `sys/praatM.h:1385:9`!
185 if (theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor.) {
186 Editor_raisecxx . . $ Editor_raise(c0154a85f79216c7). (theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor.);
187 } else {
188 autoButtonEditorcxx . . $ autoButtonEditor# editor = ButtonEditor_createcxx . . $ ButtonEditor_create(f6a6aa80bc9d3111). ();
189 Editor_setDestructionCallbackcxx . . $ Editor_setDestructionCallback(522aab46cb47898f). (editor.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), cb_ButtonEditor_destructioncxx . . $ MelderCallback#MelderCallback(fc624d2cd197112).);
190 theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor. = editor.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).();
191 editor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
192 }
193 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
194 }
195
196 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__addMenuCommand, U"Add menu command", U"Add menu command...") {
197 WORDcxx . . $ `sys/praatM.h:122:9`! (window, U"Window", U"Objects")
198 WORDcxx . . $ `sys/praatM.h:122:9`! (menu, U"Menu", U"New")
199 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (command, U"Command", U"Hallo...")
200 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (afterCommand, U"After command", U"")
201 INTEGERcxx . . $ `sys/praatM.h:108:9`! (depth, U"Depth", U"0")
202 INFILEcxx . . $ `sys/praatM.h:152:9`! (script, U"Script file", U"/u/miep/hallo.praat")
203 OKcxx . . $ `sys/praatM.h:327:9`!
204 DOcxx . . $ `sys/praatM.h:354:9`!
205 PRAATcxx . . $ `sys/praatM.h:1385:9`!
206 praat_addMenuCommandScriptcxx . . $ praat_addMenuCommandScript(ce2dc7cf61cce937). (window, menu, command, afterCommand, depth, script);
207 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
208 }
209
210 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__hideMenuCommand, U"Hide menu command", U"Hide menu command...") {
211 WORDcxx . . $ `sys/praatM.h:122:9`! (window, U"Window", U"Objects")
212 WORDcxx . . $ `sys/praatM.h:122:9`! (menu, U"Menu", U"New")
213 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (command, U"Command", U"Hallo...")
214 OKcxx . . $ `sys/praatM.h:327:9`!
215 DOcxx . . $ `sys/praatM.h:354:9`!
216 PRAATcxx . . $ `sys/praatM.h:1385:9`!
217 praat_hideMenuCommandcxx . . $ praat_hideMenuCommand(b6693f37175431d7). (window, menu, command);
218 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
219 }
220
221 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__showMenuCommand, U"Show menu command", U"Show menu command...") {
222 WORDcxx . . $ `sys/praatM.h:122:9`! (window, U"Window", U"Objects")
223 WORDcxx . . $ `sys/praatM.h:122:9`! (menu, U"Menu", U"New")
224 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (command, U"Command", U"Hallo...")
225 OKcxx . . $ `sys/praatM.h:327:9`!
226 DOcxx . . $ `sys/praatM.h:354:9`!
227 PRAATcxx . . $ `sys/praatM.h:1385:9`!
228 praat_showMenuCommandcxx . . $ praat_showMenuCommand(b6693f37175431d7). (window, menu, command);
229 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
230 }
231
232 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__addAction, U"Add action command", U"Add action command...") {
233 WORDcxx . . $ `sys/praatM.h:122:9`! (class1, U"Class 1", U"Sound")
234 INTEGERcxx . . $ `sys/praatM.h:108:9`! (number1, U"Number 1", U"0")
235 WORDcxx . . $ `sys/praatM.h:122:9`! (class2, U"Class 2", U"")
236 INTEGERcxx . . $ `sys/praatM.h:108:9`! (number2, U"Number 2", U"0")
237 WORDcxx . . $ `sys/praatM.h:122:9`! (class3, U"Class 3", U"")
238 INTEGERcxx . . $ `sys/praatM.h:108:9`! (number3, U"Number 3", U"0")
239 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (command, U"Command", U"Play reverse")
240 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (afterCommand, U"After command", U"Play")
241 INTEGERcxx . . $ `sys/praatM.h:108:9`! (depth, U"Depth", U"0")
242 INFILEcxx . . $ `sys/praatM.h:152:9`! (script, U"Script file", U"/u/miep/playReverse.praat")
243 OKcxx . . $ `sys/praatM.h:327:9`!
244 DOcxx . . $ `sys/praatM.h:354:9`!
245 PRAATcxx . . $ `sys/praatM.h:1385:9`!
246 praat_addActionScriptcxx . . $ praat_addActionScript(dcd860f3b50ce413). (class1, number1, class2, number2, class3, number3, command, afterCommand, depth, script);
247 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
248 }
249
250 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__hideAction, U"Hide action command", U"Hide action command...") {
251 WORDcxx . . $ `sys/praatM.h:122:9`! (class1, U"Class 1", U"Sound")
252 WORDcxx . . $ `sys/praatM.h:122:9`! (class2, U"Class 2", U"")
253 WORDcxx . . $ `sys/praatM.h:122:9`! (class3, U"Class 3", U"")
254 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (command, U"Command", U"Play")
255 OKcxx . . $ `sys/praatM.h:327:9`!
256 DOcxx . . $ `sys/praatM.h:354:9`!
257 PRAATcxx . . $ `sys/praatM.h:1385:9`!
258 praat_hideAction_classNamescxx . . $ praat_hideAction_classNames(65c8e021e9cb4ed9). (class1, class2, class3, command);
259 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
260 }
261
262 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__showAction, U"Show action command", U"Show action command...") {
263 WORDcxx . . $ `sys/praatM.h:122:9`! (class1, U"Class 1", U"Sound")
264 WORDcxx . . $ `sys/praatM.h:122:9`! (class2, U"Class 2", U"")
265 WORDcxx . . $ `sys/praatM.h:122:9`! (class3, U"Class 3", U"")
266 SENTENCEcxx . . $ `sys/praatM.h:126:9`! (command, U"Command", U"Play")
267 OKcxx . . $ `sys/praatM.h:327:9`!
268 DOcxx . . $ `sys/praatM.h:354:9`!
269 PRAATcxx . . $ `sys/praatM.h:1385:9`!
270 praat_showAction_classNamescxx . . $ praat_showAction_classNames(65c8e021e9cb4ed9). (class1, class2, class3, command);
271 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
272 }
273
274 /********** Callbacks of the Settings menu. **********/
275
276 FORMcxx . . $ `sys/praatM.h:79:9`! (SETTINGS__TextReadingSettings, U"Text reading settings", U"Unicode") {
277 CHOICE_ENUMcxx . . $ `sys/praatM.h:249:9`! (kMelder_textInputEncoding, encodingOf8BitTextFiles,
278 U"Encoding of 8-bit text files", kMelder_textInputEncoding::DEFAULT)
279 OKcxx . . $ `sys/praatM.h:327:9`!
280 SET_ENUMcxx . . $ `sys/praatM.h:347:9`! (encodingOf8BitTextFiles, kMelder_textInputEncoding, Melder_getInputEncoding ())
281 DOcxx . . $ `sys/praatM.h:354:9`!
282 PREFScxx . . $ `sys/praatM.h:1377:9`!
283 Melder_setInputEncodingcxx . . $ Melder_setInputEncoding(e7da480bd5829302). (encodingOf8BitTextFiles);
284 PREFS_ENDcxx . . $ `sys/praatM.h:1378:9`!
285 }
286
287 FORMcxx . . $ `sys/praatM.h:79:9`! (SETTINGS__TextWritingSettings, U"Text writing settings", U"Unicode") {
288 CHOICE_ENUMcxx . . $ `sys/praatM.h:249:9`! (kMelder_textOutputEncoding, outputEncoding,
289 U"Output encoding", kMelder_textOutputEncoding::DEFAULT)
290 OKcxx . . $ `sys/praatM.h:327:9`!
291 SET_ENUMcxx . . $ `sys/praatM.h:347:9`! (outputEncoding, kMelder_textOutputEncoding, Melder_getOutputEncoding ())
292 DOcxx . . $ `sys/praatM.h:354:9`!
293 PREFScxx . . $ `sys/praatM.h:1377:9`!
294 Melder_setOutputEncodingcxx . . $ Melder_setOutputEncoding(96a7a35765e6164e). (outputEncoding);
295 PREFS_ENDcxx . . $ `sys/praatM.h:1378:9`!
296 }
297
298 FORMcxx . . $ `sys/praatM.h:79:9`! (SETTINGS__CjkFontStyleSettings, U"CJK font style settings", nullptr) {
299 OPTIONMENU_ENUMcxx . . $ `sys/praatM.h:262:9`! (kGraphics_cjkFontStyle, cjkFontStyle,
300 U"CJK font style", kGraphics_cjkFontStyle::DEFAULT)
301 OKcxx . . $ `sys/praatM.h:327:9`!
302 SET_ENUMcxx . . $ `sys/praatM.h:347:9`! (cjkFontStyle, kGraphics_cjkFontStyle, theGraphicsCjkFontStyle)
303 DOcxx . . $ `sys/praatM.h:354:9`!
304 PREFScxx . . $ `sys/praatM.h:1377:9`!
305 theGraphicsCjkFontStylecxx . . $ theGraphicsCjkFontStyle. = cjkFontStyle;
306 PREFS_ENDcxx . . $ `sys/praatM.h:1378:9`!
307 }
308
309 /********** Callbacks of the Goodies menu. **********/
310
311 FORMcxx . . $ `sys/praatM.h:79:9`! (INFO_NONE__praat_calculator, U"Calculator", U"Calculator") {
312 TEXTFIELDcxx . . $ `sys/praatM.h:144:9`! (expression, U"Type any numeric formula or string formula", U"5*5", 5)
313 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"Note that you can include many special functions in your formula,")
314 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"including statistical functions and acoustics-auditory conversions.")
315 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"For details, click Help.")
316 OKcxx . . $ `sys/praatM.h:327:9`!
317 DOcxx . . $ `sys/praatM.h:354:9`!
318 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
319 Formula_Resultcxx . . $ Formula_Result# resultcxx . . $ Formula_Result#Formula_Result(49f6e7a06ebc5aa8).;
320 //TRACE
321 if (! interpreter) {
322 tracecxx . . $ `melder/melder_debug.h:60:10`! (U"no interpreter");
323 static autoInterpreterStackcxx . . $ autoInterpreterStack# theCalculatorInterpreterStackcxx . . $ autoSomeThing#autoSomeThing(49f6e7a06ebc5aa8).;
324 if (! theCalculatorInterpreterStack) {
325 theCalculatorInterpreterStack =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). InterpreterStack_createcxx . . $ InterpreterStack_create(91aa183261e4fa82). (Editorcxx . . $ Editor# (nullptr)); // object-window command, so no editor
326 theCalculatorInterpreterStack ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). interpreterscxx . . $ structInterpreterStack#interpreters. [1] =cxx . . $ autoSomeThing#`operator=`(80cc59814f7161e8). Interpreter_createFromEnvironmentcxx . . $ Interpreter_createFromEnvironment(2a446a9b6f15a803). ( // TODO: too exposed
327 theCalculatorInterpreterStack.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(),
328 Editorcxx . . $ Editor# (nullptr),
329 MelderFilecxx . . $ MelderFile# (nullptr)
330 );
331 }
332 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (theCalculatorInterpreterStack -> interpreters [1]); // TODO: should fire after exception
333 Melder_assertcxx . . $ `melder/melder_assert.h:39:10`! (theCalculatorInterpreterStack -> interpreters [1] -> owningInterpreterStack);
334 Interpreter_anyExpressioncxx . . $ Interpreter_anyExpression(26b9613ed4865362). (theCalculatorInterpreterStack ->cxx . . $ autoSomeThing#`operator->`(34d6acfd341ba7ab). interpreterscxx . . $ structInterpreterStack#interpreters. [1].getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), expression, & result);
335 } else {
336 tracecxx . . $ `melder/melder_debug.h:60:10`! (U"yes interpreter");
337 Interpreter_anyExpressioncxx . . $ Interpreter_anyExpression(26b9613ed4865362). (interpreter, expression, & result);
338 }
339 switch (result. expressionTypecxx . . $ Formula_Result#expressionType.) {
340 case kFormula_EXPRESSION_TYPE_NUMERICcxx . . $ `sys/Formula.h:24:9`!:
341 Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (result. numericResultcxx . . $ Formula_Result#numericResult.);
342 break; case kFormula_EXPRESSION_TYPE_STRINGcxx . . $ `sys/Formula.h:25:9`!:
343 Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (result. stringResultcxx . . $ Formula_Result#stringResult..getcxx . . $ _autostring#get(5a2a78a048fb49a8).());
344 break; case kFormula_EXPRESSION_TYPE_NUMERIC_VECTORcxx . . $ `sys/Formula.h:26:9`!:
345 Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (constVECVUcxx . . $ constVECVU# (result. numericVectorResultcxx . . $ Formula_Result#numericVectorResult.));
346 break; case kFormula_EXPRESSION_TYPE_NUMERIC_MATRIXcxx . . $ `sys/Formula.h:27:9`!:
347 Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (constMATVUcxx . . $ constMATVU# (result. numericMatrixResultcxx . . $ Formula_Result#numericMatrixResult.));
348 break; case kFormula_EXPRESSION_TYPE_STRING_ARRAYcxx . . $ `sys/Formula.h:30:9`!:
349 Melder_informationcxx . . $ Melder_information(3eb398314feba58b). (result. stringArrayResultcxx . . $ Formula_Result#stringArrayResult.);
350 }
351 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
352 }
353
354 FORMcxx . . $ `sys/praatM.h:79:9`! (INFO_reportDifferenceOfTwoProportions, U"Report difference of two proportions", U"Difference of two proportions") {
355 INTEGERcxx . . $ `sys/praatM.h:108:9`! (a_int, U"left Row 1", U"71")
356 INTEGERcxx . . $ `sys/praatM.h:108:9`! (b_int, U"right Row 1", U"39")
357 INTEGERcxx . . $ `sys/praatM.h:108:9`! (c_int, U"left Row 2", U"93")
358 INTEGERcxx . . $ `sys/praatM.h:108:9`! (d_int, U"right Row 2", U"27")
359 OKcxx . . $ `sys/praatM.h:327:9`!
360 DOcxx . . $ `sys/praatM.h:354:9`!
361 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
362 double a = a_int, b = b_int, c = c_int, d = d_int;
363 double n = a + b + c + d;
364 if (a < 0 || b < 0 || c < 0 || d < 0)
365 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"The numbers should not be negative.");
366 if (a + b <= 0 || c + d <= 0)
367 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"The row totals should be positive.");
368 if (a + c <= 0 || b + d <= 0)
369 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"The column totals should be positive.");
370 MelderInfo_opencxx . . $ MelderInfo_open(49f6e7a06ebc5aa8). ();
371 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Observed row 1 = ", Melder_iroundcxx . . $ `melder/melder_ftoi.h:78:9`! (a), U" ", Melder_iroundcxx . . $ `melder/melder_ftoi.h:78:9`! (b));
372 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Observed row 2 = ", Melder_iroundcxx . . $ `melder/melder_ftoi.h:78:9`! (c), U" ", Melder_iroundcxx . . $ `melder/melder_ftoi.h:78:9`! (d));
373 double aexp = (a + b) * (a + c) / n;
374 double bexp = (a + b) * (b + d) / n;
375 double cexp = (a + c) * (c + d) / n;
376 double dexp = (b + d) * (c + d) / n;
377 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"");
378 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Expected row 1 = ", aexp, U" ", bexp);
379 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Expected row 2 = ", cexp, U" ", dexp);
380 /*
381 Continuity correction:
382 bring the observed numbers closer to the expected numbers by 0.5 (if possible).
383 */
384 Melder_moveCloserToBycxx . . $ Melder_moveCloserToBy(25e83c901d5b3957). (& a, aexp, 0.5);
385 Melder_moveCloserToBycxx . . $ Melder_moveCloserToBy(25e83c901d5b3957). (& b, bexp, 0.5);
386 Melder_moveCloserToBycxx . . $ Melder_moveCloserToBy(25e83c901d5b3957). (& c, cexp, 0.5);
387 Melder_moveCloserToBycxx . . $ Melder_moveCloserToBy(25e83c901d5b3957). (& d, dexp, 0.5);
388 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"");
389 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Corrected observed row 1 = ", a, U" ", b);
390 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Corrected observed row 2 = ", c, U" ", d);
391
392 n = a + b + c + d;
393 double crossDifference = a * d - b * c;
394 double x2 = n * crossDifference * crossDifference / (a + b) / (c + d) / (a + c) / (b + d);
395 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"");
396 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Chi-square = ", x2);
397 MelderInfo_writeLinecxx . . $ MelderInfo_writeLine(3eb398314feba58b). (U"Two-tailed p = ", NUMchiSquareQcxx . . $ NUMchiSquareQ(d8e7e0733fa41c87). (x2, 1));
398 MelderInfo_closecxx . . $ MelderInfo_close(49f6e7a06ebc5aa8). ();
399 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
400 }
401
402 FORM_SAVEcxx . . $ `sys/praatM.h:449:9`! (GRAPHICS_saveDemoWindowAsPdfFile, U"Save Demo window as PDF file", nullptr, U"praatDemoWindow.pdf") {
403 Demo_saveToPdfFilecxx . . $ Demo_saveToPdfFile(1145552d769d7b5d). (file);
404 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
405 }
406
407 /********** Callbacks of the Technical menu. **********/
408
409 FORMcxx . . $ `sys/praatM.h:79:9`! (SETTINGS__debug, U"Set debugging options", nullptr) {
410 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"If you switch Tracing on, Praat will write lots of detailed ")
411 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"information about what goes on in Praat")
412 {// scope
413 structMelderFilecxx . . $ structMelderFile# file { };
414 #ifdef UNIXcxx . . $ `<built-in>:479:9`!
415 MelderFolder_getFilecxx . . $ MelderFolder_getFile(fcdc1f9d1818a0a1). (Melder_preferencesFoldercxx . . $ Melder_preferencesFolder(3f0bf42ba8f9aa29).(), U"tracing", & file);
416 #else
417 MelderFolder_getFile (Melder_preferencesFolder(), U"Tracing.txt", & file);
418 #endif
419 COMMENTcxx . . $ `sys/praatM.h:136:9`! (Melder_cat (U"to ", MelderFile_peekPath (& file), U"."))
420 }
421 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (tracing, U"Tracing", false)
422 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"Setting the following to anything other than zero")
423 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"will alter the behaviour of Praat")
424 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"in unpredictable ways.")
425 INTEGERcxx . . $ `sys/praatM.h:108:9`! (debugOption, U"Debug option", U"0")
426 OKcxx . . $ `sys/praatM.h:327:9`!
427 SET_BOOLEANcxx . . $ `sys/praatM.h:338:9`! (tracing, Melder_isTracingGlobally)
428 SET_INTEGERcxx . . $ `sys/praatM.h:335:9`! (debugOption, Melder_debug)
429 DOcxx . . $ `sys/praatM.h:354:9`!
430 PREFScxx . . $ `sys/praatM.h:1377:9`!
431 Melder_setTracingcxx . . $ Melder_setTracing(b45ddcbc8423892c). (tracing);
432 Melder_debugcxx . . $ Melder_debug. = debugOption;
433 PREFS_ENDcxx . . $ `sys/praatM.h:1378:9`!
434 }
435
436 FORMcxx . . $ `sys/praatM.h:79:9`! (SETTINGS__DebugMultithreading, U"Debug multi-threading", U"Debug multi-threading...") {
437 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"These settings determine how fast parallelized")
438 COMMENTcxx . . $ `sys/praatM.h:136:9`! (U"procedures are performed on your computer.")
439 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (useMultithreading, U"Use multi-threading", true)
440 INTEGERcxx . . $ `sys/praatM.h:108:9`! (maximumNumberOfConcurrentThreads, U"Maximum number of threads", U"0 (= automatic)")
441 INTEGERcxx . . $ `sys/praatM.h:108:9`! (minimumNumberOfElementsPerThread, U"Minimum number of frames per thread", U"0 (= automatic)")
442 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (traceThreads, U"Trace threads", false)
443 OKcxx . . $ `sys/praatM.h:327:9`!
444 DOcxx . . $ `sys/praatM.h:354:9`!
445 PREFScxx . . $ `sys/praatM.h:1377:9`!
446 MelderThread_debugMultithreadingcxx . . $ MelderThread_debugMultithreading(dd2b2d69c71f3693). (useMultithreading, maximumNumberOfConcurrentThreads,
447 minimumNumberOfElementsPerThread, traceThreads);
448 PREFS_ENDcxx . . $ `sys/praatM.h:1378:9`!
449 }
450
451 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__listReadableTypesOfObjects) {
452 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
453 Thing_listReadableClassescxx . . $ Thing_listReadableClasses(49f6e7a06ebc5aa8). ();
454 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
455 }
456
457 FORMcxx . . $ `sys/praatM.h:79:9`! (INFO_praat_library_createC, U"PraatLib: Create C header or file", nullptr) {
458 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (isInHeader, U"Is in header", true)
459 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeCreateAPI, U"Include \"Create\" API", true)
460 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeReadAPI, U"Include \"Read\" API", true)
461 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeSaveAPI, U"Include \"Save\" API", true)
462 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeQueryAPI, U"Include \"Query\" API", true)
463 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeModifyAPI, U"Include \"Modify\" API", true)
464 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeToAPI, U"Include \"To\" API", true)
465 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeRecordAPI, U"Include \"Record\" API", true)
466 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includePlayAPI, U"Include \"Play\" API", true)
467 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeDrawAPI, U"Include \"Draw\" API", true)
468 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeHelpAPI, U"Include \"Help\" API", false)
469 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeWindowAPI, U"Include \"Window\" API", false)
470 BOOLEANcxx . . $ `sys/praatM.h:130:9`! (includeDemoAPI, U"Include \"Demo\" API", false)
471 OKcxx . . $ `sys/praatM.h:327:9`!
472 DOcxx . . $ `sys/praatM.h:354:9`!
473 praat_library_createCcxx . . $ praat_library_createC(ea6bedd4f7d25851). (isInHeader, includeCreateAPI, includeReadAPI, includeSaveAPI,
474 includeQueryAPI, includeModifyAPI, includeToAPI, includeRecordAPI, includePlayAPI,
475 includeDrawAPI, includeHelpAPI, includeWindowAPI, includeDemoAPI);
476 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
477 }
478
479 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportSystemProperties) {
480 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
481 praat_reportSystemPropertiescxx . . $ praat_reportSystemProperties(49f6e7a06ebc5aa8). ();
482 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
483 }
484
485 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportAppProperties) {
486 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
487 praat_reportAppPropertiescxx . . $ praat_reportAppProperties(49f6e7a06ebc5aa8). ();
488 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
489 }
490
491 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportGraphicalProperties) {
492 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
493 praat_reportGraphicalPropertiescxx . . $ praat_reportGraphicalProperties(49f6e7a06ebc5aa8). ();
494 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
495 }
496
497 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportIntegerProperties) {
498 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
499 praat_reportIntegerPropertiescxx . . $ praat_reportIntegerProperties(49f6e7a06ebc5aa8). ();
500 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
501 }
502
503 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportFloatingPointProperties) {
504 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
505 praat_reportFloatingPointPropertiescxx . . $ praat_reportFloatingPointProperties(49f6e7a06ebc5aa8). ();
506 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
507 }
508
509 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportMemoryUse) {
510 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
511 praat_reportMemoryUsecxx . . $ praat_reportMemoryUse(49f6e7a06ebc5aa8). ();
512 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
513 }
514
515 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportTextProperties) {
516 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
517 praat_reportTextPropertiescxx . . $ praat_reportTextProperties(49f6e7a06ebc5aa8). ();
518 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
519 }
520
521 DIRECTcxx . . $ `sys/praatM.h:412:9`! (INFO_NONE__reportFontProperties) {
522 INFO_NONEcxx . . $ `sys/praatM.h:583:9`!
523 praat_reportFontPropertiescxx . . $ praat_reportFontProperties(49f6e7a06ebc5aa8). ();
524 INFO_NONE_ENDcxx . . $ `sys/praatM.h:584:9`!
525 }
526
527 /********** Callbacks of the Open menu. **********/
528
529 /*
530 Note: readFromFile should not call praat_updateSelection(),
531 because praat_updateSelection() should be called after all files have been read,
532 not just the current one.
533 */
534 static void readFromFilecxx . . $ readFromFile(1145552d769d7b5d). (MelderFilecxx . . $ MelderFile# file) {
535 autoDaatacxx . . $ autoDaata# object = Data_readFromFilecxx . . $ Data_readFromFile(da9ba57d6e09e2a7). (file);
536 if (! object)
537 return; // this can happen with Picture_readFromPraatPictureFile (file recognized, but no data)
538 if (Thing_isacxx . . $ Thing_isa(8cbb12e93d03b2a1). (object.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), classManPagescxx . . $ classManPages.) && ! Melder_batchcxx . . $ Melder_batch.) {
539 ManPagescxx . . $ ManPages# manPages = (ManPagescxx . . $ ManPages#) object.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).();
540 manPages -> commandsWithExternalSideEffectsAreAllowedcxx . . $ structManPages#commandsWithExternalSideEffectsAreAllowed. = false;
541 ManPagecxx . . $ ManPage# firstPage = manPages -> pagescxx . . $ structManPages#pages..atcxx . . $ CollectionOf#at. [cxx . . $ ArrayOf#`operator[]`(a7f36fee1ae21897).1];
542 autoManualcxx . . $ autoManual# manual = Manual_createcxx . . $ Manual_create(639647387c88cb04). (firstPage -> titlecxx . . $ structManPage#title..getcxx . . $ _autostring#get(5a2a78a048fb49a8).(), nullptr,
543 (ManPagescxx . . $ ManPages#) object.releaseToAmbiguousOwnercxx . . $ autoSomeThing#releaseToAmbiguousOwner(258ee1c9e0a18a5c).(), true, false);
544 if (manPages -> executablecxx . . $ structManPages#executable.)
545 Melder_warningcxx . . $ Melder_warning(6298c93241566110). (U"These manual pages contain links to executable scripts.\n"
546 "Only navigate these pages if you trust their author!");
547 manual.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
548 return;
549 }
550 if (Thing_isacxx . . $ Thing_isa(8cbb12e93d03b2a1). (object.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), classScriptcxx . . $ classScript.) && ! Melder_batchcxx . . $ Melder_batch.) {
551 autoScriptEditorcxx . . $ autoScriptEditor# editor = ScriptEditor_createFromScript_canBeNullcxx . . $ ScriptEditor_createFromScript_canBeNull(5fb1895a19deb5f9). (nullptr, object.static_cast_movecxx . . $ autoSomeThing#static_cast_move(8f979c7064dbabcf). <structScriptcxx . . $ structScript#>());
552 if (! editor) {
553 (void) 0; // the script was already open, and the user has been notified of that
554 } else {
555 editor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
556 }
557 return;
558 }
559 if (Thing_isacxx . . $ Thing_isa(8cbb12e93d03b2a1). (object.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), classNotebookcxx . . $ classNotebook.) && ! Melder_batchcxx . . $ Melder_batch.) {
560 autoNotebookEditorcxx . . $ autoNotebookEditor# editor = NotebookEditor_createFromNotebook_canBeNullcxx . . $ NotebookEditor_createFromNotebook_canBeNull(57835e04bf6cce63). ((Notebookcxx . . $ Notebook#) object.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).());
561 if (! editor) {
562 (void) 0; // the script was already open, and the user has been notified of that
563 } else {
564 editor.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
565 }
566 return;
567 }
568 praat_newWithFilecxx . . $ praat_newWithFile(edccf1f4beee5182). (objectcxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f)..movecxx . . $ autoSomeThing#move(25acc3554b7d1642).(), file, MelderFile_namecxx . . $ MelderFile_name(d9f043369fa9b55b). (file));
569 }
570
571 FORM_READcxx . . $ `sys/praatM.h:419:9`! (READMANY_Data_readFromFile, U"Read Object(s) from file", 0, true) {
572 readFromFilecxx . . $ readFromFile(1145552d769d7b5d). (file);
573 if (interpreter)
574 interpreter -> returnTypecxx . . $ structInterpreter#returnType. = kInterpreter_ReturnTypecxx . . $ kInterpreter_ReturnType#::OBJECT_cxx . . $ kInterpreter_ReturnType#OBJECT_.;
575 END_WITH_NEW_DATAcxx . . $ `sys/praatM.h:394:9`! // this calls praat_updateSelection(), after reading a single file; see also cb_openDocument
576 }
577
578 /********** Callbacks of the Save menu. **********/
579
580 FORM_SAVEcxx . . $ `sys/praatM.h:449:9`! (SAVE_Data_writeToTextFile, U"Save Object(s) as one text file", nullptr, nullptr) {
581 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 1) {
582 LOOPcxx . . $ `sys/praat.h:201:9`! {
583 iam_LOOPcxx . . $ `sys/praat.h:197:9`! (Daata);
584 Data_writeToTextFilecxx . . $ Data_writeToTextFile(c3dcdea1be00195). (me, file);
585 }
586 } else {
587 autoCollectioncxx . . $ autoCollection# set = praat_getSelectedObjectscxx . . $ praat_getSelectedObjects(859008c51157a0cd). ();
588 Data_writeToTextFilecxx . . $ Data_writeToTextFile(c3dcdea1be00195). (set.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), file);
589 }
590 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
591 }
592
593 FORM_SAVEcxx . . $ `sys/praatM.h:449:9`! (SAVE_Data_writeToShortTextFile, U"Save Object(s) as one short text file", nullptr, nullptr) {
594 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 1) {
595 LOOPcxx . . $ `sys/praat.h:201:9`! {
596 iam_LOOPcxx . . $ `sys/praat.h:197:9`! (Daata);
597 Data_writeToShortTextFilecxx . . $ Data_writeToShortTextFile(c3dcdea1be00195). (me, file);
598 }
599 } else {
600 autoCollectioncxx . . $ autoCollection# set = praat_getSelectedObjectscxx . . $ praat_getSelectedObjects(859008c51157a0cd). ();
601 Data_writeToShortTextFilecxx . . $ Data_writeToShortTextFile(c3dcdea1be00195). (set.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), file);
602 }
603 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
604 }
605
606 FORM_SAVEcxx . . $ `sys/praatM.h:449:9`! (SAVE_Data_writeToBinaryFile, U"Save Object(s) as one binary file", nullptr, nullptr) {
607 if (theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 1) {
608 LOOPcxx . . $ `sys/praat.h:201:9`! {
609 iam_LOOPcxx . . $ `sys/praat.h:197:9`! (Daata);
610 Data_writeToBinaryFilecxx . . $ Data_writeToBinaryFile(c3dcdea1be00195). (me, file);
611 }
612 } else {
613 autoCollectioncxx . . $ autoCollection# set = praat_getSelectedObjectscxx . . $ praat_getSelectedObjects(859008c51157a0cd). ();
614 Data_writeToBinaryFilecxx . . $ Data_writeToBinaryFile(c3dcdea1be00195). (set.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), file);
615 }
616 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
617 }
618
619 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT_ManPages_saveToHtmlFolder, U"Save all pages as HTML files", nullptr) {
620 FOLDERcxx . . $ `sys/praatM.h:160:9`! (folder, U"Folder", U"")
621 OKcxx . . $ `sys/praatM.h:327:9`!
622 LOOPcxx . . $ `sys/praat.h:201:9`! {
623 iam_LOOPcxx . . $ `sys/praat.h:197:9`! (ManPages);
624 SET_STRINGcxx . . $ `sys/praatM.h:344:9`! (folder, MelderFolder_peekPath (& mycxx . . $ `melder/melder.h:44:9`! rootDirectory))
625 }
626 DOcxx . . $ `sys/praatM.h:354:9`!
627 LOOPcxx . . $ `sys/praat.h:201:9`! {
628 iam_LOOPcxx . . $ `sys/praat.h:197:9`! (ManPages);
629 ManPages_writeAllToHtmlDircxx . . $ ManPages_writeAllToHtmlDir(19b9a5c7992af98f). (me, nullptr, folder);
630 }
631 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
632 }
633
634 DIRECTcxx . . $ `sys/praatM.h:412:9`! (WINDOW_ManPages_view) {
635 LOOPcxx . . $ `sys/praat.h:201:9`! {
636 iam_LOOPcxx . . $ `sys/praat.h:197:9`! (ManPages);
637 ManPagecxx . . $ ManPage# firstPage = mycxx . . $ `melder/melder.h:44:9`! pagescxx . . $ structManPages#pages..atcxx . . $ CollectionOf#at. [cxx . . $ ArrayOf#`operator[]`(a7f36fee1ae21897).1];
638 autoManualcxx . . $ autoManual# manual = Manual_createcxx . . $ Manual_create(639647387c88cb04). (firstPage -> titlecxx . . $ structManPage#title..getcxx . . $ _autostring#get(5a2a78a048fb49a8).(), nullptr, me, false, false);
639 if (mycxx . . $ `melder/melder.h:44:9`! executablecxx . . $ structManPages#executable.)
640 Melder_warningcxx . . $ Melder_warning(6298c93241566110). (U"These manual pages contain links to executable scripts.\n"
641 "Only navigate these pages if you trust their author!");
642 praat_installEditorcxx . . $ praat_installEditor(66c68acc57a91daa). (manual.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), IOBJECT);
643 manual.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
644 }
645 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
646 }
647
648 /********** Callbacks of the Help menu. **********/
649
650 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__SearchManual, U"Search manual", U"Manual") {
651 TEXTFIELDcxx . . $ `sys/praatM.h:144:9`! (query, U"Search for strings (separate with spaces)", U"", 3)
652 OKcxx . . $ `sys/praatM.h:327:9`!
653 DOcxx . . $ `sys/praatM.h:354:9`!
654 PRAATcxx . . $ `sys/praatM.h:1385:9`!
655 if (theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> batchcxx . . $ structPraatApplication#batch.)
656 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Cannot view a manual from batch.");
657 autoManualcxx . . $ autoManual# manual = Manual_createcxx . . $ Manual_create(639647387c88cb04). (U"Intro", nullptr, theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> manPagescxx . . $ structPraatApplication#manPages., false, true);
658 Manual_searchcxx . . $ Manual_search(322ddecc38fe39c2). (manual.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), query);
659 manual.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
660 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
661 }
662
663 FORMcxx . . $ `sys/praatM.h:79:9`! (PRAAT__GoToManualPage, U"Go to manual page", nullptr) {
664 LISTcxx . . $ `sys/praatM.h:291:9`! (goToPageNumber, U"Page", ManPages_getTitles (theCurrentPraatApplication -> manPages), 1)
665 OKcxx . . $ `sys/praatM.h:327:9`!
666 DOcxx . . $ `sys/praatM.h:354:9`!
667 PRAATcxx . . $ `sys/praatM.h:1385:9`!
668 if (theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> batchcxx . . $ structPraatApplication#batch.)
669 Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"Cannot view a manual from batch.");
670 autoManualcxx . . $ autoManual# manual = Manual_createcxx . . $ Manual_create(639647387c88cb04). (U"Intro", nullptr, theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> manPagescxx . . $ structPraatApplication#manPages., false, true);
671 HyperPage_goToPage_numbercxx . . $ HyperPage_goToPage_number(ad43c06d8a9a8078). (manual.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), goToPageNumber);
672 manual.releaseToUsercxx . . $ autoSomeThing#releaseToUser(ced63f7c635d850d).();
673 PRAAT_ENDcxx . . $ `sys/praatM.h:1386:9`!
674 }
675
676 FORMcxx . . $ `sys/praatM.h:79:9`! (HELP_SaveManualToHtmlFolder, U"Save all pages as HTML files", nullptr) {
677 FOLDERcxx . . $ `sys/praatM.h:160:9`! (folder, U"Folder", U"")
678 OKcxx . . $ `sys/praatM.h:327:9`!
679 structMelderFoldercxx . . $ structMelderFolder# currentFolder { };
680 Melder_getCurrentFoldercxx . . $ Melder_getCurrentFolder(63f38d3b6b86d1dc). (& currentFolder);
681 SET_STRINGcxx . . $ `sys/praatM.h:344:9`! (folder, MelderFolder_peekPath (& currentFolder))
682 DOcxx . . $ `sys/praatM.h:354:9`!
683 ManPages_writeAllToHtmlDircxx . . $ ManPages_writeAllToHtmlDir(19b9a5c7992af98f). (theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> manPagescxx . . $ structPraatApplication#manPages., nullptr, folder);
684 END_NO_NEW_DATAcxx . . $ `sys/praatM.h:404:9`!
685 }
686
687 /********** Menu descriptions. **********/
688
689 void praat_showcxx . . $ praat_show(49f6e7a06ebc5aa8). () {
690 /*
691 (De)sensitivize the fixed buttons as appropriate for the current selection.
692 */
693 praat_sensitivizeFixedButtonCommandcxx . . $ praat_sensitivizeFixedButtonCommand(7004b68cc6c23ea2). (U"Remove", theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. != 0);
694 praat_sensitivizeFixedButtonCommandcxx . . $ praat_sensitivizeFixedButtonCommand(7004b68cc6c23ea2). (U"Rename...", theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 1);
695 praat_sensitivizeFixedButtonCommandcxx . . $ praat_sensitivizeFixedButtonCommand(7004b68cc6c23ea2). (U"Copy...", theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 1);
696 praat_sensitivizeFixedButtonCommandcxx . . $ praat_sensitivizeFixedButtonCommand(7004b68cc6c23ea2). (U"Info", theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. == 1);
697 praat_sensitivizeFixedButtonCommandcxx . . $ praat_sensitivizeFixedButtonCommand(7004b68cc6c23ea2). (U"Inspect", theCurrentPraatObjectscxx . . $ theCurrentPraatObjects. -> totalSelectioncxx . . $ structPraatObjects#totalSelection. != 0);
698 praat_actions_showcxx . . $ praat_actions_show(49f6e7a06ebc5aa8). ();
699 if (theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. == & theForegroundPraatApplicationcxx . . $ theForegroundPraatApplication. && theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor.)
700 Editor_dataChangedcxx . . $ Editor_dataChanged(27010ae97811c311). (theReferenceToTheOnlyButtonEditorcxx . . $ theReferenceToTheOnlyButtonEditor., nullptr);
701 }
702
703 /********** Menu descriptions. **********/
704
705 void praat_addFixedButtonscxx . . $ praat_addFixedButtons(20efc9fbfef198b1). (GuiWindowcxx . . $ GuiWindow# window) {
706 praat_addFixedButtonCommandcxx . . $ `sys/praatP.h:51:9`! (window, U"Rename...", MODIFY_Rename, 8, 70);
707 praat_addFixedButtonCommandcxx . . $ `sys/praatP.h:51:9`! (window, U"Copy...", NEW1_Copy, 98, 70);
708 praat_addFixedButtonCommandcxx . . $ `sys/praatP.h:51:9`! (window, U"Inspect",
709 PRAAT__Inspect, 8, 40);
710 praat_addFixedButtonCommandcxx . . $ `sys/praatP.h:51:9`! (window, U"Info", INFO_Info, 98, 40);
711 praat_addFixedButtonCommandcxx . . $ `sys/praatP.h:51:9`! (window, U"Remove", PRAAT_Remove, 8, 10);
712 }
713
714 static void searchProccxx . . $ searchProc(49f6e7a06ebc5aa8). () {
715 PRAAT__SearchManualcxx . . $ PRAAT__SearchManual(744a0abd3c8513c). (nullptr, 0, nullptr, nullptr, nullptr, nullptr, false, nullptr, nullptr);
716 }
717
718 static MelderStringcxx . . $ MelderString# itemTitle_aboutcxx . . $ itemTitle_about.;
719
720 static autoDaatacxx . . $ autoDaata# scriptRecognizercxx . . $ scriptRecognizer(c32780b24c371669). (integercxx . . $ integer# nread, const char *header, MelderFilecxx . . $ MelderFile# file) {
721 conststring32cxx . . $ conststring32# name = MelderFile_namecxx . . $ MelderFile_name(d9f043369fa9b55b). (file);
722 if (nread < 2)
723 return autoDaatacxx . . $ autoSomeThing#autoSomeThing(49f6e7a06ebc5aa8). ();
724 if ((header [0] == '#' && header [1] == '!')
725 || Melder_endsWith_caseAwarecxx . . $ Melder_endsWith_caseAware(1652f10ed0f82783). (name, U".praat")
726 || Melder_endsWith_caseAwarecxx . . $ Melder_endsWith_caseAware(1652f10ed0f82783). (name, U".html")
727 ) {
728 return Script_createFromFilecxx . . $ autoSomeThing#autoSomeThing(327dc2ad7b4df21). (file);
729 }
730 return autoDaatacxx . . $ autoSomeThing#autoSomeThing(49f6e7a06ebc5aa8). ();
731 }
732
733 static autoDaatacxx . . $ autoDaata# notebookRecognizercxx . . $ notebookRecognizer(c32780b24c371669). (integercxx . . $ integer# nread, const char * /* header */, MelderFilecxx . . $ MelderFile# file) {
734 conststring32cxx . . $ conststring32# name = MelderFile_namecxx . . $ MelderFile_name(d9f043369fa9b55b). (file);
735 if (nread < 2)
736 return autoDaatacxx . . $ autoSomeThing#autoSomeThing(49f6e7a06ebc5aa8). ();
737 if (Melder_endsWith_caseAwarecxx . . $ Melder_endsWith_caseAware(1652f10ed0f82783). (name, U".praatnb") || Melder_endsWith_caseAwarecxx . . $ Melder_endsWith_caseAware(1652f10ed0f82783). (name, U".cpp"))
738 return Notebook_createFromFilecxx . . $ autoSomeThing#autoSomeThing(327dc2ad7b4df21). (file);
739 return autoDaatacxx . . $ autoSomeThing#autoSomeThing(49f6e7a06ebc5aa8). ();
740 }
741
742 static void cb_openDocumentcxx . . $ cb_openDocument(1145552d769d7b5d). (MelderFilecxx . . $ MelderFile# file) {
743 try {
744 readFromFilecxx . . $ readFromFile(1145552d769d7b5d). (file); // read a single file without calling praat_updateSelection()
745 } catch (MelderErrorcxx . . $ MelderError#) {
746 Melder_flushErrorcxx . . $ Melder_flushError(49f6e7a06ebc5aa8). ();
747 }
748 }
749 static void cb_finishedOpeningDocumentscxx . . $ cb_finishedOpeningDocuments(49f6e7a06ebc5aa8). () {
750 try {
751 praat_updateSelectioncxx . . $ praat_updateSelection(49f6e7a06ebc5aa8). (); // this finally calls praat_updateSelection(), after each separate file has been read
752 } catch (MelderErrorcxx . . $ MelderError#) {
753 Melder_flushErrorcxx . . $ Melder_flushError(49f6e7a06ebc5aa8). ();
754 }
755 }
756
757 #if cocoacxx . . $ `sys/Gui.h:35:10`!
758 DIRECT (PRAAT__cut) {
759 PRAAT
760 NSWindow *window = [NSApp keyWindow];
761 NSResponder *firstResponder = [window firstResponder];
762 if ([firstResponder isKindOfClass: [NSTextView class]])
763 [(NSTextView *) firstResponder cut: nil];
764 PRAAT_END
765 }
766 DIRECT (PRAAT__copy) {
767 PRAAT
768 NSWindow *window = [NSApp keyWindow];
769 NSResponder *firstResponder = [window firstResponder];
770 if ([firstResponder isKindOfClass: [NSTextView class]])
771 [(NSTextView *) firstResponder copy: nil];
772 PRAAT_END
773 }
774 DIRECT (PRAAT__paste) {
775 PRAAT
776 trace (U"Pasting to app.");
777 NSWindow *window = [NSApp keyWindow];
778 NSResponder *firstResponder = [window firstResponder];
779 if ([firstResponder isKindOfClass: [NSTextView class]])
780 [(NSTextView *) firstResponder pasteAsPlainText: nil];
781 PRAAT_END
782 }
783 DIRECT (PRAAT__minimize) {
784 PRAAT
785 [[NSApp keyWindow] performMiniaturize: nil];
786 PRAAT_END
787 }
788 DIRECT (PRAAT__zoom) {
789 PRAAT
790 [[NSApp keyWindow] performZoom: nil];
791 PRAAT_END
792 }
793 DIRECT (PRAAT__close) {
794 PRAAT
795 [[NSApp keyWindow] performClose: nil];
796 PRAAT_END
797 }
798 #endif
799
800 void praat_addMenuscxx . . $ praat_addMenus(20efc9fbfef198b1). (GuiWindowcxx . . $ GuiWindow# window) {
801 Melder_setSearchProccxx . . $ Melder_setSearchProc(964b12a25712bdc3). (searchProccxx . . $ searchProc(49f6e7a06ebc5aa8).);
802
803 Data_recognizeFileTypecxx . . $ Data_recognizeFileType(7ed4186908013b3d). (scriptRecognizercxx . . $ scriptRecognizer(c32780b24c371669).);
804 Data_recognizeFileTypecxx . . $ Data_recognizeFileType(7ed4186908013b3d). (notebookRecognizercxx . . $ notebookRecognizer(c32780b24c371669).);
805
806 /*
807 Create the menu titles in the bar.
808 */
809 if (! theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication. -> batchcxx . . $ structPraatApplication#batch.) {
810 #ifdef macintosh
811 praatMenu = GuiMenu_createInWindow (nullptr, U"\024", 0);
812 #if cocoa
813 editMenu = GuiMenu_createInWindow (nullptr, U"Edit", 0);
814 windowMenu = GuiMenu_createInWindow (nullptr, U"Window", 0);
815 #endif
816 #else
817 praatMenucxx . . $ praatMenu. = GuiMenu_createInWindowcxx . . $ GuiMenu_createInWindow(cfd6777f6dee287d). (window, U"Praat", 0);
818 #endif
819 newMenucxx . . $ newMenu. = GuiMenu_createInWindowcxx . . $ GuiMenu_createInWindow(cfd6777f6dee287d). (window, U"New", 0);
820 readMenucxx . . $ readMenu. = GuiMenu_createInWindowcxx . . $ GuiMenu_createInWindow(cfd6777f6dee287d). (window, U"Open", 0);
821 praat_actions_createWriteMenucxx . . $ praat_actions_createWriteMenu(20efc9fbfef198b1). (window);
822 #ifdef macintosh
823 applicationHelpMenu = GuiMenu_createInWindow (nullptr, U"Help", 0);
824 #endif
825 helpMenucxx . . $ helpMenu. = GuiMenu_createInWindowcxx . . $ GuiMenu_createInWindow(cfd6777f6dee287d). (window, U"Help", 0);
826 }
827
828 MelderString_appendcxx . . $ MelderString_append(65be51a793e0ff96). (& itemTitle_aboutcxx . . $ itemTitle_about., U"About ", Melder_upperCaseAppNamecxx . . $ Melder_upperCaseAppName(1912f6684645c851).());
829 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", itemTitle_about.string, nullptr, GuiMenu_UNHIDABLEcxx . . $ `sys/Gui.h:870:9`!,
830 PRAAT__About);
831 #ifdef macintosh
832 #if cocoa
833 /*
834 HACK: give the following commands weird names,
835 because otherwise they may be called from a script.
836 (we add three alt-spaces)
837 */
838 praat_addMenuCommand (U"Objects", U"Edit", U"Cut   ", nullptr, GuiMenu_UNHIDABLE | 'X' | GuiMenu_NO_API,
839 PRAAT__cut);
840 praat_addMenuCommand (U"Objects", U"Edit", U"Copy   ", nullptr, GuiMenu_UNHIDABLE | 'C' | GuiMenu_NO_API,
841 PRAAT__copy);
842 praat_addMenuCommand (U"Objects", U"Edit", U"Paste   ", nullptr, GuiMenu_UNHIDABLE | 'V' | GuiMenu_NO_API,
843 PRAAT__paste);
844 praat_addMenuCommand (U"Objects", U"Window", U"Minimize   ", nullptr, GuiMenu_UNHIDABLE | GuiMenu_NO_API,
845 PRAAT__minimize);
846 praat_addMenuCommand (U"Objects", U"Window", U"Zoom   ", nullptr, GuiMenu_UNHIDABLE | GuiMenu_NO_API,
847 PRAAT__zoom);
848 praat_addMenuCommand (U"Objects", U"Window", U"Close   ", nullptr, 'W' | GuiMenu_NO_API,
849 PRAAT__close);
850 #endif
851 #endif
852 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"-- script --", nullptr, 0, nullptr);
853 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"New Praat script", nullptr, GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
854 PRAAT__newScript);
855 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"New Praat notebook", nullptr, GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
856 PRAAT__newNotebook);
857 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Open Praat script...", nullptr, GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
858 PRAAT__openScript);
859 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Open Praat notebook...", nullptr, GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
860 PRAAT__openNotebook);
861 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"-- buttons --", nullptr, 0, nullptr);
862 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Add menu command...", nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`! | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
863 PRAAT__addMenuCommand);
864 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Hide menu command...", nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`! | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
865 PRAAT__hideMenuCommand);
866 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Show menu command...", nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`! | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
867 PRAAT__showMenuCommand);
868 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Add action command...", nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`! | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
869 PRAAT__addAction);
870 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Hide action command...", nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`! | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
871 PRAAT__hideAction);
872 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Show action command...", nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`! | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!,
873 PRAAT__showAction);
874
875 GuiMenuItemcxx . . $ GuiMenuItem# menuItem = praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Goodies", nullptr, GuiMenu_UNHIDABLEcxx . . $ `sys/Gui.h:870:9`!, nullptr);
876 goodiesMenucxx . . $ goodiesMenu. = menuItem ? menuItem -> d_menucxx . . $ structGuiMenuItem#d_menu. : nullptr;
877 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Goodies", U"Calculator...",
878 nullptr, 'U', INFO_NONE__praat_calculator);
879 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Goodies", U"Report difference of two proportions...",
880 nullptr, 0, INFO_reportDifferenceOfTwoProportions);
881 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Goodies", U"-- demo window --", nullptr, 0, nullptr);
882 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Goodies", U"Save Demo window as PDF file...", nullptr, 0, GRAPHICS_saveDemoWindowAsPdfFile);
883
884 menuItem = praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Settings", nullptr, GuiMenu_UNHIDABLEcxx . . $ `sys/Gui.h:870:9`!, nullptr);
885 preferencesMenucxx . . $ preferencesMenu. = menuItem ? menuItem -> d_menucxx . . $ structGuiMenuItem#d_menu. : nullptr;
886 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Settings", U"Buttons...",
887 nullptr, GuiMenu_UNHIDABLEcxx . . $ `sys/Gui.h:870:9`!, PRAAT__editButtons);
888 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Settings", U"-- encoding prefs --", nullptr, 0, nullptr);
889 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Settings", U"Text reading settings... || Text reading preferences...",
890 nullptr, 0, SETTINGS__TextReadingSettings); // alternative GuiMenu_DEPRECATED_2023
891 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Settings", U"Text writing settings... || Text writing preferences...",
892 nullptr, 0, SETTINGS__TextWritingSettings); // alternative GuiMenu_DEPRECATED_2023
893 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Settings", U"CJK font style settings... || CJK font style preferences...",
894 nullptr, 0, SETTINGS__CjkFontStyleSettings); // alternative GuiMenu_DEPRECATED_2023
895
896 menuItem = praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Praat", U"Technical", nullptr, GuiMenu_UNHIDABLEcxx . . $ `sys/Gui.h:870:9`!, nullptr);
897 technicalMenucxx . . $ technicalMenu. = menuItem ? menuItem -> d_menucxx . . $ structGuiMenuItem#d_menu. : nullptr;
898 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report memory use",
899 nullptr, 0, INFO_NONE__reportMemoryUse);
900 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report integer properties",
901 nullptr, 0, INFO_NONE__reportIntegerProperties);
902 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report floating point properties",
903 nullptr, 0, INFO_NONE__reportFloatingPointProperties);
904 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report system properties",
905 nullptr, 0, INFO_NONE__reportSystemProperties);
906 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report app properties",
907 nullptr, 0, INFO_NONE__reportAppProperties);
908 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report graphical properties",
909 nullptr, 0, INFO_NONE__reportGraphicalProperties);
910 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report text properties",
911 nullptr, 0, INFO_NONE__reportTextProperties);
912 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Report font properties",
913 nullptr, 0, INFO_NONE__reportFontProperties);
914 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Debug...",
915 nullptr, 0, SETTINGS__debug);
916 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Debug multi-threading...",
917 nullptr, 0, SETTINGS__DebugMultithreading);
918
919 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"-- api --", nullptr, 0, nullptr);
920 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"List readable types of objects",
921 nullptr, 0, INFO_NONE__listReadableTypesOfObjects);
922 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Technical", U"Create C interface...",
923 nullptr, 0, INFO_praat_library_createC);
924
925 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"Open", U"Read from file...", nullptr, GuiMenu_ATTRACTIVEcxx . . $ `sys/Gui.h:855:9`! | 'O', READMANY_Data_readFromFile);
926
927 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classDaata, 0, U"Save as text file... || Write to text file...",
928 nullptr, 0, SAVE_Data_writeToTextFile); // alternative GuiMenu_DEPRECATED_2011
929 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classDaata, 0, U"Save as short text file... || Write to short text file...",
930 nullptr, 0, SAVE_Data_writeToShortTextFile); // alternative GuiMenu_DEPRECATED_2011
931 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classDaata, 0, U"Save as binary file... || Write to binary file...",
932 nullptr, 0, SAVE_Data_writeToBinaryFile); // alternative GuiMenu_DEPRECATED_2011
933
934 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classManPages, 1, U"Save to HTML folder... || Save to HTML directory...",
935 nullptr, 0, PRAAT_ManPages_saveToHtmlFolder); // alternative GuiMenu_DEPRECATED_2020
936 praat_addAction1cxx . . $ `sys/praat.h:72:9`! (classManPages, 1, U"View",
937 nullptr, 0, WINDOW_ManPages_view);
938 }
939
940 void praat_addMenus2cxx . . $ praat_addMenus2(49f6e7a06ebc5aa8). () {
941 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"ApplicationHelp", U"-- manual --", nullptr, 0, nullptr);
942 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"ApplicationHelp", U"Go to manual page...",
943 nullptr, 0, PRAAT__GoToManualPage);
944 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"ApplicationHelp", U"Save manual to HTML folder...",
945 nullptr, GuiMenu_HIDDENcxx . . $ `sys/Gui.h:869:9`!, HELP_SaveManualToHtmlFolder);
946 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"ApplicationHelp", Melder_cat (U"Search ", Melder_upperCaseAppName(), U" manual..."),
947 nullptr, 'M' | GuiMenu_NO_APIcxx . . $ `sys/Gui.h:871:9`!, PRAAT__SearchManual);
948 praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`! (U"Objects", U"ApplicationHelp", itemTitle_about.string,
949 nullptr, GuiMenu_UNHIDABLEcxx . . $ `sys/Gui.h:870:9`!, PRAAT__About);
950
951 #if defined (macintosh)
952 Gui_setOpenDocumentCallback (cb_openDocument, cb_finishedOpeningDocuments);
953 #endif
954 }
955
956 /* End of file praat_objectMenus.cpp */