| 1 | #cxx . . $ `<file>/sys/praat.h`/ifndef _praat_h_ |
| 2 | #define _praat_h_cxx . . $ `sys/praat.h:2:9`! |
| 3 | /* praat.h |
| 4 | * |
| 5 | * Copyright (C) 1992-2025 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 3 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 "ScriptEditor.h"cxx . . $ `<file>/sys/ScriptEditor.h`/ |
| 22 | #include "Manual.h"cxx . . $ `<file>/sys/Manual.h`/ |
| 23 | #include "Preferences.h"cxx . . $ `<file>/sys/Preferences.h`/ |
| 24 | |
| 25 | /* |
| 26 | The explanations in this header file assume |
| 27 | that you put your extra commands in praat_Sybil.cpp |
| 28 | and the main() function in main_Sybil.cpp, |
| 29 | but these files may have different names if you are not Sybil. |
| 30 | Linking with the rest of Praat will create an executable |
| 31 | that has all the functionality of the basic Praat, |
| 32 | plus everything that you made available in praat_Sybil.cpp. |
| 33 | */ |
| 34 | |
| 35 | /* Program example: |
| 36 | // File main_Sybil.cpp: // |
| 37 | int main (int argc, char **argv) |
| 38 | { |
| 39 | praat_init (U"Praat_Sybil", U"6.4.20", 6420, 2024, 9, 18, U"sybil", U"sybil.org", argc, argv); // obligatory |
| 40 | INCLUDE_LIBRARY (praat_uvafon_init) // optional: inherit phonetic stuff |
| 41 | INCLUDE_LIBRARY (praat_Sybil_init) // optional: add Sybil's things |
| 42 | INCLUDE_MANPAGES (manual_Sybil) |
| 43 | praat_run (); |
| 44 | return 0; // obligatory |
| 45 | } |
| 46 | // File praat_Sybil.cpp: // |
| 47 | void praat_Sybil (void) |
| 48 | { |
| 49 | ... |
| 50 | ... |
| 51 | } |
| 52 | The dots consist of, in any order: |
| 53 | Thing_recognizeClassesByName (...); |
| 54 | Data_recognizeFileType (...); |
| 55 | praat_addMenuCommand (...); |
| 56 | praat_addAction1 (...); |
| 57 | All of these statements are optional and may occur more than once. |
| 58 | To make any class string-readable, use Thing_recognizeClassesByName (). |
| 59 | String-readable classes are known by Thing_newFromClassName () and can therefore |
| 60 | be read by Data_readFromTextFile () and Data_readFromBinaryFile (). |
| 61 | */ |
| 62 | void praat_initcxx . . $ praat_init(d8f80fb324ce6fc2). (conststring32cxx . . $ conststring32# title, |
| 63 | conststring32cxx . . $ conststring32# versionText, integercxx . . $ integer# versionNumber, |
| 64 | integercxx . . $ integer# year, integercxx . . $ integer# month, integercxx . . $ integer# day, |
| 65 | conststring32cxx . . $ conststring32# firstPartOfEmailAddress, conststring32cxx . . $ conststring32# secondPartOfEmailAddress, // skip '@' to not include the full address in our binary |
| 66 | int argc, char **argv |
| 67 | ); |
| 68 | void praat_runcxx . . $ praat_run(49f6e7a06ebc5aa8). (); |
| 69 | void praat_setStandAloneScriptTextcxx . . $ praat_setStandAloneScriptText(ff00d524ab0355ec). (conststring32cxx . . $ conststring32# text); // call before praat_init if you want to create a stand-alone application without Objects and Picture window |
| 70 | extern "C" void praatlib_init (); // for use in an application that uses Praatlib |
| 71 | |
| 72 | #define praat_addAction1cxx . . $ `sys/praat.h:72:9`!(c1,n1,t,a,f,c) praat_addAction1_ (c1, n1, t, a, f, c, U"" #c) |
| 73 | #define praat_addAction2cxx . . $ `sys/praat.h:73:9`!(c1,n1,c2,n2,t,a,f,c) praat_addAction2_ (c1, n1, c2, n2, t, a, f, c, U"" #c) |
| 74 | #define praat_addAction3cxx . . $ `sys/praat.h:74:9`!(c1,n1,c2,n2,c3,n3,t,a,f,c) praat_addAction3_ (c1, n1, c2, n2, c3, n3, t, a, f, c, U"" #c) |
| 75 | #define praat_addAction4cxx . . $ `sys/praat.h:75:9`!(c1,n1,c2,n2,c3,n3,c4,n4,t,a,f,c) praat_addAction4_ (c1, n1, c2, n2, c3, n3, c4, n4, t, a, f, c, U"" #c) |
| 76 | |
| 77 | void praat_addAction1_cxx . . $ praat_addAction1_(a85663250716404b). (ClassInfocxx . . $ ClassInfo# class1, integercxx . . $ integer# n1, |
| 78 | conststring32cxx . . $ conststring32# title, conststring32cxx . . $ conststring32# after, uint32cxx . . $ uint32# flags, UiCallbackcxx . . $ UiCallback# callback, conststring32cxx . . $ conststring32# nameOfCallback); |
| 79 | void praat_addAction2_cxx . . $ praat_addAction2_(2445fc9969b00243). (ClassInfocxx . . $ ClassInfo# class1, integercxx . . $ integer# n1, ClassInfocxx . . $ ClassInfo# class2, integercxx . . $ integer# n2, |
| 80 | conststring32cxx . . $ conststring32# title, conststring32cxx . . $ conststring32# after, uint32cxx . . $ uint32# flags, UiCallbackcxx . . $ UiCallback# callback, conststring32cxx . . $ conststring32# nameOfCallback); |
| 81 | void praat_addAction3_cxx . . $ praat_addAction3_(cd8018cac012d365). (ClassInfocxx . . $ ClassInfo# class1, integercxx . . $ integer# n1, ClassInfocxx . . $ ClassInfo# class2, integercxx . . $ integer# n2, ClassInfocxx . . $ ClassInfo# class3, integercxx . . $ integer# n3, |
| 82 | conststring32cxx . . $ conststring32# title, conststring32cxx . . $ conststring32# after, uint32cxx . . $ uint32# flags, UiCallbackcxx . . $ UiCallback# callback, conststring32cxx . . $ conststring32# nameOfCallback); |
| 83 | void praat_addAction4_cxx . . $ praat_addAction4_(62e0f6ea2fdde36d). (ClassInfocxx . . $ ClassInfo# class1, integercxx . . $ integer# n1, ClassInfocxx . . $ ClassInfo# class2, integercxx . . $ integer# n2, ClassInfocxx . . $ ClassInfo# class3, integercxx . . $ integer# n3, ClassInfocxx . . $ ClassInfo# class4, integercxx . . $ integer# n4, |
| 84 | conststring32cxx . . $ conststring32# title, conststring32cxx . . $ conststring32# after, uint32cxx . . $ uint32# flags, UiCallbackcxx . . $ UiCallback# callback, conststring32cxx . . $ conststring32# nameOfCallback); |
| 85 | /* |
| 86 | 'title' is the name that will appear in the dynamic menu, |
| 87 | and also the command that is used in command files; |
| 88 | this title is deep-copied. |
| 89 | 'callback' refers to a function prototyped like this: |
| 90 | static void DO_Class_action (UiForm sendingForm, int narg, Stackel args, conststring32 sendingString, |
| 91 | Interpreter interpreter, conststring32 invokingButtonTitle, bool modified, void *closure); |
| 92 | this function should throw an exception if the command failed; |
| 93 | this function will be called by 'praat' when the user clicks a menu command, |
| 94 | in which case 'sendingForm', 'args' and 'sendingString' and 'closure' will be null; |
| 95 | it is also called by scripts, |
| 96 | in which case 'args[1..n]' or 'sendingString' is the argument list (after the dots). |
| 97 | When called by Ui (after UiForm_create), 'sendingForm' is the UiForm, and 'closure' |
| 98 | is the closure you passed to UiForm_create (which may be an editor). |
| 99 | |
| 100 | The availability of the dynamic commands depends on |
| 101 | the current selection: e.g., if the user has selected three objects |
| 102 | of type Matrix and nothing else, the commands registered with |
| 103 | praat_addAction1 (classMatrix, n, "xxx", "xxxx", x, DO_xxx) are visible, |
| 104 | and those with n=0 or n=3 are executable (the buttons are sensitive) |
| 105 | and, if chosen, performed on each of these three objects; |
| 106 | if the user has selected one object of type Artword and one of type |
| 107 | Speaker, the commands from praat_addAction2 (classArtword, 1, classSpeaker, 1, ...) are executable. |
| 108 | You may want to restrict the availability to one object for commands that write objects to file, |
| 109 | commands that present information in a dialog, or the View & Edit command. |
| 110 | */ |
| 111 | |
| 112 | void praat_removeActioncxx . . $ praat_removeAction(312e849c2af9bc10). (ClassInfocxx . . $ ClassInfo# class1, ClassInfocxx . . $ ClassInfo# class2, ClassInfocxx . . $ ClassInfo# class3, conststring32cxx . . $ conststring32# title); |
| 113 | /* 'class2' and 'class3' may be null. */ |
| 114 | /* 'title' may be null; reference-copied. */ |
| 115 | |
| 116 | #define praat_addMenuCommandcxx . . $ `sys/praat.h:116:9`!(w,m,t,a,f,c) praat_addMenuCommand_ (w, m, t, a, f, c, U"" #c) |
| 117 | GuiMenuItemcxx . . $ GuiMenuItem# praat_addMenuCommand_cxx . . $ praat_addMenuCommand_(36e798a1b8f9bedc). (conststring32cxx . . $ conststring32# window, conststring32cxx . . $ conststring32# menu, conststring32cxx . . $ conststring32# title /* cattable */, |
| 118 | conststring32cxx . . $ conststring32# after, uint32cxx . . $ uint32# flags, UiCallbackcxx . . $ UiCallback# callback, conststring32cxx . . $ conststring32# nameOfCallback); |
| 119 | /* All strings are reference-copied; 'title', 'after', and 'callback' may be null. */ |
| 120 | |
| 121 | #define praat_MAXNUM_EDITORScxx . . $ `sys/praat.h:121:9`! 5 |
| 122 | #include "Ui.h"cxx . . $ `<file>/sys/Ui.h`/ |
| 123 | typedef struct structPraat_Objectcxx . . $ structPraat_Object# { |
| 124 | ClassInfocxx . . $ ClassInfo# klascxx . . $ structPraat_Object#klas.; // the class |
| 125 | Daatacxx . . $ Daata# objectcxx . . $ structPraat_Object#object.; // the instance |
| 126 | autostring32cxx . . $ autostring32# namecxx . . $ structPraat_Object#name.; // the name of the object as it appears in the List |
| 127 | structMelderFilecxx . . $ structMelderFile# filecxx . . $ structPraat_Object#file.; // is this Object associated with a file? |
| 128 | integercxx . . $ integer# idcxx . . $ structPraat_Object#id.; // the unique number of the object |
| 129 | bool isSelectedcxx . . $ structPraat_Object#isSelected.; // is the name of the object inverted in the list? |
| 130 | Editorcxx . . $ Editor# editorscxx . . $ structPraat_Object#editors. [praat_MAXNUM_EDITORScxx . . $ `sys/praat.h:121:9`!]; // are there editors open with this Object in it? |
| 131 | bool isBeingCreatedcxx . . $ structPraat_Object#isBeingCreated.; |
| 132 | } *praat_Objectcxx . . $ praat_Object#; |
| 133 | |
| 134 | #define praat_MAXNUM_OBJECTScxx . . $ `sys/praat.h:134:9`! 10000 /* Maximum number of objects in the list. */ |
| 135 | typedef struct structPraatApplicationcxx . . $ structPraatApplication# { // read-only (for interface files) |
| 136 | MelderStringcxx . . $ MelderString# batchNamecxx . . $ structPraatApplication#batchName.; // the name of the command file when called from batch |
| 137 | bool batchcxx . . $ structPraatApplication#batch.; // was the program called from the command line? |
| 138 | GuiWindowcxx . . $ GuiWindow# topShellcxx . . $ structPraatApplication#topShell.; // the application shell: parent of standard dialogs |
| 139 | ManPagescxx . . $ ManPages# manPagescxx . . $ structPraatApplication#manPages.; |
| 140 | } *PraatApplicationcxx . . $ PraatApplication#; |
| 141 | typedef struct structPraatObjectscxx . . $ structPraatObjects# { // read-only (for interface files) |
| 142 | integercxx . . $ integer# ncxx . . $ structPraatObjects#n.; // the current number of objects in the list |
| 143 | structPraat_Objectcxx . . $ structPraat_Object# listcxx . . $ structPraatObjects#list. [1 + praat_MAXNUM_OBJECTScxx . . $ `sys/praat.h:134:9`!]; // the list of objects: list [1..n] |
| 144 | integercxx . . $ integer# totalSelectioncxx . . $ structPraatObjects#totalSelection.; // the total number of selected objects, <= n |
| 145 | static constexpr integercxx . . $ integer# MAXNUM_DATA_CLASSEScxx . . $ structPraatObjects#MAXNUM_DATA_CLASSES. = 1000; |
| 146 | integercxx . . $ integer# numberOfSelectedcxx . . $ structPraatObjects#numberOfSelected. [1 + MAXNUM_DATA_CLASSEScxx . . $ structPraatObjects#MAXNUM_DATA_CLASSES.]; // for each (readable) class |
| 147 | integercxx . . $ integer# totalBeingCreatedcxx . . $ structPraatObjects#totalBeingCreated.; |
| 148 | integercxx . . $ integer# sequentialUniqueIdOfLatestObjectInListcxx . . $ structPraatObjects#sequentialUniqueIdOfLatestObjectInList.; |
| 149 | void resetcxx . . $ structPraatObjects#reset(49f6e7a06ebc5aa8). () { |
| 150 | for (integercxx . . $ integer# iobject = ourcxx . . $ `melder/melder.h:42:9`! ncxx . . $ structPraatObjects#n.; iobject >= 1; iobject --) { |
| 151 | ourcxx . . $ `melder/melder.h:42:9`! listcxx . . $ structPraatObjects#list. [iobject]. namecxx . . $ structPraat_Object#name.. resetcxx . . $ _autostring#reset(49f6e7a06ebc5aa8).(); |
| 152 | forgetcxx . . $ `sys/Thing.h:158:9`! (ourcxx . . $ `melder/melder.h:42:9`! list [iobject]. object); |
| 153 | } |
| 154 | #if 0 |
| 155 | memset (this, 0, sizeof (structPraatObjects)); |
| 156 | #else |
| 157 | ourcxx . . $ `melder/melder.h:42:9`! ncxx . . $ structPraatObjects#n. = 0; |
| 158 | ourcxx . . $ `melder/melder.h:42:9`! totalSelectioncxx . . $ structPraatObjects#totalSelection. = 0; |
| 159 | for (integercxx . . $ integer# i = 1; i <= MAXNUM_DATA_CLASSEScxx . . $ structPraatObjects#MAXNUM_DATA_CLASSES.; i ++) |
| 160 | ourcxx . . $ `melder/melder.h:42:9`! numberOfSelectedcxx . . $ structPraatObjects#numberOfSelected. [i] = 0; |
| 161 | #endif |
| 162 | } |
| 163 | } *PraatObjectscxx . . $ PraatObjects#; |
| 164 | typedef struct structPraatPicturecxx . . $ structPraatPicture# { // read-only (for interface files) |
| 165 | Graphicscxx . . $ Graphics# graphicscxx . . $ structPraatPicture#graphics.; // the Graphics associated with the Picture window |
| 166 | kGraphics_fontcxx . . $ kGraphics_font# fontcxx . . $ structPraatPicture#font.; |
| 167 | int lineTypecxx . . $ structPraatPicture#lineType.; |
| 168 | double fontSizecxx . . $ structPraatPicture#fontSize.; |
| 169 | MelderColourcxx . . $ MelderColour# colourcxx . . $ structPraatPicture#colour.; |
| 170 | double lineWidthcxx . . $ structPraatPicture#lineWidth., arrowSizecxx . . $ structPraatPicture#arrowSize., speckleSizecxx . . $ structPraatPicture#speckleSize., x1NDCcxx . . $ structPraatPicture#x1NDC., x2NDCcxx . . $ structPraatPicture#x2NDC., y1NDCcxx . . $ structPraatPicture#y1NDC., y2NDCcxx . . $ structPraatPicture#y2NDC.; |
| 171 | } *PraatPicturecxx . . $ PraatPicture#; |
| 172 | /* |
| 173 | The following six cannot be "inline", |
| 174 | because that would cost 42 MB (per architecture) |
| 175 | on the Mac or on Windows (though nothing on Linux), |
| 176 | i.e. a full copy of all three structures. |
| 177 | (ppgb 2021-04-15) |
| 178 | */ |
| 179 | extern structPraatApplicationcxx . . $ structPraatApplication# theForegroundPraatApplicationcxx . . $ theForegroundPraatApplication.; |
| 180 | extern PraatApplicationcxx . . $ PraatApplication# theCurrentPraatApplicationcxx . . $ theCurrentPraatApplication.; |
| 181 | extern structPraatObjectscxx . . $ structPraatObjects# theForegroundPraatObjectscxx . . $ theForegroundPraatObjects.; |
| 182 | extern PraatObjectscxx . . $ PraatObjects# theCurrentPraatObjectscxx . . $ theCurrentPraatObjects.; |
| 183 | extern structPraatPicturecxx . . $ structPraatPicture# theForegroundPraatPicturecxx . . $ theForegroundPraatPicture.; |
| 184 | extern PraatPicturecxx . . $ PraatPicture# theCurrentPraatPicturecxx . . $ theCurrentPraatPicture.; |
| 185 | /* The global objects containing the state of the application; only reachable from interface files. */ |
| 186 | bool praat_commandsWithExternalSideEffectsAreAllowedcxx . . $ praat_commandsWithExternalSideEffectsAreAllowed(c9857a73d68e59ba). (); |
| 187 | |
| 188 | char32cxx . . $ char32# *praat_namecxx . . $ praat_name(84072f118ef1d63c). (integercxx . . $ integer# iobject); |
| 189 | void praat_write_docxx . . $ praat_write_do(dd78e4d327935865). (UiFormcxx . . $ UiForm# dia, conststring32cxx . . $ conststring32# extension); |
| 190 | void praat_newcxx . . $ praat_new(90806586bd778ea4). (autoDaatacxx . . $ autoDaata# me); |
| 191 | void praat_newcxx . . $ praat_new(1e9b2ae553a98dd1). (autoDaatacxx . . $ autoDaata# me, const MelderArgcxx . . $ MelderArg#& arg); |
| 192 | void praat_newcxx . . $ praat_new(7e14453ab0f22ea). (autoDaatacxx . . $ autoDaata# me, const MelderArgcxx . . $ MelderArg#& arg1, const MelderArgcxx . . $ MelderArg#& arg2, |
| 193 | const MelderArgcxx . . $ MelderArg#& arg3 = U""cxx . . $ MelderArg#MelderArg(ff00d524ab0355ec)., const MelderArgcxx . . $ MelderArg#& arg4 = U""cxx . . $ MelderArg#MelderArg(ff00d524ab0355ec)., const MelderArgcxx . . $ MelderArg#& arg5 = U""cxx . . $ MelderArg#MelderArg(ff00d524ab0355ec).); |
| 194 | void praat_newWithFilecxx . . $ praat_newWithFile(edccf1f4beee5182). (autoDaatacxx . . $ autoDaata# me, MelderFilecxx . . $ MelderFile# file, conststring32cxx . . $ conststring32# name); |
| 195 | void praat_name2cxx . . $ praat_name2(aec8d7b6328952bc). (char32cxx . . $ char32# *name, ClassInfocxx . . $ ClassInfo# klas1, ClassInfocxx . . $ ClassInfo# klas2); |
| 196 | |
| 197 | #define iam_LOOPcxx . . $ `sys/praat.h:197:9`!(klas) klas me = static_cast<klas> (OBJECTcxx . . $ `sys/praat.h:203:9`!) |
| 198 | #define WHEREcxx . . $ `sys/praat.h:198:9`!(condition) for (IOBJECT = 1; IOBJECT <= theCurrentPraatObjects -> n; IOBJECT ++) if (condition) |
| 199 | #define WHERE_DOWNcxx . . $ `sys/praat.h:199:9`!(condition) for (IOBJECT = theCurrentPraatObjects -> n; IOBJECT > 0; IOBJECT --) if (condition) |
| 200 | #define SELECTEDcxx . . $ `sys/praat.h:200:9`! (theCurrentPraatObjects -> list [IOBJECT]. isSelected) |
| 201 | #define LOOPcxx . . $ `sys/praat.h:201:9`! for (IOBJECT = 1; IOBJECT <= theCurrentPraatObjects -> n; IOBJECT ++) if (SELECTEDcxx . . $ `sys/praat.h:200:9`!) |
| 202 | #define CLASScxx . . $ `sys/praat.h:202:9`! (theCurrentPraatObjects -> list [IOBJECT]. klas) |
| 203 | #define OBJECTcxx . . $ `sys/praat.h:203:9`! (theCurrentPraatObjects -> list [IOBJECT]. object) |
| 204 | #define GRAPHICScxx . . $ `sys/praat.h:204:9`! theCurrentPraatPicture -> graphics |
| 205 | #define FULL_NAMEcxx . . $ `sys/praat.h:205:9`! (theCurrentPraatObjects -> list [IOBJECT]. name.get()) |
| 206 | #define IDcxx . . $ `sys/praat.h:206:9`! (theCurrentPraatObjects -> list [IOBJECT]. id) |
| 207 | #define ID_AND_FULL_NAMEcxx . . $ `sys/praat.h:207:9`! Melder_cat (ID, U". ", FULL_NAME) |
| 208 | #define NAMEcxx . . $ `sys/praat.h:208:9`! praat_name (IOBJECT) |
| 209 | |
| 210 | /* Used by praat_Sybil.cpp, if you put an Editor on the screen: */ |
| 211 | void praat_installEditorcxx . . $ praat_installEditor(66c68acc57a91daa). (Editorcxx . . $ Editor# editor, integercxx . . $ integer# iobject); |
| 212 | /* This routine adds a reference to a new editor (unless it is null) to the screen object |
| 213 | which is in the list at position 'iobject'. |
| 214 | It sets the destroyCallback and dataChangedCallback as appropriate for Praat: |
| 215 | the destroyCallback will set the now dangling reference to nullptr, |
| 216 | so that a subsequent click on the "View & Edit" button will create a new editor; |
| 217 | the dataChangedCallback will notify an open DataEditor with the same data, |
| 218 | after that data will have changed. |
| 219 | */ |
| 220 | void praat_installEditor2cxx . . $ praat_installEditor2(e9df3903f23ec0aa). (Editorcxx . . $ Editor# editor, integercxx . . $ integer# iobject1, integercxx . . $ integer# iobject2); |
| 221 | void praat_installEditor3cxx . . $ praat_installEditor3(ab2b30ea4ecbad1). (Editorcxx . . $ Editor# editor, integercxx . . $ integer# iobject1, integercxx . . $ integer# iobject2, integercxx . . $ integer# iobject3); |
| 222 | void praat_installEditorNcxx . . $ praat_installEditorN(517a323f6303e47). (Editorcxx . . $ Editor# editor, DaataListcxx . . $ DaataList# objects); |
| 223 | |
| 224 | void praat_dataChangedcxx . . $ praat_dataChanged(fde123624714e72). (Daatacxx . . $ Daata# object); |
| 225 | /* Call this after changing a screen object. */ |
| 226 | /* Associated editors and data editors will be notified (with Editor_dataChanged). */ |
| 227 | |
| 228 | /* Used by praat.cpp, praat_Basic.cpp, and praat_Sybil.cpp; defined in praat_picture.cpp. |
| 229 | */ |
| 230 | void praat_picture_opencxx . . $ praat_picture_open(49f6e7a06ebc5aa8). (); |
| 231 | void praat_picture_closecxx . . $ praat_picture_close(49f6e7a06ebc5aa8). (); |
| 232 | /* These two routines should bracket drawing commands. */ |
| 233 | /* However, they usually do so RAII-wise by being packed into autoPraatPictureOpen (see GRAPHICS_EACH). */ |
| 234 | |
| 235 | /* For main.cpp */ |
| 236 | |
| 237 | #define INCLUDE_LIBRARYcxx . . $ `sys/praat.h:237:9`!(praat_xxx_init) \ |
| 238 | { extern void praat_xxx_init (); praat_xxx_init (); } |
| 239 | #define INCLUDE_MANPAGEScxx . . $ `sys/praat.h:239:9`!(manual_xxx_init) \ |
| 240 | { extern void manual_xxx_init (ManPages me); manual_xxx_init (theCurrentPraatApplication -> manPages); } |
| 241 | |
| 242 | /* For text-only applications that do not want to see that irritating Picture window. */ |
| 243 | /* Works only if called before praat_init. */ |
| 244 | /* The program will crash if you still try to use drawing routines. */ |
| 245 | void praat_dontUsePictureWindowcxx . . $ praat_dontUsePictureWindow(49f6e7a06ebc5aa8). (); |
| 246 | |
| 247 | /* Before praat_init: */ |
| 248 | void praat_setLogocxx . . $ praat_setLogo(e52f01cf3c7c2f40). (double width_mm, double height_mm, void (*draw) (Graphicscxx . . $ Graphics# g)); |
| 249 | |
| 250 | /* Removing objects from the list. */ |
| 251 | /* To remove the selected objects of class Klas from the list: */ |
| 252 | /* |
| 253 | for (i = praat.n; i >= 1; i --) // Down! |
| 254 | if (praat.list[i].selected && Thing_isa (praat.list[i].object, classKlas) |
| 255 | praat_removeObject (i); |
| 256 | praat_show (); // Needed because the selection has changed. |
| 257 | */ |
| 258 | void praat_removeObjectcxx . . $ praat_removeObject(1624ee8275b10bda). (integercxx . . $ integer# i); // i = 1..praat.n |
| 259 | void praat_showcxx . . $ praat_show(49f6e7a06ebc5aa8). (); // forces an update of the dynamic menu |
| 260 | void praat_updateSelectioncxx . . $ praat_updateSelection(49f6e7a06ebc5aa8). (); |
| 261 | /* If you require the correct selection immediately after calling praat_new. */ |
| 262 | |
| 263 | void praat_addCommandsToEditorcxx . . $ praat_addCommandsToEditor(c0154a85f79216c7). (Editorcxx . . $ Editor# me); |
| 264 | |
| 265 | autoCollectioncxx . . $ autoCollection# praat_getSelectedObjectscxx . . $ praat_getSelectedObjects(859008c51157a0cd). (); |
| 266 | |
| 267 | struct autoPraatPictureOpencxx . . $ autoPraatPictureOpen# { |
| 268 | autoPraatPictureOpencxx . . $ autoPraatPictureOpen#autoPraatPictureOpen(49f6e7a06ebc5aa8). () { praat_picture_opencxx . . $ praat_picture_open(49f6e7a06ebc5aa8). (); } |
| 269 | ~cxx . . $ autoPraatPictureOpen#`~autoPraatPictureOpen`(ced63f7c635d850d).autoPraatPictureOpencxx . . $ autoPraatPictureOpen# () { praat_picture_closecxx . . $ praat_picture_close(49f6e7a06ebc5aa8). (); } |
| 270 | }; |
| 271 | |
| 272 | #if defined (_WIN32) |
| 273 | #define main wingwmain |
| 274 | #endif |
| 275 | |
| 276 | /* End of file praat.h */ |
| 277 | #endif |