|
From: John M M. <jo...@us...> - 2002-07-05 06:56:54
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/PrintJobPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv18439/squeak/platforms/Mac OS/plugins/PrintJobPlugin
Modified Files:
sqMacPrinting.c
Log Message:
1.2 Use getUIToLock logic to lock UI pthread when putting up the print pref, and print job dialogs, otherwise we crash using carbon event aware squeak VMs
Index: sqMacPrinting.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/PrintJobPlugin/sqMacPrinting.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqMacPrinting.c 20 Feb 2002 21:02:38 -0000 1.2
--- sqMacPrinting.c 5 Jul 2002 06:56:51 -0000 1.3
***************
*** 12,15 ****
--- 12,16 ----
* Take carbon sample code, and alter it a bit
* Feb 20th 2002, JMM - add offset logic, free printsession only if allocated (duh)
+ * Jun 27th 2002, JMM - use UILock code to lock UI to prevent os-x seg fault
*
*****************************************************************************/
***************
*** 94,99 ****
// Display the Page Setup dialog.
! if (status == noErr)
status = DoPageSetupDialog(printJob);
return status;
}
--- 95,101 ----
// Display the Page Setup dialog.
! if (status == noErr) {
status = DoPageSetupDialog(printJob);
+ }
return status;
}
***************
*** 282,286 ****
if (status == noErr)
{
! status = PMSessionPageSetupDialog(printJob->printSession, printJob->pageFormat, &accepted);
if (status == noErr && !accepted)
status = kPMCancel; // user clicked Cancel button
--- 284,305 ----
if (status == noErr)
{
! int giLocker;
! giLocker = interpreterProxy->ioLoadFunctionFrom("getUIToLock", "");
! if (giLocker != 0) {
! long *foo;
! foo = malloc(sizeof(long)*6);
! foo[0] = 3;
! foo[1] = (long) PMSessionPageSetupDialog;
! foo[2] = (long)printJob->printSession;
! foo[3] = (long)printJob->pageFormat;
! foo[4] = (long)&accepted;
! foo[5] = 0;
! ((int (*) (void *)) giLocker)(foo);
! status = foo[5];
! free(foo);
! } else
! status = PMSessionPageSetupDialog(printJob->printSession, printJob->pageFormat,
! &accepted);
!
if (status == noErr && !accepted)
status = kPMCancel; // user clicked Cancel button
***************
*** 351,355 ****
if (status == noErr)
{
! status = PMSessionPrintDialog(printJob->printSession, printJob->printSettings, printJob->pageFormat, &accepted);
if (status == noErr && !accepted)
status = kPMCancel; // user clicked Cancel button
--- 370,391 ----
if (status == noErr)
{
! int giLocker;
! giLocker = interpreterProxy->ioLoadFunctionFrom("getUIToLock", "");
! if (giLocker != 0) {
! long *foo;
! foo = malloc(sizeof(long)*7);
! foo[0] = 4;
! foo[1] = (long)PMSessionPrintDialog;
! foo[2] = (long)printJob->printSession;
! foo[3] = (long)printJob->printSettings;
! foo[4] = (long)printJob->pageFormat;
! foo[5] = (long)&accepted;
! foo[6] = 0;
! ((int (*) (void *)) giLocker)(foo);
! status = foo[6];
! free(foo);
! } else
! status = PMSessionPrintDialog(printJob->printSession, printJob->printSettings,
! printJob->pageFormat, &accepted);
if (status == noErr && !accepted)
status = kPMCancel; // user clicked Cancel button
|