コード例 #1
0
ファイル: GB_AE.c プロジェクト: zenmumbler/GrayBox
{
FInfo	fi;

	if(FSpGetFInfo(fss,&fi)==0)
		return ((long)fi.fdType == type);
	else
		return false;
}

short AEQuit(AppleEvent* aev, AppleEvent* reply, long refCon)
{
	gDone = true;
	return 0;
}

RoutineDescriptor AEQuitRD = BUILD_ROUTINE_DESCRIPTOR(uppAEEventHandlerProcInfo,AEQuit);

short AEOpenApp(AppleEvent* aev, AppleEvent* reply, long refCon)
{
	return errAEEventNotHandled;
}

RoutineDescriptor AEOpenAppRD = BUILD_ROUTINE_DESCRIPTOR(uppAEEventHandlerProcInfo,AEOpenApp);

short AEPrint(AppleEvent* aev, AppleEvent* reply, long refCon)
{
	return errAEEventNotHandled;
}

RoutineDescriptor AEPrintRD = BUILD_ROUTINE_DESCRIPTOR(uppAEEventHandlerProcInfo,AEPrint);
コード例 #2
0
ファイル: shellscroll.c プロジェクト: dvincent/frontier
//Code change by Timothy Paustian Friday, June 16, 2000 3:14:00 PM
//Changed to Opaque call for Carbon

#if TARGET_RT_MAC_MACHO
	#define shellvertscrollUPP	(&shellvertscroll)
	#define shellhorizscrollUPP	(&shellhorizscroll)
	#define	shelllivescrollupp	(&ScrollThumbActionProc)
#elif TARGET_RT_MAC_CFM
	#if TARGET_API_MAC_CARBON
		ControlActionUPP	shellvertscrollDesc;
		ControlActionUPP	shellhorizscrollDesc;
		ControlActionUPP	shelllivescrollupp;
		#define shellvertscrollUPP (shellvertscrollDesc)
		#define shellhorizscrollUPP (shellhorizscrollDesc)
	#else
		static RoutineDescriptor shellvertscrollDesc = BUILD_ROUTINE_DESCRIPTOR (uppControlActionProcInfo, shellvertscroll);
		static RoutineDescriptor shellhorizscrollDesc = BUILD_ROUTINE_DESCRIPTOR (uppControlActionProcInfo, shellhorizscroll);
		#define shellvertscrollUPP (&shellvertscrollDesc)
		#define shellhorizscrollUPP (&shellhorizscrollDesc)
	#endif
#endif

#if TARGET_API_MAC_CARBON == 1

/*The live scrolling code descends from Apple sample code, hence the different style of code.*/

enum
{
	// Misc scroll bar constants

	kScrollBarWidth = 16,
コード例 #3
0
	#define ComponentQTiCall(procName)				ComponentCall(procName)
	#define QTIComponentCall(procName)				ComponentCall(procName)
#endif

#define ADD_BASENAME(name) cdh_GLUE2(COMPONENT_BASENAME(),name)
#define ADD_SCOPED_BASENAME(name) COMPONENT_BASENAME()::name

#if C_DISPATCH_WITH_GLOBALS
	PASCAL_RTN ComponentResult COMPONENT_DISPATCH_ENTRY(ComponentParameters *params, COMPONENT_GLOBALS());
	static ComponentFunctionUPP COMPONENTSELECTORLOOKUP(short selector_num, ProcInfoType *procInfo);

	#if TARGET_OS_MAC && TARGET_CPU_PPC && !TARGET_API_MAC_CARBON
		// entry point for PowerPC native components
		struct RoutineDescriptor ADD_BASENAME(ComponentDispatchRD) =
		  BUILD_ROUTINE_DESCRIPTOR((kPascalStackBased | RESULT_SIZE (kFourByteCode) |
									STACK_ROUTINE_PARAMETER (1, kFourByteCode) |
									STACK_ROUTINE_PARAMETER (2, kFourByteCode)),COMPONENT_DISPATCH_ENTRY);
	#endif
	
	PASCAL_RTN ComponentResult COMPONENT_DISPATCH_ENTRY(ComponentParameters *params,COMPONENT_GLOBALS())
	{
		ComponentFunctionUPP theProc;
		ComponentResult result = badComponentSelector;
		ProcInfoType theProcInfo;
		
		theProc = COMPONENTSELECTORLOOKUP(params->what, &theProcInfo);

		if (theProc) {
			if ( (theProc != kCOMPONENT_ERROR) && (theProc != kCOMPONENT_NOERROR) ) {
				if (theProcInfo != 0) {
					result = CallComponentFunctionWithStorageProcInfo((Handle) storage, params, (ProcPtr)theProc, theProcInfo);
コード例 #4
0
extern pascal OSStatus InitMoreSystemMenus(void)
	// See comment in interface part.
{
	OSStatus err;
	UniversalProcPtr gMenuSelectPatchUPP;		// points to MenuSelectPatch
	UniversalProcPtr gInsertMenuPatchUPP;		// points to InsertMenuPatch
	
	// We need to use the callback routine SetUpA4 to set up
	// A4 in our trap patches.  In preparation for that, we
	// need to remember A4 in some PC-relative place.  The client
	// may have already done this, but doing it twice doesn't hurt.
	//
	// Note that this translates to a NOP for the CFM build.
	
	RememberA4();
	
	assert(IsSystemStartup());
	
	// To avoid allocating extra pointer blocks for each of our
	// routine descriptors, we just declare them statically
	// here, and then setup the gFooUPP pointers to point to
	// them.
	//
	// Of course, for the classic 68K case, we can just use
	// assign them directly.
	
	// Build our routine descriptors.
	
	#if TARGET_RT_MAC_CFM
		{
			static RoutineDescriptor gDetachIconActionRD = BUILD_ROUTINE_DESCRIPTOR(uppIconActionProcInfo, DetachIconAction);
			static RoutineDescriptor gMenuSelectPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppMenuSelectProcInfo, MenuSelectPatch);
			static RoutineDescriptor gInsertMenuPatchRD = BUILD_ROUTINE_DESCRIPTOR(uppInsertMenuProcInfo, InsertMenuPatch);
			gDetachIconActionUPP = &gDetachIconActionRD;
			gMenuSelectPatchUPP = &gMenuSelectPatchRD;
			gInsertMenuPatchUPP = &gInsertMenuPatchRD;
		}
	#else
		gDetachIconActionUPP = (IconActionUPP)    DetachIconAction;
		gMenuSelectPatchUPP  = (UniversalProcPtr) MenuSelectPatch;
		gInsertMenuPatchUPP  = (UniversalProcPtr) InsertMenuPatch;
	#endif
	
	// Setup our global state.
	
	gMenuSelectState = kMenuSelectStateNil;
	gRootSysMenus = (RootSysMenuHandle) NewHandleSys(0);
	err = MemError();

	// If all goes well, install our patches.
	
	if (err == noErr) {
		gMenuSelectOldUPP = GetToolboxTrapAddress(_MenuSelect);
		gInsertMenuOldUPP = GetToolboxTrapAddress(_InsertMenu);

		SetToolboxTrapAddress(gMenuSelectPatchUPP, _MenuSelect);
		SetToolboxTrapAddress(gInsertMenuPatchUPP, _InsertMenu);
	}
	
	return err;
}