Ejemplo n.º 1
0
void MacDock::stopBounce()
{
	if(isBouncing) {
		NMRemove(&bounceRec);
		isBouncing = false;
	}
}
Ejemplo n.º 2
0
A1(PUBLIC trap, OSErrRET, NMInstall, NMRecPtr, nmptr)
{
  /* The multiple beeps and delays that used to be here make OpenProlog
   * really irritating to use.
   */
    SysBeep(5);
    if (MR(nmptr->nmResp))
      {
	if ((LONGINT) nmptr->nmResp == (LONGINT) CLC (-1))
	  NMRemove(nmptr);
	else {
	  LONGINT saved0, saved1, saved2, savea0, savea1;

	  ROMlib_hook(notify_procnumber);

	  saved0 = EM_D0;
	  saved1 = EM_D1;
	  saved2 = EM_D2;
	  savea0 = EM_A0;
	  savea1 = EM_A1;
	  PUSHADDR((LONGINT) (long) US_TO_SYN68K(nmptr));
	  CALL_EMULATOR((syn68k_addr_t) CL((long) nmptr->nmResp));
	  EM_D0 = saved0;
	  EM_D1 = saved1;
	  EM_D2 = saved2;
	  EM_A0 = savea0;
	  EM_A1 = savea1;
	}
      }
    return noErr;
}
Ejemplo n.º 3
0
void MCSystemCancelRequestUserAttention(void)
{
	if (s_bounce_nmr != nil)
	{
		NMRemove(s_bounce_nmr);
		MCMemoryDelete(s_bounce_nmr);
		s_bounce_nmr = nil;
	}
}
Ejemplo n.º 4
0
void
myNMHandler( NMRecPtr pNM )
{
    do {
        DVIdle();
    } while( CompareAndSwap( true, false, &(gpFamilyGlobals->nmIsInstalled) ) );

    // until next time...
    NMRemove( pNM );
}
Ejemplo n.º 5
0
boolean notifyuser (bigstring bsmessage) {
	
	/*
	use the Notification Manager to ask the user to bring our app to the front.
	
	note that we must allocate the record in the heap because multi-threading 
	makes stack addresses non-persistent.
	
	1/18/93 dmb: langbackgroundtask now takes flresting parameter; don't set global
	
	6/9/93 dmb: don't ignore the result of the background callbacks
	
	2.1b5 dmb: if we're in the main thread, need to do same as if yield is disabled.

	7.0d6 PBS: In Pike, the header of the dialog should not read UserLand Frontier,
	it should be UserLand [Whatever]. At this writing, [Whatever] is still undefined,
	so we'll go with Whatever for the moment.
	*/
	
#ifdef MACVERSION

	NMRecPtr pb;
	tyiconfamily icons;
	OSErr errcode;
	boolean fl = true;

	#define systemevents (osMask | updateMask | activMask | highLevelEventMask)

	#if TARGET_API_MAC_CARBON == 1
	
		{
		
			SInt16 itemhit = 0;
			OSErr err = noErr;
			
			err = StandardAlert (kAlertNoteAlert, bsmessage, nil, nil, &itemhit);
	
			return (err == noErr);
		}
	
	#endif
	
	pb = (NMRecPtr) NewPtrClear (longsizeof (NMRec));
	
	if (pb == nil)
		return (false);
	/*
	clearbytes (&pb, longsizeof (pb));
	*/
	
	(*pb).qType = nmType;
	
	(*pb).nmMark = 1;
	
	clearbytes (&icons, longsizeof (icons));
	
	icons.hics1 = GetResource ('ics#', 128);
	
	icons.hics4 = GetResource ('ics4', 128);
	
	icons.hics8 = GetResource ('ics8', 128);
	
	newfilledhandle (&icons, longsizeof (tyiconfamily), &(*pb).nmIcon);
	
	(*pb).nmSound = (Handle) -1;
	
	if (isemptystring (bsmessage))
		(*pb).nmStr = nil;
	
	else {
		(*pb).nmStr = (StringPtr) NewPtr (stringsize (bsmessage));
		
		copystring (bsmessage, (*pb).nmStr);
		}
	
	(*pb).nmResp = nil;
	
	errcode = NMInstall (pb);
	
	if (errcode == noErr) {
		
		while (!shellisactive ()) {
			
			if (flscriptrunning) {
				
				if (fldisableyield || inmainthread ())
					fl = langpartialeventloop (systemevents);
				else
					fl = langbackgroundtask (true); /*let main thread field events*/
				}
			else
				fl = shellpartialeventloop (systemevents);
			
			if (!fl)
				break;
			}
		
		NMRemove (pb);
		}
	
	disposehandle ((*pb).nmIcon);
	
	if ((*pb).nmStr != nil)
		DisposePtr ((Ptr) (*pb).nmStr);
	
	DisposePtr ((Ptr) pb);

	return (fl && (errcode == noErr));
#endif

#ifdef WIN95VERSION
	char s [256];
	short itemnumber;

	copyptocstring (bsmessage, s);

	releasethreadglobals ();

//#ifdef PIKE
//
//	/*7.0d8 PBS: name change to Radio UserLand*/
//
//	itemnumber = MessageBox (hwndMDIClient, s, "Radio UserLand", MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);
//
//#else

/* 9.1b3 JES: APPNAME macro is defined in versions.h for both Radio and Frontier -- use instead of hard-coded string */
itemnumber = MessageBox (hwndMDIClient, s, APPNAME, MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);

//#endif

	grabthreadglobals ();
	
	return (itemnumber == IDOK);
#endif
	} /*notifyuser*/