Adapted patch to Praat 5.4.09, e.g., changes in character width, char32/U/L
[sgc2.git] / praat_module / adaptPraat.patch
blob2f9d6860de86dd4439907182261c0c7ed331bfcb
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 ("asynchronicity %d", (int) 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 @@ -424,7 +424,9 @@ DO
23 END2 }
25 DIRECT2 (Table_edit) {
26 +#ifndef DEMOAPP
27 if (theCurrentPraatApplication -> batch) Melder_throw ("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 @@ -596,6 +596,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 (L"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 (L"The phonetic font is not available.\nSeveral characters will not look correct.\nSee www.praat.org");
51 + //Melder_warning (L"The phonetic font is not available.\nSeveral characters will not look correct.\nSee www.praat.org");
52 } else {
53 ipaAvailable = true;
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 @@ -1249,6 +1249,12 @@ void praat_init (const char *title, unsi
60 GuiWindow raam = NULL;
61 if (Melder_batch) {
62 + #if defined (DEMOAPP) && gtk
63 + char objectWindowTitle [100];
64 + Machine_initLookAndFeel (argc, argv);
65 + sprintf (objectWindowTitle, "%s Objects", praatP.title);
66 + GuiWindow_create (0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, 0, 0, Melder_peekUtf8ToWcs (objectWindowTitle), gui_cb_quit, NULL, 0);
67 + #endif
68 #if defined (UNIX) || defined (macintosh) || defined (_WIN32) && defined (CONSOLE_APPLICATION)
69 MelderString32_empty (& theCurrentPraatApplication -> batchName);
70 for (unsigned int i = iarg_batchName; i < argc; i ++) {
71 @@ -1295,9 +1301,11 @@ void praat_init (const char *title, unsi
72 #if motif
73 GuiApp_setApplicationShell (theCurrentPraatApplication -> topShell -> d_xmShell);
74 #endif
75 +#ifndef DEMOAPP
76 trace ("before objects window shows locale %s", setlocale (LC_ALL, NULL));
77 GuiThing_show (raam);
78 trace ("after objects window shows locale %s", setlocale (LC_ALL, NULL));
79 +#endif
81 Thing_recognizeClassesByName (classCollection, classStrings, classManPages, classSortedSetOfString, NULL);
82 if (Melder_batch) {
83 @@ -1307,6 +1315,9 @@ void praat_init (const char *title, unsi
84 trace ("adding fixed buttons without GUI");
85 praat_addFixedButtons (NULL);
86 } else {
87 + #ifdef DEMOAPP
88 + Melder_backgrounding = true;
89 + #endif
91 #ifdef macintosh
92 #if ! useCarbon
93 @@ -1334,7 +1345,9 @@ void praat_init (const char *title, unsi
94 trace ("creating the dynamic menu in the Objects window");
95 praat_actions_createDynamicMenu (raam);
96 trace ("showing the Objects window");
97 +#ifndef DEMOAPP
98 GuiThing_show (raam);
99 +#endif
100 //Melder_fatal ("stop");
101 #if defined (UNIX) && ! defined (NO_GRAPHICS)
102 try {
103 @@ -1363,7 +1376,12 @@ void praat_init (const char *title, unsi
105 trace ("creating the Picture window");
106 trace ("before picture window shows: locale is %s", setlocale (LC_ALL, NULL));
107 - if (! praatP.dontUsePictureWindow) praat_picture_init ();
108 + #ifdef DEMOAPP
109 + praat_picture_init ();
110 + praat_dontUsePictureWindow ();
111 + #else
112 + if (! praatP.dontUsePictureWindow) praat_picture_init ();
113 + #endif
114 trace ("after picture window shows: locale is %s", setlocale (LC_ALL, NULL));
117 @@ -1515,11 +1533,11 @@ void praat_run (void) {
118 if (! wcsequ (Melder_integer (dummy), L"1000000000000"))
119 Melder_fatal ("The number 1000000000000 is mistaken written on this machine as %ls", Melder_integer (dummy));
121 - { uint32_t dummy = 0xffffffff;
122 - Melder_assert ((int64_t) dummy == 4294967295LL);
123 - Melder_assert (wcsequ (Melder_integer (dummy), L"4294967295"));
124 - Melder_assert (double (dummy) == 4294967295.0);
126 +// { uint32_t dummy = 0xffffffff;
127 +// Melder_assert ((int64_t) dummy == 4294967295LL);
128 +// Melder_assert (wcsequ (Melder_integer (dummy), L"4294967295"));
129 +// Melder_assert (double (dummy) == 4294967295.0);
130 +// }
131 { double dummy = 3000000000.0;
132 Melder_assert ((uint32_t) dummy == 3000000000);
134 @@ -1664,6 +1682,14 @@ void praat_run (void) {
135 s ++;
138 + else if (thePraatStandAloneScriptText != NULL) {
139 + try {
140 + praat_executeScriptFromText (thePraatStandAloneScriptText);
141 + praat_exit (0);
142 + } catch (MelderError) {
143 + Melder_flushError (NULL);
145 + };
146 #endif
147 for (;;) {
148 XEvent event;
149 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_picture.cpp demo_praat_sources/sys/praat_picture.cpp
150 --- praat_sources/sys/praat_picture.cpp 2012-09-27 09:10:50.000000000 +0200
151 +++ demo_praat_sources/sys/praat_picture.cpp 2012-10-15 13:47:43.000000000 +0200
152 @@ -1478,8 +1478,10 @@ void praat_picture_open (void) {
153 #elif cocoa
154 GuiThing_show (dialog);
155 #elif motif
156 +#ifndef DEMOAPP
157 XtMapWidget (dialog -> d_xmShell);
158 XMapRaised (XtDisplay (dialog -> d_xmShell), XtWindow (dialog -> d_xmShell));
159 +#endif
160 #endif
161 Picture_unhighlight (praat_picture);
163 @@ -1767,7 +1769,9 @@ void praat_picture_init (void) {
164 width = height = resolution * 12;
165 scrollWindow = GuiScrolledWindow_createShown (dialog, margin, 0, Machine_getMenuBarHeight () + margin, 0, 1, 1, 0);
166 drawingArea = GuiDrawingArea_createShown (scrollWindow, width, height, NULL, NULL, NULL, NULL, NULL, 0);
167 +#ifndef DEMOAPP
168 GuiThing_show (dialog);
169 +#endif
172 // TODO: Paul: deze moet VOOR de update functies anders krijgen die void_me 0x0
173 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_TextGrid_init.cpp demo_praat_sources/fon/praat_TextGrid_init.cpp
174 --- praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:17:12.000000000 +0200
175 +++ demo_praat_sources/fon/praat_TextGrid_init.cpp 2011-09-12 10:59:25.000000000 +0200
176 @@ -825,7 +825,9 @@ static void cb_TextGridEditor_publicatio
179 DIRECT2 (TextGrid_edit) {
180 +#ifndef DEMOAPP
181 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
182 +#endif
183 Sound sound = NULL;
184 LOOP {
185 if (CLASS == classSound) sound = (Sound) OBJECT; // may stay NULL
186 @@ -856,7 +858,9 @@ DIRECT (TextGrid_edit)
187 END2 }
189 DIRECT2 (TextGrid_LongSound_edit) {
190 +#ifndef DEMOAPP
191 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
192 +#endif
193 LongSound longSound = NULL;
194 int ilongSound = 0;
195 LOOP {
196 @@ -872,7 +876,9 @@ DIRECT (TextGrid_LongSound_edit)
197 END2 }
199 DIRECT2 (TextGrid_SpellingChecker_edit) {
200 +#ifndef DEMOAPP
201 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
202 +#endif
203 SpellingChecker spellingChecker = NULL;
204 int ispellingChecker = 0;
205 Sound sound = NULL;
206 @@ -889,7 +895,9 @@ DIRECT (TextGrid_SpellingChecker_edit)
207 END2 }
209 DIRECT2 (TextGrid_LongSound_SpellingChecker_edit) {
210 +#ifndef DEMOAPP
211 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a TextGrid from batch.");
212 +#endif
213 LongSound longSound = NULL;
214 SpellingChecker spellingChecker = NULL;
215 int ilongSound = 0, ispellingChecker = 0;
216 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/fon/praat_Sound_init.cpp demo_praat_sources/fon/praat_Sound_init.cpp
217 --- praat_sources/fon/praat_Sound_init.cpp 2012-10-11 10:39:47.000000000 +0200
218 +++ demo_praat_sources/fon/praat_Sound_init.cpp 2012-10-18 15:09:22.000000000 +0200
219 @@ -172,7 +172,9 @@ DO
220 END2 }
222 DIRECT2 (LongSound_view) {
223 +#ifndef DEMOAPP
224 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a LongSound from batch.");
225 +#endif
226 LOOP {
227 iam (LongSound);
228 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
229 @@ -718,7 +720,9 @@ static void cb_SoundEditor_publication (
232 DIRECT2 (Sound_edit) {
233 +#ifndef DEMOAPP
234 if (theCurrentPraatApplication -> batch) Melder_throw ("Cannot view or edit a Sound from batch.");
235 +#endif
236 LOOP {
237 iam (Sound);
238 autoSoundEditor editor = SoundEditor_create (ID_AND_FULL_NAME, me);
239 @@ -1397,8 +1401,10 @@ static void cb_SoundRecorder_publication
240 praat_updateSelection ();
242 static void do_Sound_record (int numberOfChannels) {
243 +#ifndef DEMOAPP
244 if (theCurrentPraatApplication -> batch)
245 Melder_throw ("Cannot record a Sound from batch.");
246 +#endif
247 if (theSoundRecorder) {
248 if (numberOfChannels == thePreviousNumberOfChannels) {
249 Editor_raise (theSoundRecorder);
250 @@ -1448,10 +1454,21 @@ FORM (Sound_recordFixedTime, L"Record So
251 POSITIVE (L"Duration (seconds)", L"1.0")
254 +#if defined (_WIN32) && defined (DEMOAPP)
255 + UINT numberOfDevices = waveInGetNumDevs (), i;
256 + if(numberOfDevices > 0) {
257 +#endif
258 autoSound me = Sound_recordFixedTime (GET_INTEGER (L"Input source"),
259 GET_REAL (L"Gain"), GET_REAL (L"Balance"),
260 wcstod (GET_STRING (L"Sampling frequency"), NULL), GET_REAL (L"Duration"));
261 praat_new (me.transfer(), L"untitled");
262 +#if defined (_WIN32) && defined (DEMOAPP)
263 + } else {
264 + // Create an empty sound if no input is available
265 + autoSound me = Sound_createSimple (1, GET_REAL (L"Duration"), wcstod (GET_STRING (L"Sampling frequency"), NULL));
266 + praat_new (me.transfer(), L"untitled");
267 + };
268 +#endif
269 END2 }
271 FORM (Sound_resample, L"Sound: Resample", L"Sound: Resample...") {
272 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/Ui.cpp demo_praat_sources/sys/Ui.cpp
273 --- praat_sources/sys/Ui.cpp 2014-01-27 09:02:44.000000000 +0100
274 +++ demo_praat_sources/sys/Ui.cpp 2014-03-27 12:22:58.000000000 +0100
275 @@ -762,12 +762,16 @@ void UiForm_finish (I) {
276 iam (UiForm);
277 if (! my d_dialogParent && ! my isPauseForm) return;
279 + int numberOfContinueButtons = my numberOfContinueButtons;
280 int size = my numberOfFields;
281 int dialogHeight = 0, x = Gui_LEFT_DIALOG_SPACING, y;
282 int textFieldHeight = Gui_TEXTFIELD_HEIGHT;
283 - int dialogWidth = 520, dialogCentre = dialogWidth / 2, fieldX = dialogCentre + Gui_LABEL_SPACING / 2;
284 + 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;
285 int labelWidth = fieldX - Gui_LABEL_SPACING - x, fieldWidth = labelWidth, halfFieldWidth = fieldWidth / 2 - 6;
287 + /* Ensure that the dialogs are wide enough */
288 + if (dialogWidth<520) dialogWidth = 520;
290 GuiForm form;
293 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/UiPause.cpp demo_praat_sources/sys/UiPause.cpp
294 --- praat_sources/sys/UiPause.cpp 2012-09-27 09:10:50.000000000 +0200
295 +++ demo_praat_sources/sys/UiPause.cpp 2012-09-27 13:25:18.000000000 +0200
296 @@ -159,6 +159,7 @@ int UiPause_end (int numberOfContinueBut
297 {// scope
298 autoMelderSaveDefaultDir saveDir;
299 thePauseForm_clicked = 0;
300 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))thePauseForm_clicked = 1;
301 Melder_assert (theEventLoopDepth == 0);
302 theEventLoopDepth ++;
303 try {
304 @@ -182,24 +183,28 @@ int UiPause_end (int numberOfContinueBut
305 [pool release];
306 } while (! thePauseForm_clicked);
307 #elif motif
308 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15) == 0){
309 do {
310 XEvent event;
311 GuiNextEvent (& event);
312 XtDispatchEvent (& event);
313 } while (! thePauseForm_clicked);
314 + };
315 #endif
316 } catch (MelderError) {
317 Melder_flushError ("An error made it to the outer level in a pause window; should not occur! Please write to paul.boersma@uva.nl");
319 theEventLoopDepth --;
321 + if(str32nequ(continueText1, U"DESTROY WINDOW ", 15))forget(thePauseForm);
322 if (wasBackgrounding) praat_background ();
323 /* BUG: should also restore praatP. editor. */
324 thePauseForm = NULL; // undangle
325 thePauseFormRadio = NULL; // undangle
326 if (thePauseForm_clicked == -1) {
327 - Interpreter_stop (interpreter);
328 - Melder_throw ("You interrupted the script.");
329 + thePauseForm_clicked = cancelContinueButton;
330 + //Interpreter_stop (interpreter);
331 + //Melder_throw ("You interrupted the script.");
332 //Melder_flushError (NULL);
333 //Melder_clearError ();
334 } else {
335 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.linux.alsa demo_praat_sources/makefiles/makefile.defs.linux.alsa
336 --- praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 10:17:12.000000000 +0200
337 +++ demo_praat_sources/makefiles/makefile.defs.linux.alsa 2011-09-12 13:28:59.000000000 +0200
338 @@ -7,7 +7,7 @@ CC = gcc -std=gnu99
340 CXX = g++ -std=c++11
342 -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
343 +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
345 CXXFLAGS = $(CFLAGS) -Wshadow
347 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/makefiles/makefile.defs.mingw32 demo_praat_sources/makefiles/makefile.defs.mingw32
348 --- praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 12:26:39.000000000 +0200
349 +++ demo_praat_sources/makefiles/makefile.defs.mingw32 2011-09-19 15:33:55.000000000 +0200
350 @@ -7,7 +7,7 @@ CC = /mingw32/bin/gcc -std=gnu99 -isyste
352 CXX = /mingw32/bin/g++ -std=c++0x -isystem /mingw32/include/c++/4.7.0 -isystem /mingw32/include -Wshadow
354 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
355 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
357 CXXFLAGS = $(CFLAGS)
359 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
360 --- praat_sources/makefiles/makefile.defs.mingw64 2011-09-19 12:26:39.000000000 +0200
361 +++ demo_praat_sources/makefiles/makefile.defs.mingw64 2011-09-19 15:33:37.000000000 +0200
362 @@ -7,7 +7,7 @@ CC = /mingw64/bin/gcc -std=gnu99 -isyste
364 CXX = /mingw64/bin/g++ -std=c++0x -isystem /mingw64/include/c++/4.7.0 -isystem /mingw64/include -Wshadow -m64
366 -CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread
367 +CFLAGS = -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500 -DUNICODE -D_FILE_OFFSET_BITS=64 -Dmain=wingwmain -O1 -pthread -DDEMOAPP
369 CXXFLAGS = $(CFLAGS)
371 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/dwtools/Intensity_extensions.cpp demo_praat_sources/dwtools/Intensity_extensions.cpp
372 --- praat_sources/dwtools/Intensity_extensions.cpp 2011-09-20 11:40:46.000000000 +0200
373 +++ demo_praat_sources/dwtools/Intensity_extensions.cpp 2011-09-28 11:45:46.000000000 +0200
374 @@ -67,8 +67,8 @@ TextGrid Intensity_to_TextGrid_detectSil
375 Vector_getMinimumAndX (me, 0, 0, 1, NUM_PEAK_INTERPOLATE_PARABOLIC, &intensity_min_db, &xOfMinimum);
376 double intensity_dbRange = intensity_max_db - intensity_min_db;
378 - if (intensity_dbRange < 10) Melder_warning (L"The loudest and softest part in your sound only differ by ",
379 - Melder_double (intensity_dbRange), L" dB.");
380 + /*if (intensity_dbRange < 10) Melder_warning (L"The loudest and softest part in your sound only differ by ",
381 + Melder_double (intensity_dbRange), L" dB.");*/
383 double intensityThreshold = intensity_max_db - fabs (silenceThreshold_dB);
385 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/praat_objectMenus.cpp demo_praat_sources/sys/praat_objectMenus.cpp
386 --- praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:04:43.000000000 +0100
387 +++ demo_praat_sources/sys/praat_objectMenus.cpp 2012-02-22 13:48:24.000000000 +0100
388 @@ -492,8 +492,10 @@ FORM (SearchManual, L"Search manual", L"
389 TEXTFIELD (L"query", L"")
392 + #ifndef DEMOAPP
393 if (theCurrentPraatApplication -> batch)
394 Melder_throw (L"Cannot view a manual from batch.");
395 + #endif
396 Manual manPage = Manual_create (L"Intro", theCurrentPraatApplication -> manPages, false);
397 Manual_search (manPage, GET_STRING (L"query"));
398 END2 }
399 @@ -504,8 +506,10 @@ FORM (GoToManualPage, L"Go to manual pag
400 LIST (L"Page", numberOfPages, pages, 1)}
403 + #ifndef DEMOAPP
404 if (theCurrentPraatApplication -> batch)
405 Melder_throw (L"Cannot view a manual from batch.");
406 + #endif
407 Manual manPage = Manual_create (L"Intro", theCurrentPraatApplication -> manPages, false);
408 HyperPage_goToPage_i (manPage, GET_INTEGER (L"Page"));
409 END2 }
410 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/GuiMenu.cpp demo_praat_sources/sys/GuiMenu.cpp
411 --- praat_sources/sys/GuiMenu.cpp 2012-09-27 09:10:50.000000000 +0200
412 +++ demo_praat_sources/sys/GuiMenu.cpp 2012-10-25 09:55:23.000000000 +0200
413 @@ -367,7 +367,9 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
416 #elif motif
417 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
418 if (window == NULL) {
419 + #endif
420 my d_xmMenuTitle = XmCreateCascadeButton (theGuiTopMenuBar, Melder_peekWcsToUtf8 (title), NULL, 0);
421 if (wcsequ (title, L"Help"))
422 XtVaSetValues (theGuiTopMenuBar, XmNmenuHelpWidget, my d_xmMenuTitle, NULL);
423 @@ -376,6 +378,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
424 XtSetSensitive (my d_xmMenuTitle, False);
425 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, NULL);
426 XtManageChild (my d_xmMenuTitle);
427 + #if not ( defined( DEMOAPP ) && defined( macintosh ) )
428 } else {
429 my d_xmMenuTitle = XmCreateCascadeButton (window -> d_xmMenuBar, Melder_peekWcsToUtf8 (title), NULL, 0);
430 if (wcsequ (title, L"Help"))
431 @@ -386,6 +389,7 @@ GuiMenu GuiMenu_createInWindow (GuiWindo
432 XtVaSetValues (my d_xmMenuTitle, XmNsubMenuId, my d_widget, NULL);
433 XtManageChild (my d_xmMenuTitle);
435 + #endif
436 _GuiObject_setUserData (my d_widget, me);
437 #endif
439 diff -Naurp -x '*.[oah]' -x '.git*' -x praat praat_sources/sys/DemoEditor.cpp demo_praat_sources/sys/DemoEditor.cpp
440 --- praat_sources/sys/DemoEditor.cpp 2014-05-09 08:59:02.000000000 +0200
441 +++ demo_praat_sources/sys/DemoEditor.cpp 2014-05-16 10:30:28.000000000 +0200
442 @@ -249,6 +249,7 @@ void Demo_waitForInput (Interpreter inte
443 if (theDemoEditor -> userWantsToClose) {
444 Interpreter_stop (interpreter);
445 forget (theDemoEditor);
446 + exit (0);
447 Melder_throw ("You interrupted the script.");