Adapted patch to Praat 5.4.14
[sgc2.git] / praat_module / adaptPraat.patch
blob7d5f0a3f84943c288658fd3b8e9e4d2eb36da730
1 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/melder_audio.cpp demo_praat_sources/sys/melder_audio.cpp
2 --- praat_sources/sys/melder_audio.cpp 2014-12-29 08:24:04.000000000 +0100
3 +++ demo_praat_sources/sys/melder_audio.cpp 2015-05-12 09:48:06.000000000 +0200
4 @@ -515,10 +515,14 @@ void MelderAudio_play16 (int16_t *buffer
5 my numberOfChannels = numberOfChannels;
6 my callback = playCallback;
7 my closure = playClosure;
8 + #ifdef DEMOAPP
9 + my asynchronicity = kMelder_asynchronicityLevel_ASYNCHRONOUS;
10 + #else
11 my asynchronicity =
12 Melder_batch ? kMelder_asynchronicityLevel_SYNCHRONOUS :
13 (Melder_backgrounding && ! Melder_asynchronous) ? kMelder_asynchronicityLevel_INTERRUPTABLE :
14 kMelder_asynchronicityLevel_ASYNCHRONOUS;
15 + #endif
16 if (my asynchronicity > preferences. maximumAsynchronicity)
17 my asynchronicity = preferences. maximumAsynchronicity;
18 trace (U"asynchronicity ", my asynchronicity);
19 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/stat/praat_Stat.cpp demo_praat_sources/stat/praat_Stat.cpp
20 --- praat_sources/stat/praat_Stat.cpp 2011-10-01 13:32:45.000000000 +0200
21 +++ demo_praat_sources/stat/praat_Stat.cpp 2011-11-18 08:55:32.000000000 +0100
22 @@ -420,7 +420,9 @@ DO
23 END2 }
25 DIRECT2 (Table_edit) {
26 +#ifndef DEMOAPP
27 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot edit a Table from batch.");
28 +#endif
29 LOOP {
30 iam (Table);
31 autoTableEditor editor = TableEditor_create (ID_AND_FULL_NAME, me);
32 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_script.cpp demo_praat_sources/sys/praat_script.cpp
33 --- praat_sources/sys/praat_script.cpp 2011-09-02 13:53:33.000000000 +0200
34 +++ demo_praat_sources/sys/praat_script.cpp 2011-10-28 07:54:25.000000000 +0200
35 @@ -585,6 +585,7 @@ void praat_executeScriptFromText (wchar
36 autoInterpreter interpreter = Interpreter_create (NULL, NULL);
37 Interpreter_run (interpreter.peek(), text);
38 } catch (MelderError) {
39 + exit (0);
40 Melder_throw (U"Script not completed.");
43 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Graphics_text.cpp demo_praat_sources/sys/Graphics_text.cpp
44 --- praat_sources/sys/Graphics_text.cpp 2011-09-29 12:27:01.000000000 +0200
45 +++ demo_praat_sources/sys/Graphics_text.cpp 2011-10-27 09:14:57.000000000 +0200
46 @@ -146,7 +146,7 @@ static HFONT loadFont (GraphicsScreen me
47 ipaInited = TRUE;
48 if (! charisAvailable && ! doulosAvailable) {
49 /* BUG: The next warning may cause reentry of drawing (on window exposure) and lead to crash. Some code must be non-reentrant !! */
50 - Melder_warning (U"The phonetic font is not available.\nSeveral characters may not look correct.\nSee www.praat.org");
51 + //Melder_warning (U"The phonetic font is not available.\nSeveral characters may not look correct.\nSee www.praat.org");
54 wcscpy (spec. lfFaceName,
55 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat.cpp demo_praat_sources/sys/praat.cpp
56 --- praat_sources/sys/praat.cpp 2014-04-22 11:09:57.000000000 +0200
57 +++ demo_praat_sources/sys/praat.cpp 2014-04-22 11:53:58.000000000 +0200
58 @@ -1144,7 +1144,7 @@ void praat_init (const char *title, unsi
59 * Make sure that the program's private directory exists.
61 #if defined (UNIX)
62 - Melder_sprint (name,256, U".", programName, U"-dir"); // for example .myProg-dir
63 + Melder_sprint (name,256, U".", programName, U""); // for example .myProg-dir
64 #elif defined (macintosh)
65 Melder_sprint (name,256, praatP.title, U" Prefs"); // for example MyProg Prefs
66 #elif defined (_WIN32)
67 @@ -1217,6 +1217,12 @@ void praat_init (const char *title, unsi
69 GuiWindow raam = NULL;
70 if (Melder_batch) {
71 + #if defined (DEMOAPP) && gtk
72 + char objectWindowTitle [100];
73 + Machine_initLookAndFeel (argc, argv);
74 + sprintf (objectWindowTitle, "%s Objects", praatP.title);
75 + GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 0, 0, Melder_peek8to32 (objectWindowTitle), gui_cb_quit, NULL, 0);
76 + #endif
77 #if defined (UNIX) || defined (macintosh) || defined (_WIN32) && defined (CONSOLE_APPLICATION)
78 MelderString_empty (& theCurrentPraatApplication -> batchName);
79 for (unsigned int i = iarg_batchName; i < argc; i ++) {
80 @@ -1263,9 +1269,11 @@ void praat_init (const char *title, unsi
81 #if motif
82 GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell);
83 #endif
84 +#ifndef DEMOAPP
85 trace (U"before objects window shows locale ", Melder_peek8to32 (setlocale (LC_ALL, NULL)));
86 GuiThing_show (raam);
87 trace (U"after objects window shows locale ", Melder_peek8to32 (setlocale (LC_ALL, NULL)));
88 +#endif
90 Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classSortedSetOfString, NULL);
91 if (Melder_batch) {
92 @@ -1275,6 +1283,9 @@ void praat_init (const char *title, unsi
93 trace (U"adding fixed buttons without GUI");
94 praat_addFixedButtons (NULL);
95 } else {
96 + #ifdef DEMOAPP
97 + Melder_backgrounding = true;
98 + #endif
100 #ifdef macintosh
101 #if ! useCarbon
102 @@ -1302,7 +1313,9 @@ void praat_init (const char *title, unsi
103 trace (U"creating the dynamic menu in the Objects window");
104 praat_actions_createDynamicMenu (raam);
105 trace (U"showing the Objects window");
106 +#ifndef DEMOAPP
107 GuiThing_show (raam);
108 +#endif
109 //Melder_fatal (U"stop");
110 #if defined (UNIX) && ! defined (NO_GRAPHICS)
111 try {
112 @@ -1331,7 +1344,12 @@ void praat_init (const char *title, unsi
114 trace (U"creating the Picture window");
115 trace (U"before picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, NULL)));
116 - if (! praatP.dontUsePictureWindow) praat_picture_init ();
117 + #ifdef DEMOAPP
118 + praat_picture_init ();
119 + praat_dontUsePictureWindow ();
120 + #else
121 + if (! praatP.dontUsePictureWindow) praat_picture_init ();
122 + #endif
123 trace (U"after picture window shows: locale is ", Melder_peek8to32 (setlocale (LC_ALL, NULL)));
126 @@ -1480,11 +1498,11 @@ void praat_run (void) {
127 if (! str32equ (Melder_integer (dummy), U"1000000000000"))
128 Melder_fatal (U"The number 1000000000000 is mistaken written on this machine as ", dummy, U".");
130 - { uint32_t dummy = 0xffffffff;
131 - Melder_assert ((int64) dummy == 4294967295LL);
132 - Melder_assert (str32equ (Melder_integer (dummy), U"4294967295"));
133 - Melder_assert (double (dummy) == 4294967295.0);
135 +// { uint32_t dummy = 0xffffffff;
136 +// Melder_assert ((int64_t) dummy == 4294967295LL);
137 +// Melder_assert (str32equ (Melder_integer (dummy), U"4294967295"));
138 +// Melder_assert (double (dummy) == 4294967295.0);
139 +// }
140 { double dummy = 3000000000.0;
141 Melder_assert ((uint32) dummy == 3000000000);
143 @@ -1628,6 +1646,14 @@ void praat_run (void) {
144 s ++;
147 + else if (thePraatStandAloneScriptText != NULL) {
148 + try {
149 + praat_executeScriptFromText (thePraatStandAloneScriptText);
150 + praat_exit (0);
151 + } catch (MelderError) {
152 + Melder_flushError (NULL);
154 + };
155 #endif
156 for (;;) {
157 XEvent event;
158 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp demo_praat_sources/sys/praat_picture.cpp
159 --- praat_sources/sys/praat_picture.cpp 2012-09-27 09:10:50.000000000 +0200
160 +++ demo_praat_sources/sys/praat_picture.cpp 2012-10-15 13:47:43.000000000 +0200
161 @@ -1511,8 +1511,10 @@ void praat_picture_open (void) {
162 #elif cocoa
163 GuiThing_show (dialog);
164 #elif motif
165 +#ifndef DEMOAPP
166 XtMapWidget (dialog -> d_xmShell);
167 XMapRaised (XtDisplay (dialog -> d_xmShell), XtWindow (dialog -> d_xmShell));
168 +#endif
169 #endif
170 Picture_unhighlight (praat_picture);
172 @@ -1796,7 +1798,9 @@ void praat_picture_init (void) {
173 width = height = resolution * 12;
174 scrollWindow = GuiScrolledWindow_createShown (dialog, margin, 0, Machine_getMenuBarHeight () + margin, 0, 1, 1, 0);
175 drawingArea = GuiDrawingArea_createShown (scrollWindow, width, height, NULL, NULL, NULL, NULL, NULL, 0);
176 +#ifndef DEMOAPP
177 GuiThing_show (dialog);
178 +#endif
181 // TODO: Paul: deze moet VOOR de update functies anders krijgen die void_me 0x0
182 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.cpp demo_praat_sources/fon/praat_TextGrid_init.cpp
183 --- praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:17:12.000000000 +0200
184 +++ demo_praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:59:25.000000000 +0200
185 @@ -855,7 +855,9 @@ static void cb_TextGridEditor_publicatio
188 DIRECT2 (TextGrid_edit) {
189 +#ifndef DEMOAPP
190 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
191 +#endif
192 Sound sound = NULL;
193 LOOP {
194 if (CLASS == classSound) sound = (Sound) OBJECT; // may stay NULL
195 @@ -886,7 +888,9 @@ DIRECT (TextGrid_edit)
196 END2 }
198 DIRECT2 (TextGrid_LongSound_edit) {
199 +#ifndef DEMOAPP
200 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
201 +#endif
202 LongSound longSound = NULL;
203 int ilongSound = 0;
204 LOOP {
205 @@ -902,7 +906,9 @@ DIRECT (TextGrid_LongSound_edit)
206 END2 }
208 DIRECT2 (TextGrid_SpellingChecker_edit) {
209 +#ifndef DEMOAPP
210 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
211 +#endif
212 SpellingChecker spellingChecker = NULL;
213 int ispellingChecker = 0;
214 Sound sound = NULL;
215 @@ -919,7 +925,9 @@ DIRECT (TextGrid_SpellingChecker_edit)
216 END2 }
218 DIRECT2 (TextGrid_LongSound_SpellingChecker_edit) {
219 +#ifndef DEMOAPP
220 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a TextGrid from batch.");
221 +#endif
222 LongSound longSound = NULL;
223 SpellingChecker spellingChecker = NULL;
224 int ilongSound = 0, ispellingChecker = 0;
225 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init.cpp demo_praat_sources/fon/praat_Sound_init.cpp
226 --- praat_sources/fon/praat_Sound_init.cpp 2012-10-11 10:39:47.000000000 +0200
227 +++ demo_praat_sources/fon/praat_Sound_init.cpp 2012-10-18 15:09:22.000000000 +0200
228 @@ -172,7 +172,9 @@ DO
229 END2 }
231 DIRECT2 (LongSound_view) {
232 +#ifndef DEMOAPP
233 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a LongSound from batch.");
234 +#endif
235 LOOP {
236 iam (LongSound);
237 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
238 @@ -717,7 +719,9 @@ static void cb_SoundEditor_publication (
241 DIRECT2 (Sound_edit) {
242 +#ifndef DEMOAPP
243 if (theCurrentPraatApplication -> batch) Melder_throw (U"Cannot view or edit a Sound from batch.");
244 +#endif
245 LOOP {
246 iam (Sound);
247 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
248 @@ -1396,8 +1400,10 @@ static void cb_SoundRecorder_publication
249 praat_updateSelection ();
251 static void do_Sound_record (int numberOfChannels) {
252 +#ifndef DEMOAPP
253 if (theCurrentPraatApplication -> batch)
254 Melder_throw (U"Cannot record a Sound from batch.");
255 +#endif
256 if (theSoundRecorder) {
257 if (numberOfChannels == thePreviousNumberOfChannels) {
258 Editor_raise (theSoundRecorder);
259 @@ -1447,10 +1453,21 @@ FORM (Sound_recordFixedTime, U"Record So
260 POSITIVE (U"Duration (seconds)", U"1.0")
263 +#if defined (_WIN32) && defined (DEMOAPP)
264 + UINT numberOfDevices = waveInGetNumDevs (), i;
265 + if(numberOfDevices > 0) {
266 +#endif
267 autoSound me = Sound_recordFixedTime (GET_INTEGER (U"Input source"),
268 GET_REAL (U"Gain"), GET_REAL (U"Balance"),
269 Melder_atof (GET_STRING (U"Sampling frequency")), GET_REAL (U"Duration"));
270 praat_new (me.transfer(), U"untitled");
271 +#if defined (_WIN32) && defined (DEMOAPP)
272 + } else {
273 + // Create an empty sound if no input is available
274 + autoSound me = Sound_createSimple (1, GET_REAL (U"Duration"), GET_REAL (U"Sampling frequency"));
275 + praat_new (me.transfer(), U"untitled");
276 + };
277 +#endif
278 END2 }
280 FORM (Sound_resample, U"Sound: Resample", U"Sound: Resample...") {
281 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Ui.cpp demo_praat_sources/sys/Ui.cpp
282 --- praat_sources/sys/Ui.cpp 2014-01-27 09:02:44.000000000 +0100
283 +++ demo_praat_sources/sys/Ui.cpp 2014-03-27 12:22:58.000000000 +0100
284 @@ -765,12 +765,16 @@ void UiForm_finish (I) {
285 iam (UiForm);
286 if (! my d_dialogParent && ! my isPauseForm) return;
288 + int numberOfContinueButtons = my numberOfContinueButtons;
289 int size = my numberOfFields;
290 int dialogHeight = 0, x = Gui_LEFT_DIALOG_SPACING, y;
291 int textFieldHeight = Gui_TEXTFIELD_HEIGHT;
292 - int dialogWidth = 520, dialogCentre = dialogWidth / 2, fieldX = dialogCentre + Gui_LABEL_SPACING / 2;
293 + int dialogWidth = REVERT_BUTTON_WIDTH + STOP_BUTTON_WIDTH + 2*Gui_LABEL_SPACING + numberOfContinueButtons*(STANDARDS_BUTTON_WIDTH + Gui_LABEL_SPACING), dialogCentre = dialogWidth / 2, fieldX = dialogCentre + Gui_LABEL_SPACING / 2;
294 int labelWidth = fieldX - Gui_LABEL_SPACING - x, fieldWidth = labelWidth, halfFieldWidth = fieldWidth / 2 - 6;
296 + /* Ensure that the dialogs are wide enough */
297 + if (dialogWidth<520) dialogWidth = 520;
299 GuiForm form;
302 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/UiPause.cpp demo_praat_sources/sys/UiPause.cpp
303 --- praat_sources/sys/UiPause.cpp 2012-09-27 09:10:50.000000000 +0200
304 +++ demo_praat_sources/sys/UiPause.cpp 2012-09-27 13:25:18.000000000 +0200
305 @@ -156,6 +156,7 @@ int UiPause_end (int numberOfContinueBut
306 {// scope
307 autoMelderSaveDefaultDir saveDir;
308 thePauseForm_clicked = 0;
309 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))thePauseForm_clicked = 1;
310 Melder_assert (theEventLoopDepth == 0);
311 theEventLoopDepth ++;
312 try {
313 @@ -179,24 +180,28 @@ int UiPause_end (int numberOfContinueBut
314 [pool release];
315 } while (! thePauseForm_clicked);
316 #elif motif
317 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15) == 0){
318 do {
319 XEvent event;
320 GuiNextEvent (& event);
321 XtDispatchEvent (& event);
322 } while (! thePauseForm_clicked);
323 + };
324 #endif
325 } catch (MelderError) {
326 Melder_flushError (U"An error made it to the outer level in a pause window; should not occur! Please write to paul.boersma@uva.nl");
328 theEventLoopDepth --;
330 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))forget(thePauseForm);
331 if (wasBackgrounding) praat_background ();
332 /* BUG: should also restore praatP. editor. */
333 thePauseForm = NULL; // undangle
334 thePauseFormRadio = NULL; // undangle
335 if (thePauseForm_clicked == -1) {
336 - Interpreter_stop (interpreter);
337 - Melder_throw (U"You interrupted the script.");
338 + thePauseForm_clicked = cancelContinueButton;
339 + //Interpreter_stop (interpreter);
340 + //Melder_throw (U"You interrupted the script.");
341 //Melder_flushError ();
342 //Melder_clearError ();
343 } else {
344 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.linux.alsa demo_praat_sources/makefiles/makefile.defs.linux.alsa
345 --- praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 10:17:12.000000000 +0200
346 +++ demo_praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 13:28:59.000000000 +0200
347 @@ -7,7 +7,7 @@ CC = gcc -std=gnu99
349 CXX = g++ -std=c++11
351 -CFLAGS = -DUNIX -Dlinux -DALSA -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0` -Werror=missing-prototypes -Werror=implicit -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O1 -g1 -pthread
352 +CFLAGS = -DUNIX -Dlinux -DALSA -D_FILE_OFFSET_BITS=64 `pkg-config --cflags gtk+-2.0` -Werror=missing-prototypes -Werror=implicit -Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -DDEMOAPP -O1 -g1 -pthread
354 CXXFLAGS = $(CFLAGS) -Wshadow
356 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw32 demo_praat_sources/makefiles/makefile.defs.mingw32
357 --- praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 12:26:39.000000000 +0200
358 +++ demo_praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 15:33:55.000000000 +0200
359 @@ -7,7 +7,7 @@ CC = /mingw32/bin/gcc -std=gnu99 -isyste
361 CXX = /mingw32/bin/g++ -std=c++0x -isystem /mingw32/include/c++/4.7.0 -isystem /mingw32/include -Wshadow
363 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
364 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
366 CXXFLAGS = $(CFLAGS)
368 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw64 demo_praat_sources/makefiles/makefile.defs.mingw64--- praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 12:26:39.000000000 +0200
369 --- praat_sources/makefiles/makefile.defs.mingw64 2011-09-19 12:26:39.000000000 +0200
370 +++ demo_praat_sources/makefiles/makefile.defs.mingw64 2011-09-19 15:33:37.000000000 +0200
371 @@ -7,7 +7,7 @@ CC = /mingw64/bin/gcc -std=gnu99 -isyste
373 CXX = /mingw64/bin/g++ -std=c++0x -isystem /mingw64/include/c++/4.7.0 -isystem /mingw64/include -Wshadow -m64
375 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
376 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
378 CXXFLAGS = $(CFLAGS)
380 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/dwtools/Intensity_extensions.cpp demo_praat_sources/dwtools/Intensity_extensions.cpp
381 --- praat_sources/dwtools/Intensity_extensions.cpp 2011-09-20 11:40:46.000000000 +0200
382 +++ demo_praat_sources/dwtools/Intensity_extensions.cpp 2011-09-28 11:45:46.000000000 +0200
383 @@ -67,8 +67,8 @@ TextGrid Intensity_to_TextGrid_detectSil
384 Vector_getMinimumAndX (me, 0, 0, 1, NUM_PEAK_INTERPOLATE_PARABOLIC, &intensity_min_db, &xOfMinimum);
385 double intensity_dbRange = intensity_max_db - intensity_min_db;
387 - if (intensity_dbRange < 10) Melder_warning (U"The loudest and softest part in your sound only differ by ",
388 - intensity_dbRange, U" dB.");
389 + /*if (intensity_dbRange < 10) Melder_warning (U"The loudest and softest part in your sound only differ by ",
390 + intensity_dbRange, U" dB.");*/
392 double intensityThreshold = intensity_max_db - fabs (silenceThreshold_dB);
394 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_objectMenus.cpp demo_praat_sources/sys/praat_objectMenus.cpp
395 --- praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:04:43.000000000 +0100
396 +++ demo_praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:48:24.000000000 +0100
397 @@ -502,8 +502,10 @@ FORM (SearchManual, U"Search manual", U"
398 TEXTFIELD (U"query", U"")
401 + #ifndef DEMOAPP
402 if (theCurrentPraatApplication -> batch)
403 Melder_throw (U"Cannot view a manual from batch.");
404 + #endif
405 Manual manPage = Manual_create (U"Intro", theCurrentPraatApplication -> manPages, false);
406 Manual_search (manPage, GET_STRING (U"query"));
407 END2 }
408 @@ -514,8 +516,10 @@ FORM (GoToManualPage, U"Go to manual pag
409 LIST (U"Page", numberOfPages, pages, 1)}
412 + #ifndef DEMOAPP
413 if (theCurrentPraatApplication -> batch)
414 Melder_throw (U"Cannot view a manual from batch.");
415 + #endif
416 Manual manPage = Manual_create (U"Intro", theCurrentPraatApplication -> manPages, false);
417 HyperPage_goToPage_i (manPage, GET_INTEGER (U"Page"));
418 END2 }
419 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/GuiMenu.cpp demo_praat_sources/sys/GuiMenu.cpp
420 --- praat_sources/sys/GuiMenu.cpp 2012-09-27 09:10:50.000000000 +0200
421 +++ demo_praat_sources/sys/GuiMenu.cpp 2012-10-25 09:55:23.000000000 +0200
422 @@ -367,7 +367,9 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
425 #elif motif
426 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
427 if (window == NULL) {
428 + #endif
429 my d_xmMenuTitle = XmCreateCascadeButton (theGuiTopMenuBar, Melder_peek32to8 (title), NULL, 0);
430 if (str32equ (title, U"Help"))
431 XtVaSetValues (theGuiTopMenuBar, XmNmenuHelpWidget, my d_xmMenuTitle, NULL);
432 @@ -376,6 +378,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
433 XtSetSensitive (my d_xmMenuTitle, False);
434 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, NULL);
435 XtManageChild (my d_xmMenuTitle);
436 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
437 } else {
438 my d_xmMenuTitle = XmCreateCascadeButton (window -> d_xmMenuBar, Melder_peek32to8 (title), NULL, 0);
439 if (str32equ (title, U"Help"))
440 @@ -386,6 +389,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
441 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, NULL);
442 XtManageChild (my d_xmMenuTitle);
444 + #endif
445 _GuiObject_setUserData (my d_widget, me);
446 #endif
448 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/DemoEditor.cpp demo_praat_sources/sys/DemoEditor.cpp
449 --- praat_sources/sys/DemoEditor.cpp 2014-05-09 08:59:02.000000000 +0200
450 +++ demo_praat_sources/sys/DemoEditor.cpp 2014-05-16 10:30:28.000000000 +0200
451 @@ -249,6 +249,7 @@ void Demo_waitForInput (Interpreter inte
452 if (theDemoEditor -> userWantsToClose) {
453 Interpreter_stop (interpreter);
454 forget (theDemoEditor);
455 + exit (0);
456 Melder_throw (U"You interrupted the script.");