Debian Codegraph @

sys/praatP.h

raw symbols SCIP
1 /* praatP.h
2 *
3 * Copyright (C) 1992-2007,2009-2025 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 "praat.h"cxx . . $ `<file>/sys/praat.h`/
20
21 void praat_addActionScriptcxx . . $ praat_addActionScript(dcd860f3b50ce413). (conststring32cxx . . $ conststring32# className1, integercxx . . $ integer# n1, conststring32cxx . . $ conststring32# className2, integercxx . . $ integer# n2, conststring32cxx . . $ conststring32# className3, integercxx . . $ integer# n3,
22 conststring32cxx . . $ conststring32# title, conststring32cxx . . $ conststring32# after, integercxx . . $ integer# depth, conststring32cxx . . $ conststring32# script);
23 /* No strings may be null; unspecify them by giving an empty string. 'title' and 'script' are deep-copied. */
24
25 void praat_removeAction_classNamescxx . . $ praat_removeAction_classNames(65c8e021e9cb4ed9). (conststring32cxx . . $ conststring32# className1, conststring32cxx . . $ conststring32# className2,
26 conststring32cxx . . $ conststring32# className3, conststring32cxx . . $ conststring32# title);
27 /* No arguments may be null; unspecify them by giving an empty string. */
28
29 void praat_hideActioncxx . . $ praat_hideAction(312e849c2af9bc10). (ClassInfocxx . . $ ClassInfo# class1, ClassInfocxx . . $ ClassInfo# class2, ClassInfocxx . . $ ClassInfo# class3, conststring32cxx . . $ conststring32# title);
30 void praat_hideAction_classNamescxx . . $ praat_hideAction_classNames(65c8e021e9cb4ed9). (conststring32cxx . . $ conststring32# className1, conststring32cxx . . $ conststring32# className2,
31 conststring32cxx . . $ conststring32# className3, conststring32cxx . . $ conststring32# title);
32 void praat_showActioncxx . . $ praat_showAction(312e849c2af9bc10). (ClassInfocxx . . $ ClassInfo# class1, ClassInfocxx . . $ ClassInfo# class2, ClassInfocxx . . $ ClassInfo# class3, conststring32cxx . . $ conststring32# title);
33 void praat_showAction_classNamescxx . . $ praat_showAction_classNames(65c8e021e9cb4ed9). (conststring32cxx . . $ conststring32# className1, conststring32cxx . . $ conststring32# className2,
34 conststring32cxx . . $ conststring32# className3, conststring32cxx . . $ conststring32# title);
35 void praat_sortActionscxx . . $ praat_sortActions(49f6e7a06ebc5aa8). ();
36
37 void praat_addMenuCommandScriptcxx . . $ praat_addMenuCommandScript(ce2dc7cf61cce937). (conststring32cxx . . $ conststring32# window, conststring32cxx . . $ conststring32# menu, conststring32cxx . . $ conststring32# title,
38 conststring32cxx . . $ conststring32# after, integercxx . . $ integer# depth, conststring32cxx . . $ conststring32# script);
39 /* All strings are deep-copied and may not be null; unspecify them by giving an empty string. */
40
41 /*
42 For the Praat objects window:
43 'window' is "Objects", 'menu' is "Praat", "New", "Open", "Help", "Settings", "Goodies", or "Technical".
44 For the Praat picture window:
45 'window' is "Picture", 'menu' is "File", "Edit", "Margins", "World", "Select", "Pen", "Font", or "Help".
46 */
47 void praat_hideMenuCommandcxx . . $ praat_hideMenuCommand(b6693f37175431d7). (conststring32cxx . . $ conststring32# window, conststring32cxx . . $ conststring32# menu, conststring32cxx . . $ conststring32# title);
48 void praat_showMenuCommandcxx . . $ praat_showMenuCommand(b6693f37175431d7). (conststring32cxx . . $ conststring32# window, conststring32cxx . . $ conststring32# menu, conststring32cxx . . $ conststring32# title);
49 void praat_saveAddedMenuCommandscxx . . $ praat_saveAddedMenuCommands(93db1090f27e5462). (MelderStringcxx . . $ MelderString# *buffer);
50 void praat_saveToggledMenuCommandscxx . . $ praat_saveToggledMenuCommands(93db1090f27e5462). (MelderStringcxx . . $ MelderString# *buffer);
51 #define praat_addFixedButtonCommandcxx . . $ `sys/praatP.h:51:9`!(p,t,c,x,y) praat_addFixedButtonCommand_ (p, t, c, U"" #c, x, y)
52 void praat_addFixedButtonCommand_cxx . . $ praat_addFixedButtonCommand_(77077bbeb1d2048a). (GuiFormcxx . . $ GuiForm# parent, conststring32cxx . . $ conststring32# title, UiCallbackcxx . . $ UiCallback# callback, conststring32cxx . . $ conststring32# nameOfCallback, int x, int y);
53 void praat_sensitivizeFixedButtonCommandcxx . . $ praat_sensitivizeFixedButtonCommand(7004b68cc6c23ea2). (conststring32cxx . . $ conststring32# title, bool sensitive);
54 void praat_sortMenuCommandscxx . . $ praat_sortMenuCommands(49f6e7a06ebc5aa8). ();
55
56 #define praat_MAXNUM_MENUScxx . . $ `sys/praatP.h:56:9`! 20 /* Maximum number of added New, Open, Save, or Help menus. */
57 #define praat_MAXNUM_FILE_TYPE_RECOGNIZERScxx . . $ `sys/praatP.h:57:9`! 50 /* File types recognizable by 'Read from file...'. */
58
59 Thing_definecxx . . $ autoSomeThing# (Praat_Command, Thing) {
60 ClassInfocxx . . $ ClassInfo# class1cxx . . $ structPraat_Command#class1., class2cxx . . $ structPraat_Command#class2., class3cxx . . $ structPraat_Command#class3., class4cxx . . $ structPraat_Command#class4.; // selected classes
61 integercxx . . $ integer# n1cxx . . $ structPraat_Command#n1., n2cxx . . $ structPraat_Command#n2., n3cxx . . $ structPraat_Command#n3., n4cxx . . $ structPraat_Command#n4.; // number of selected objects of each class; 0 means "any number"
62 autostring32cxx . . $ autostring32# titlecxx . . $ structPraat_Command#title.; // button text = command text
63 UiCallbackcxx . . $ UiCallback# callbackcxx . . $ structPraat_Command#callback.; // multi-purpose
64 /* If both UiCallback::sendingForm and sendingString are null, this routine is an activate callback;
65 you should directly execute the command, or call UiForm_do(dialog) if you need arguments;
66 UiForm_do will call this routine again with sendingForm = dialog. */
67 /* If sendingForm exists, this routine is an ok callback,
68 and you should execute the command. */
69 /* If sendingString exists (apparently from a command file),
70 UiForm_parseString should be called, which will call this routine again with sendingForm. */
71 /* All of these things are normally taken care of by the macros defined in praatM.h. */
72 conststring32cxx . . $ conststring32# nameOfCallbackcxx . . $ structPraat_Command#nameOfCallback.;
73 signed char
74 visiblecxx . . $ structPraat_Command#visible., // do the selected classes match class1, class2, class3 and class4?
75 executablecxx . . $ structPraat_Command#executable., // is the command actually executable? I.e. isn't the button greyed out?
76 depthcxx . . $ structPraat_Command#depth., // 0 = command in main menu, 1 = command in submenu, 2 = command in submenu of submenu
77 hiddencxx . . $ structPraat_Command#hidden., // this can change when Praat is running, even from the start-up file
78 toggledcxx . . $ structPraat_Command#toggled., // did the hiddenness change when Praat was running? The factory value for "hidden" is (hidden != toggled)
79 phasecxx . . $ structPraat_Command#phase.,
80 unhidablecxx . . $ structPraat_Command#unhidable.,
81 attractivecxx . . $ structPraat_Command#attractive.,
82 noApicxx . . $ structPraat_Command#noApi., // do not include in a library API ("View & Edit", help commands...)
83 forceApicxx . . $ structPraat_Command#forceApi., // include in a library API even if this button is hidden by default ("Record Sound (fixed time)...")
84 addedcxx . . $ structPraat_Command#added.; // added by a script
85 integercxx . . $ integer# deprecationYearcxx . . $ structPraat_Command#deprecationYear.;
86 GuiThingcxx . . $ GuiThing# buttoncxx . . $ structPraat_Command#button.;
87 autostring32cxx . . $ autostring32# windowcxx . . $ structPraat_Command#window., menucxx . . $ structPraat_Command#menu.;
88 autostring32cxx . . $ autostring32# scriptcxx . . $ structPraat_Command#script.; // if 'callback' equals DO_RunTheScriptFromAnyAddedMenuCommand
89 autostring32cxx . . $ autostring32# aftercxx . . $ structPraat_Command#after.; // title of previous command, often null; if starting with an asterisk (deprecation), then a reference to the replacement
90 integercxx . . $ integer# uniqueIDcxx . . $ structPraat_Command#uniqueID.; // for sorting the added commands
91 integercxx . . $ integer# sortingTailcxx . . $ structPraat_Command#sortingTail.;
92 };
93
94 #define praat_STARTING_UPcxx . . $ `sys/praatP.h:94:9`! 1
95 #define praat_READING_BUTTONScxx . . $ `sys/praatP.h:95:9`! 2
96 #define praat_HANDLING_EVENTScxx . . $ `sys/praatP.h:96:9`! 3
97
98 integercxx . . $ integer# praat_numberOfSelectedcxx . . $ praat_numberOfSelected(33e8b4a553c0cc95). (ClassInfocxx . . $ ClassInfo# klas);
99 integercxx . . $ integer# praat_idOfSelectedcxx . . $ praat_idOfSelected(b92ee5db4de9c66b). (ClassInfocxx . . $ ClassInfo# klas, integercxx . . $ integer# inplace);
100 autoVECcxx . . $ autoVEC# praat_idsOfAllSelectedcxx . . $ praat_idsOfAllSelected(85815b18a910bd48). (ClassInfocxx . . $ ClassInfo# klas);
101 char32cxx . . $ char32# * praat_nameOfSelectedcxx . . $ praat_nameOfSelected(4d3fbba0fc83dc8c). (ClassInfocxx . . $ ClassInfo# klas, integercxx . . $ integer# inplace);
102 autoSTRVECcxx . . $ autoSTRVEC# praat_namesOfAllSelectedcxx . . $ praat_namesOfAllSelected(71fc934e5b24e4c0). (ClassInfocxx . . $ ClassInfo# klas);
103
104 /* Used by praat.cpp; defined in praat_picture.cpp.
105 */
106 void praat_picture_initcxx . . $ praat_picture_init(b45ddcbc8423892c). (bool showPictureWindowAtStartUp);
107 void praat_picture_exitcxx . . $ praat_picture_exit(49f6e7a06ebc5aa8). ();
108
109 void praat_picture_prefscxx . . $ praat_picture_prefs(49f6e7a06ebc5aa8). ();
110 void praat_picture_prefsChangedcxx . . $ praat_picture_prefsChanged(49f6e7a06ebc5aa8). ();
111 /* Praat shell tells Picture window that preferences have been changed
112 (after reading the prefs file).
113 Picture window will update the font menu.
114 */
115 GuiMenucxx . . $ GuiMenu# praat_picture_resolveMenucxx . . $ praat_picture_resolveMenu(b07c1ab83d47ef20). (conststring32cxx . . $ conststring32# menu);
116
117 /* The following routines are a bit private (used by praat_script.cpp). */
118 /* If you must call them, follow them by praat_show (). */
119 void praat_deselectcxx . . $ praat_deselect(1624ee8275b10bda). (integercxx . . $ integer# i);
120 void praat_deselectAllcxx . . $ praat_deselectAll(49f6e7a06ebc5aa8). ();
121 void praat_selectcxx . . $ praat_select(1624ee8275b10bda). (integercxx . . $ integer# i);
122 void praat_selectAllcxx . . $ praat_selectAll(49f6e7a06ebc5aa8). ();
123
124 void praat_list_backgroundcxx . . $ praat_list_background(49f6e7a06ebc5aa8). ();
125 void praat_list_foregroundcxx . . $ praat_list_foreground(49f6e7a06ebc5aa8). (); // updates the list of objects after backgrounding
126 void praat_backgroundcxx . . $ praat_background(49f6e7a06ebc5aa8). ();
127 void praat_foregroundcxx . . $ praat_foreground(49f6e7a06ebc5aa8). ();
128 Editorcxx . . $ Editor# praat_findEditorFromStringcxx . . $ praat_findEditorFromString(2ddda295cd13730e). (conststring32cxx . . $ conststring32# string);
129 Editorcxx . . $ Editor# praat_findEditorByIdcxx . . $ praat_findEditorById(bbc190b40656db0d). (integercxx . . $ integer# id);
130
131 void praat_showLogocxx . . $ praat_showLogo(49f6e7a06ebc5aa8). ();
132
133 /* Communication with praat_menuCommands.cpp: */
134 void praat_menuCommands_exit_optimizeByLeakingcxx . . $ praat_menuCommands_exit_optimizeByLeaking(49f6e7a06ebc5aa8). ();
135 int praat_doMenuCommandcxx . . $ praat_doMenuCommand(3dcbaa6862792959). (conststring32cxx . . $ conststring32# command, conststring32cxx . . $ conststring32# arguments, Interpretercxx . . $ Interpreter# interpreter); // 0 = not found
136 int praat_doMenuCommandcxx . . $ praat_doMenuCommand(738317ad6fa3f573). (conststring32cxx . . $ conststring32# command, integercxx . . $ integer# narg, Stackelcxx . . $ Stackel# args, Interpretercxx . . $ Interpreter# interpreter); // 0 = not found
137 integercxx . . $ integer# praat_getNumberOfMenuCommandscxx . . $ praat_getNumberOfMenuCommands(da6335ded91d79c2). ();
138 Praat_Commandcxx . . $ Praat_Command# praat_getMenuCommandcxx . . $ praat_getMenuCommand(ee05ff1469c8f4e9). (integercxx . . $ integer# i);
139
140 /* Communication with praat_actions.cpp: */
141 void praat_actions_showcxx . . $ praat_actions_show(49f6e7a06ebc5aa8). ();
142 void praat_actions_createWriteMenucxx . . $ praat_actions_createWriteMenu(20efc9fbfef198b1). (GuiWindowcxx . . $ GuiWindow# window);
143 void praat_actions_exit_optimizeByLeakingcxx . . $ praat_actions_exit_optimizeByLeaking(49f6e7a06ebc5aa8). ();
144 void praat_actions_createDynamicMenucxx . . $ praat_actions_createDynamicMenu(20efc9fbfef198b1). (GuiWindowcxx . . $ GuiWindow# window);
145 void praat_saveAddedActionscxx . . $ praat_saveAddedActions(93db1090f27e5462). (MelderStringcxx . . $ MelderString# *buffer);
146 void praat_saveToggledActionscxx . . $ praat_saveToggledActions(93db1090f27e5462). (MelderStringcxx . . $ MelderString# *buffer);
147 int praat_doActioncxx . . $ praat_doAction(3dcbaa6862792959). (conststring32cxx . . $ conststring32# command, conststring32cxx . . $ conststring32# arguments, Interpretercxx . . $ Interpreter# interpreter); // 0 = not found
148 int praat_doActioncxx . . $ praat_doAction(738317ad6fa3f573). (conststring32cxx . . $ conststring32# command, integercxx . . $ integer# narg, Stackelcxx . . $ Stackel# args, Interpretercxx . . $ Interpreter# interpreter); // 0 = not found
149 integercxx . . $ integer# praat_getNumberOfActionscxx . . $ praat_getNumberOfActions(da6335ded91d79c2). (); // for ButtonEditor
150 Praat_Commandcxx . . $ Praat_Command# praat_getActioncxx . . $ praat_getAction(ee05ff1469c8f4e9). (integercxx . . $ integer# i); // for ButtonEditor
151
152 /* Communication with praat_statistics.cpp: */
153 void praat_statistics_prefscxx . . $ praat_statistics_prefs(49f6e7a06ebc5aa8). (); // at init time
154 void praat_statistics_prefsChangedcxx . . $ praat_statistics_prefsChanged(49f6e7a06ebc5aa8). (); // after reading prefs file
155 void praat_statistics_exitcxx . . $ praat_statistics_exit(49f6e7a06ebc5aa8). (); // at exit time
156 void praat_reportMemoryUsecxx . . $ praat_reportMemoryUse(49f6e7a06ebc5aa8). ();
157 void praat_reportSystemPropertiescxx . . $ praat_reportSystemProperties(49f6e7a06ebc5aa8). ();
158 void praat_reportAppPropertiescxx . . $ praat_reportAppProperties(49f6e7a06ebc5aa8). ();
159 void praat_reportGraphicalPropertiescxx . . $ praat_reportGraphicalProperties(49f6e7a06ebc5aa8). ();
160 void praat_reportIntegerPropertiescxx . . $ praat_reportIntegerProperties(49f6e7a06ebc5aa8). ();
161 void praat_reportFloatingPointPropertiescxx . . $ praat_reportFloatingPointProperties(49f6e7a06ebc5aa8). ();
162 void praat_reportTextPropertiescxx . . $ praat_reportTextProperties(49f6e7a06ebc5aa8). ();
163 void praat_reportFontPropertiescxx . . $ praat_reportFontProperties(49f6e7a06ebc5aa8). ();
164
165 /* Communication with praat_objectMenus.cpp: */
166 GuiMenucxx . . $ GuiMenu# praat_objects_resolveMenucxx . . $ praat_objects_resolveMenu(b07c1ab83d47ef20). (conststring32cxx . . $ conststring32# menu);
167 void praat_addFixedButtonscxx . . $ praat_addFixedButtons(20efc9fbfef198b1). (GuiWindowcxx . . $ GuiWindow# window);
168 void praat_addMenuscxx . . $ praat_addMenus(20efc9fbfef198b1). (GuiWindowcxx . . $ GuiWindow# window);
169 void praat_addMenus2cxx . . $ praat_addMenus2(49f6e7a06ebc5aa8). ();
170
171 /* API creation: */
172 void praat_library_createCcxx . . $ praat_library_createC(ea6bedd4f7d25851). (bool isInHeaderFile, bool includeCreateAPI, bool includeReadAPI, bool includeSaveAPI,
173 bool includeQueryAPI, bool includeModifyAPI, bool includeToAPI,
174 bool includeRecordAPI, bool includePlayAPI,
175 bool includeDrawAPI, bool includeHelpAPI, bool includeWindowAPI,
176 bool includeDemoAPI);
177 void praat_menuCommands_writeCcxx . . $ praat_menuCommands_writeC(b669ee56f6de5309). (bool isInHeaderFile, bool includeCreateAPI, bool includeReadAPI,
178 bool includeRecordAPI, bool includePlayAPI, bool includeDrawAPI, bool includeHelpAPI, bool includeWindowAPI);
179 void praat_actions_writeCcxx . . $ praat_actions_writeC(91b19ce1d42a4b6). (bool isInHeaderFile, bool includeSaveAPI,
180 bool includeQueryAPI, bool includeModifyAPI, bool includeToAPI,
181 bool includePlayAPI, bool includeDrawAPI, bool includeHelpAPI, bool includeWindowAPI);
182
183 void praat_cleanUpNamecxx . . $ praat_cleanUpName(d6cb0530b34b3d29). (char32cxx . . $ char32# *name);
184 void praat_list_renameAndSelectcxx . . $ praat_list_renameAndSelect(cfe533a552fd45e9). (integercxx . . $ integer# position, conststring32cxx . . $ conststring32# name);
185
186 inline struct PraatPcxx . . $ PraatP# {
187 int argccxx . . $ PraatP#argc.;
188 char **argvcxx . . $ PraatP#argv.;
189 int argumentNumbercxx . . $ PraatP#argumentNumber.;
190 structcxx . . $ PraatP#$anonymous_type_0# {
191 bool hidePicturecxx . . $ PraatP#$anonymous_type_0#hidePicture.; // hide the Picture window at start-up
192 } commandLineOptionscxx . . $ PraatP#commandLineOptions.;
193 bool fileNamesCameInByDroppingcxx . . $ PraatP#fileNamesCameInByDropping., foundTheOpenSwitchcxx . . $ PraatP#foundTheOpenSwitch., foundTheRunSwitchcxx . . $ PraatP#foundTheRunSwitch., foundTheSendSwitchcxx . . $ PraatP#foundTheSendSwitch., foundTheSendOrFormSwitchcxx . . $ PraatP#foundTheSendOrFormSwitch., foundTheNewSwitchcxx . . $ PraatP#foundTheNewSwitch.;
194 bool userWantsToOpencxx . . $ PraatP#userWantsToOpen., userWantsToSendcxx . . $ PraatP#userWantsToSend., userWantsToSendOrFormcxx . . $ PraatP#userWantsToSendOrForm., userWantsExistingInstancecxx . . $ PraatP#userWantsExistingInstance., hasFinishedLaunchingcxx . . $ PraatP#hasFinishedLaunching.;
195 bool fullTrustcxx . . $ PraatP#fullTrust.;
196 bool dontUsePictureWindowcxx . . $ PraatP#dontUsePictureWindow.; // see praat_dontUsePictureWindow ()
197 bool ignorePreferenceFilescxx . . $ PraatP#ignorePreferenceFiles., ignorePluginscxx . . $ PraatP#ignorePlugins.;
198 bool hasCommandLineInputcxx . . $ PraatP#hasCommandLineInput.;
199 GuiWindowcxx . . $ GuiWindow# menuBarcxx . . $ PraatP#menuBar.;
200 int phasecxx . . $ PraatP#phase.;
201 } praatPcxx . . $ praatP.;
202
203 struct autoPraatBackgroundcxx . . $ autoPraatBackground# {
204 autoPraatBackgroundcxx . . $ autoPraatBackground#autoPraatBackground(49f6e7a06ebc5aa8). () { praat_backgroundcxx . . $ praat_background(49f6e7a06ebc5aa8). (); }
205 ~cxx . . $ autoPraatBackground#`~autoPraatBackground`(ced63f7c635d850d).autoPraatBackgroundcxx . . $ autoPraatBackground# () { try { praat_foregroundcxx . . $ praat_foreground(49f6e7a06ebc5aa8). (); } catch (...) { Melder_clearErrorcxx . . $ Melder_clearError(49f6e7a06ebc5aa8). (); } } // BUG if called during error time
206 };
207
208 /* End of file praatP.h */