这篇教程C++ AECreateDesc函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AECreateDesc函数的典型用法代码示例。如果您正苦于以下问题:C++ AECreateDesc函数的具体用法?C++ AECreateDesc怎么用?C++ AECreateDesc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AECreateDesc函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: newdescwithhandleboolean newdescwithhandle (AEDesc *desc, DescType typeCode, Handle h) { /* PBS 03/14/02: Create a new AEDesc with the given type and value. */ OSErr err = noErr; long len = gethandlesize (h); AEInitializeDescInline (desc); if (h == nil) err = AECreateDesc (typeCode, nil, 0, desc); else { lockhandle (h); err = AECreateDesc (typeCode, *h, len, desc); unlockhandle (h); } /*else*/ return (err == noErr); } /*newdescwithhandle*/
开发者ID:dvincent,项目名称:frontier,代码行数:26,
示例2: DestoryWacomContext// DestoryWacomContext//// This function will instruct the Tablet Driver to delete a context that your// application created. Please be nice and destroy all contexts you create// before your application quits.//// parameters: UInt32 contextID - The ID returned to you when you created the// context.//// returns: a contextID and noErr on success, else an AE error code//////////////////////////////////////////////////////////////////////////////OSErr DestoryWacomContext(UInt32 contextID){ AEDesc driverTarget,nullDesc,keyData,tObjSpecifier; AppleEvent aeSend; OSErr err; err = GetTabletDriverTarget(&driverTarget); if(err) { return err; } err = AECreateAppleEvent(kAECoreSuite, kAEDelete, &driverTarget, kAutoGenerateReturnID, kAnyTransactionID, &aeSend); // Now tell the AE what to destroy //Create NULL AEDesc, this will signify the end of the AEDesc Chain AEInitializeDesc(&nullDesc); err = AECreateDesc( typeNull, NULL, NULL, &nullDesc ); AEInitializeDesc(&keyData); err = AECreateDesc( typeUInt32, &contextID, // This is the context ID we want to destroy sizeof(contextID), &keyData ); err = CreateObjSpecifier(cContext, // We want to destroy a context &nullDesc, // This is the last item in the chain formUniqueID, // use id to determine which context to destroy &keyData, // This is the Context ID descriptor created above TRUE, // delete the nullDesc, and KeyData descriptor for us &tObjSpecifier); // The created descriptor which says that we want to delete Context X err = AEPutParamDesc( &aeSend, keyDirectObject, &tObjSpecifier); // Finally send the event err = AESend(&aeSend, // The complete AE we created above NULL, // Don't need a reply kAEWaitReply, kAEHighPriority, kDefaultTimeOut, NULL, NULL); AEDisposeDesc(&tObjSpecifier); AEDisposeDesc(&aeSend);
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:60,
示例3: SendAppleEventToSystemProcessOSStatus SendAppleEventToSystemProcess(AEEventID eventToSendID){ AEAddressDesc targetDesc; static const ProcessSerialNumber kPSNOfSystemProcess = {0, kSystemProcess }; AppleEvent eventReply = {typeNull, NULL}; AppleEvent eventToSend = {typeNull, NULL}; OSStatus status = AECreateDesc(typeProcessSerialNumber, &kPSNOfSystemProcess, sizeof(kPSNOfSystemProcess), &targetDesc); if (status != noErr) return status; status = AECreateAppleEvent(kCoreEventClass, eventToSendID, &targetDesc, kAutoGenerateReturnID, kAnyTransactionID, &eventToSend); AEDisposeDesc(&targetDesc); if (status != noErr) return status; status = AESendMessage(&eventToSend, &eventReply, kAENormalPriority, kAEDefaultTimeout); AEDisposeDesc(&eventToSend); if (status != noErr) return status; AEDisposeDesc(&eventReply); return status;}
开发者ID:moatstormer,项目名称:mrmc,代码行数:30,
示例4: PyMac_PRECHECKstatic PyObject *AE_AECreateDesc(PyObject *_self, PyObject *_args){ PyObject *_res = NULL; OSErr _err; DescType typeCode; char *dataPtr__in__; long dataPtr__len__; int dataPtr__in_len__; AEDesc result;#ifndef AECreateDesc PyMac_PRECHECK(AECreateDesc);#endif if (!PyArg_ParseTuple(_args, "O&s#", PyMac_GetOSType, &typeCode, &dataPtr__in__, &dataPtr__in_len__)) return NULL; dataPtr__len__ = dataPtr__in_len__; _err = AECreateDesc(typeCode, dataPtr__in__, dataPtr__len__, &result); if (_err != noErr) return PyMac_Error(_err); _res = Py_BuildValue("O&", AEDesc_New, &result); return _res;}
开发者ID:AdminCNP,项目名称:appscript,代码行数:25,
示例5: BigSendAppleEventOSErr BigSendAppleEvent(TargetID *targ,AEEventClass aeClass,AEEventID aeID,Ptr *data,short dataLen,DescType dataType,Boolean returnData,Boolean checkForHandlerErr){ AEAddressDesc targDesc={typeNull, nil}; // Desc for target AppleEvent appOut={typeNull, nil},appIn={typeNull, nil}; short sendMode=kAENeverInteract; OSErr err; if (returnData || checkForHandlerErr) sendMode+=kAEWaitReply; else sendMode+=kAENoReply; // Create the address desriptor err=AECreateDesc(typeTargetID,(Ptr)targ,sizeof(TargetID), &targDesc); if (err) return err; // now create the apple event which will be sent err=AECreateAppleEvent(aeClass,aeID,&targDesc,kAutoGenerateReturnID,kAnyTransactionID,&appOut); if (err) { AEDisposeDesc(&targDesc); return err; } if (data && *data) { err=AEPutParamPtr(&appOut,keyDirectObject,typeChar,*data,dataLen); DisposePtr(*data); *data=0L; if (err) { AEDisposeDesc(&appOut); AEDisposeDesc(&targDesc); } } // Send the apple event err=AESend(&appOut,&appIn,sendMode,kAENormalPriority,kAEDefaultTimeout,0L,0L); if (err) { AEDisposeDesc(&appOut); // get rid of the apple events AEDisposeDesc(&appIn); AEDisposeDesc(&targDesc); // and the address descriptor } if (returnData) // get info from reply event err=FetchParamAnySize(keyDirectObject,&appIn,data,dataType); // Get the error returned if any if (!err && checkForHandlerErr) err=FetchAEErr(&appIn); // The apple event has been sent, dispose of descriptors AEDisposeDesc(&appOut); // get rid of the apple events AEDisposeDesc(&appIn); AEDisposeDesc(&targDesc); // and the address descriptor return err;}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:60,
示例6: IACnewsystemverbBoolean IACnewsystemverb (OSType vclass, OSType vtoken, AppleEvent *event) { /* 6/29/92 DW: special entry point for messages sent to system event handlers. implementation detail: this is accomplished by sending the message to ourself. */ AEAddressDesc adr; OSErr ec; ProcessSerialNumber psn; psn.highLongOfPSN = 0; psn.lowLongOfPSN = kCurrentProcess; AECreateDesc (typeProcessSerialNumber, (Ptr) &psn, sizeof (psn), &adr); ec = AECreateAppleEvent ( vclass, vtoken, &adr, kAutoGenerateReturnID, kAnyTransactionID, event); AEDisposeDesc (&adr); IACglobals.errorcode = ec; return (ec == noErr); } /*IACnewsystemverb*/
开发者ID:pombredanne,项目名称:Frontier,代码行数:29,
示例7: StopRecordervoid StopRecorder(PRECORDER_PARM prec){ OSAEvent theOSAEvent; /* the apple event you are generating */ AEAddressDesc targetaddr; /* the address descriptor for target app */ PID thePID; OSErr rc = noErr; if (prec->recording) { rc = AERemoveEventHandler( kCoreEventClass, kAENotifyRecording, (AEEventHandlerUPP)RawEventRecordingProc, FALSE ); pmassert(prec->pmp->hab, rc == noErr ); prec->recording = FALSE; rc = AEGetPID(APP_NAME, &thePID); rc = AECreateDesc(typePID, &thePID, sizeof(thePID), &targetaddr); rc = AECreateOSAEvent(kCoreEventClass, kAEStopRecording, &targetaddr, kAutoGenerateReturnID, kAnyTransactionID, &theOSAEvent); rc = AESend(&theOSAEvent, NULL, kAENoReply, kAENormalPriority, kAEDefaultTimeout, NULL, NULL); }}
开发者ID:OS2World,项目名称:DEV-SAMPLES-The-IBM-Developer-Connection-Release-12,代码行数:32,
示例8: putMissingValueToReplyOSErr putMissingValueToReply(AppleEvent *reply){ const static DescType missingValue = cMissingValue; OSErr err; AEDesc resultDesc; AECreateDesc(typeType, &missingValue, sizeof(missingValue), &resultDesc); err=AEPutParamDesc(reply, keyAEResult, &resultDesc); AEDisposeDesc(&resultDesc); return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:10,
示例9: error /* LowRunAppleScript compiles and runs an AppleScript provided as text in the buffer pointed to by text. textLength bytes will be compiled from this buffer and run as an AppleScript using all of the default environment and execution settings. resultData must be non-NULL, and should have been previously initialised, for example with _hs_initNull. The result returned by the execution command will be returned as typeUTF8Text in this descriptor record (or typeNull if there is no result information). If the function returns errOSAScriptError, then resultData will be set to a descriptive error message describing the error (if one is available). */OSStatus LowRunAppleScript(const void* text, long textLength, AEDesc *resultData) { ComponentInstance theComponent; AEDesc scriptTextDesc; OSStatus err; OSAID scriptID, resultID; /* set up locals to a known state */ theComponent = NULL; AECreateDesc(typeNull, NULL, 0, &scriptTextDesc); scriptID = kOSANullScript; resultID = kOSANullScript; /* open the scripting component */ theComponent = OpenDefaultComponent(kOSAComponentType, typeAppleScript); if (theComponent == NULL) { err = paramErr; goto bail; } /* put the script text into an aedesc */ err = AECreateDesc(typeUTF8Text, text, textLength, &scriptTextDesc); if (err != noErr) goto bail; /* compile the script */ err = OSACompile(theComponent, &scriptTextDesc, kOSAModeNull, &scriptID); if (err != noErr) goto bail; /* run the script/get the result */ err = OSAExecute(theComponent, scriptID, kOSANullScript, kOSAModeNull, &resultID); if (resultData != NULL) { if (err == noErr && resultID != kOSANullScript) { OSADisplay(theComponent, resultID, typeUTF8Text, kOSAModeNull, resultData); } }bail: if (err == errOSAScriptError) { AECreateDesc(typeNull, NULL, 0, resultData); OSAScriptError(theComponent, kOSAErrorMessage, typeUTF8Text, resultData); } AEDisposeDesc(&scriptTextDesc); if (scriptID != kOSANullScript) OSADispose(theComponent, scriptID); if (resultID != kOSANullScript) OSADispose(theComponent, resultID); if (theComponent != NULL) CloseComponent(theComponent); return err;}
开发者ID:adinapoli,项目名称:haskell-AppleScript,代码行数:53,
示例10: SendOpenAEOSStatus SendOpenAE( AEDescList list ){ OSStatus err; AEAddressDesc theAddress; AppleEvent dummyReply; AppleEvent theEvent; theAddress.descriptorType = typeNull; theAddress.dataHandle = NULL; dummyReply.descriptorType = typeNull; dummyReply.dataHandle = NULL; theEvent.descriptorType = typeNull; theEvent.dataHandle = NULL; do { ProcessSerialNumber psn; err = GetCurrentProcess(&psn); if ( err != noErr) break; err =AECreateDesc(typeProcessSerialNumber, &psn, sizeof(ProcessSerialNumber), &theAddress); if ( err != noErr) break; err = AECreateAppleEvent(kCoreEventClass, kAEOpenDocuments, &theAddress, kAutoGenerateReturnID, kAnyTransactionID, &theEvent); if ( err != noErr) break; err = AEPutParamDesc(&theEvent, keyDirectObject, &list); if ( err != noErr) break; err = AESend(&theEvent, &dummyReply, kAENoReply, kAENormalPriority, kAEDefaultTimeout, NULL, NULL); if ( err != noErr) break; } while (false); if ( theAddress.dataHandle != NULL ) { AEDisposeDesc( &theAddress ); } if ( dummyReply.dataHandle != NULL ) { AEDisposeDesc( &dummyReply ); } if ( theEvent.dataHandle != NULL ) { AEDisposeDesc( &theEvent ); } return err;}
开发者ID:fruitsamples,项目名称:SimpleText,代码行数:54,
示例11: AEDescCreateUnicodeTextOSErr AEDescCreateUnicodeText(CFStringRef string, AEDesc* outDescPtr){ OSErr err = noErr; DescType resultType = typeUnicodeText; UniCharCount length = CFStringGetLength(string); const UniChar *constBuff = CFStringGetCharactersPtr(string); if (constBuff == NULL) { UniChar *buffer; buffer = malloc(sizeof(UniChar)*length); CFStringGetCharacters(string, CFRangeMake(0, length), buffer); err = AECreateDesc(resultType, buffer, sizeof(UniChar)*length, outDescPtr); free(buffer); } else { err=AECreateDesc(resultType, constBuff, length*sizeof(UniChar), outDescPtr); } return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:20,
示例12: AddIDToAEList// NOTE: AELists have 1-based indexesOSErr AddIDToAEList(unsigned int id_num, long index, DescType object_type, AEDescList* list){ AEDesc item_desc; AECreateDesc(typeNull, NULL, 0, &item_desc); OSStatus err = CreateAEDescFromID(id_num, object_type, &item_desc); if (noErr == err) { err = AEPutDesc(list, index, &item_desc); AEDisposeDesc(&item_desc); } return err;}
开发者ID:prestocore,项目名称:browser,代码行数:13,
示例13: AEDescCreateUTF8TextOSErr AEDescCreateUTF8Text(CFStringRef string, AEDesc* outDescPtr){ OSErr err = noErr; CFStringEncoding kEncoding = kCFStringEncodingUTF8; DescType resultType = typeUTF8Text; const char *constBuff = CFStringGetCStringPtr(string, kEncoding); if (constBuff == NULL) { char *buffer; CFIndex charLen = CFStringGetLength(string); CFIndex maxLen = CFStringGetMaximumSizeForEncoding(charLen, kEncoding)+1; // +1 is for null termination. buffer = malloc(sizeof(char)*maxLen); CFStringGetCString(string, buffer, maxLen, kEncoding); err = AECreateDesc(resultType, buffer, strlen(buffer), outDescPtr); free(buffer); } else { err=AECreateDesc(resultType, constBuff, strlen(constBuff), outDescPtr); } return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:21,
示例14: putAliasToReplyOSErr putAliasToReply(AliasHandle inAlias, AppleEvent *reply){ OSErr err; AEDesc resultDesc; HLock((Handle)inAlias); err = AECreateDesc(typeAlias, (Ptr) (*inAlias), GetHandleSize((Handle) inAlias), &resultDesc); HUnlock((Handle)inAlias); err=AEPutParamDesc(reply, keyAEResult, &resultDesc); AEDisposeDesc(&resultDesc); return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:12,
示例15: AEDescCreateWithCFURLOSErr AEDescCreateWithCFURL(CFURLRef url, AEDesc* outDescPtr){ OSStatus err; CFDataRef data = CFURLCreateData(kCFAllocatorDefault, url, kCFStringEncodingUTF8, true); if (data != NULL) { err = AECreateDesc('furl', CFDataGetBytePtr(data), CFDataGetLength(data), outDescPtr); CFRelease(data); } else { err = kCFURLErrorUnknown; } return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:13,
示例16: launch_app/* ----------------------------------------------------------------------------- use launch services to launch an application return < 0 if the application cannot be launched----------------------------------------------------------------------------- */static int launch_app(char *app, char *params){#ifdef HAVE_LAUNCHSERVICES CFURLRef urlref; LSLaunchURLSpec urlspec; OSStatus err;#if 0 OSErr oserr; AEDesc desc;#endif urlref = CFURLCreateFromFileSystemRepresentation(NULL, (u_char*)app, strlen(app), FALSE); if (urlref == 0) return -1; #if 0 oserr = AECreateDesc(typeChar, params, strlen(params), &desc); if (oserr != noErr) { CFRelease(urlref); return -1; }#endif urlspec.appURL = urlref; urlspec.itemURLs = 0; urlspec.passThruParams = 0;#if 0 urlspec.passThruParams = &desc;#endif urlspec.launchFlags = kLSLaunchAsync + kLSLaunchDontAddToRecents + kLSLaunchNewInstance + kLSLaunchNoParams; urlspec.asyncRefCon = 0; err = LSOpenFromURLSpec(&urlspec, NULL); if (err != 0) {#if 0 AEDisposeDesc(&desc);#endif CFRelease(urlref); return -2; }#if 0 AEDisposeDesc(&desc);#endif CFRelease(urlref); #endif /* HAVE_LAUNCHSERVICES */ return 0;}
开发者ID:Deanzou,项目名称:ppp,代码行数:55,
示例17: GetSendersAddressOSErr GetSendersAddress(AppleEvent *event,AEAddressDesc *targ){ Size len=sizeof(long); DescType actualType; long sessionID; OSErr err; err=AEGetAttributePtr(event, keyAddressAttr, typeSessionID, &actualType, &sessionID, len, &len); if (err) return err; // Create the address desriptor return AECreateDesc(typeSessionID,(Ptr)&sessionID,sizeof(long), targ);}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:14,
示例18: MoreAEOCreateAliasDesc/******************************************************************************** Create and return an AEDesc of type typeAlias using the provided alias record. pAliasHdl input: Handle to an alias record. pAliasAEDesc input: Pointer to null AEDesc. output: an AEDesc of type typeAlias. RESULT CODES ____________ noErr 0 No error memFullErr -108 Not enough room in heap zone */pascal OSErr MoreAEOCreateAliasDesc( const AliasHandle pAliasHdl, AEDesc *pAliasAEDesc ){ OSErr anErr = noErr; char handleState = HGetState( (Handle)pAliasHdl ); HLock( (Handle)pAliasHdl ); anErr = AECreateDesc( typeAlias, *pAliasHdl, GetHandleSize( (Handle)pAliasHdl ), pAliasAEDesc ); HSetState( (Handle)pAliasHdl, handleState ); return anErr;}//end MoreAEOCreateAliasDesc
开发者ID:paullalonde,项目名称:B,代码行数:27,
示例19: LSFindApplicationForInfovoid Moose::launchAudioscrobbler( const std::vector<std::string>& vargs ){ FSRef appRef; LSFindApplicationForInfo( kLSUnknownCreator, CFSTR( AUDIOSCROBBLER_BUNDLEID ), NULL, &appRef, NULL ); const void* arg[vargs.size()]; int index(0); AEDescList argAEList; AECreateList( NULL, 0, FALSE, &argAEList ); for( std::vector<std::string>::const_iterator i = vargs.begin(); i != vargs.end(); i++ ) { arg[index++] = CFStringCreateWithCString( NULL, i->c_str(), kCFStringEncodingUTF8 ); AEPutPtr( &argAEList, 0, typeChar, i->c_str(), i->length()); } LSApplicationParameters params; params.version = 0; params.flags = kLSLaunchAndHide | kLSLaunchDontSwitch | kLSLaunchAsync;; params.application = &appRef; params.asyncLaunchRefCon = NULL; params.environment = NULL; CFArrayRef args = CFArrayCreate( NULL, ((const void**)arg), vargs.size(), NULL); params.argv = args; AEAddressDesc target; AECreateDesc( typeApplicationBundleID, CFSTR( AUDIOSCROBBLER_BUNDLEID ), 16, &target); AppleEvent event; AECreateAppleEvent ( kCoreEventClass, kAEReopenApplication , &target, kAutoGenerateReturnID, kAnyTransactionID, &event ); AEPutParamDesc( &event, keyAEPropData, &argAEList ); params.initialEvent = &event; LSOpenApplication( ¶ms, NULL ); AEDisposeDesc( &argAEList ); AEDisposeDesc( &target );}
开发者ID:Erkan-Yilmaz,项目名称:lastfm-desktop,代码行数:48,
示例20: putBoolToReplyOSErr putBoolToReply(Boolean aBool, AppleEvent *reply){#if useLog printf("start putBoolToReply/n");#endif OSErr err; DescType resultType = (aBool? typeTrue:typeFalse); AEDesc resultDesc; AECreateDesc(resultType, NULL, 0, &resultDesc); err=AEPutParamDesc(reply, keyAEResult, &resultDesc); AEDisposeDesc(&resultDesc);#if useLog printf("end putBoolToReply/n");#endif return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:16,
示例21: putBooleanToEventOSErr putBooleanToEvent(AppleEvent *ev, AEKeyword keyword, Boolean inBool){#if useLog fputs("start putBooleanToEvent", stderr);#endif OSErr err; DescType resultType = (inBool? typeTrue:typeFalse); AEDesc resultDesc; AECreateDesc(resultType, NULL, 0, &resultDesc); err = AEPutParamDesc(ev, keyword, &resultDesc); AEDisposeDesc(&resultDesc);#if useLog fputs("end putBooleanToEvent", stderr);#endif return err;}
开发者ID:tkurita,项目名称:AEUtils,代码行数:16,
示例22: MoreAEOCreatePropertyObject/******************************************************************************** Given a property type, create an new object descriptor for that property, contained by containerObj. pPropertyType input: Property type to use for object. pContainerAEDesc input: Pointer to container object for object being created. propertyObjPtr input: Pointer to null AEDesc. output: A property object. RESULT CODES ____________ noErr 0 No error paramErr -50 Error in parameter list memFullErr -108 Not enough room in heap zone errAECoercionFail -1700 Data could not be coerced to the requested Apple event data type errAEWrongDataType -1703 Wrong Apple event data type errAENotAEDesc -1704 Not a valid descriptor record errAEBadListItem -1705 Operation involving a list item failed */pascal OSErr MoreAEOCreatePropertyObject( const DescType pPropertyType, AEDesc *pContainerAEDesc, AEDesc *propertyObjPtr ){ OSErr anErr = noErr; AEDesc propDesc; anErr = AECreateDesc( typeType, &pPropertyType, sizeof( pPropertyType ), &propDesc ); if ( noErr == anErr ) { anErr = CreateObjSpecifier( cProperty, pContainerAEDesc, formPropertyID, &propDesc, false, propertyObjPtr ); MoreAEDisposeDesc( &propDesc ); } return anErr;}//end MoreAEOCreatePropertyObject
开发者ID:paullalonde,项目名称:B,代码行数:37,
示例23: MoreAEOCreateProcessObject/******************************************************************************** Given a ProcessSerialNumber, create an new object descriptor for the PSN, contained by containerObj. pPSN input: ProcessSerialNumber to use for object. pContainerAEDesc input: Pointer to container object for object being created. pPSNObjDesc input: Pointer to null AEDesc. output: A ProcessSerialNumber object. RESULT CODES ____________ noErr 0 No error paramErr -50 Error in parameter list memFullErr -108 Not enough room in heap zone errAECoercionFail -1700 Data could not be coerced to the requested Apple event data type errAEWrongDataType -1703 Wrong Apple event data type errAENotAEDesc -1704 Not a valid descriptor record errAEBadListItem -1705 Operation involving a list item failed */pascal OSErr MoreAEOCreateProcessObject( const ProcessSerialNumber *pPSN, AEDesc *pContainerAEDesc, AEDesc *pPSNObjDesc ){ OSErr anErr = noErr; AEDesc psnDesc; anErr = AECreateDesc( typeProcessSerialNumber, pPSN, sizeof( ProcessSerialNumber ), &psnDesc ); if ( noErr == anErr ) { anErr = CreateObjSpecifier( cProperty, pContainerAEDesc, formPropertyID, &psnDesc, false, pPSNObjDesc ); MoreAEDisposeDesc( &psnDesc ); } return anErr;}//end MoreAEOCreateProcessObject
开发者ID:paullalonde,项目名称:B,代码行数:37,
示例24: MoreAEOCreateSelectionObject/******************************************************************************** Given selection type, create an new object descriptor for a selection, contained by containerObj. pSelectionAEDesc input: Selection type to use for object. pContainerAEDesc input: Pointer to container object for object being created. pSelectionObject input: Pointer to null AEDesc. output: A property object. RESULT CODES ____________ noErr 0 No error paramErr -50 Error in parameter list memFullErr -108 Not enough room in heap zone errAECoercionFail -1700 Data could not be coerced to the requested Apple event data type errAEWrongDataType -1703 Wrong Apple event data type errAENotAEDesc -1704 Not a valid descriptor record errAEBadListItem -1705 Operation involving a list item failed */pascal OSErr MoreAEOCreateSelectionObject( const DescType pSelectionAEDesc, AEDesc *pContainerAEDesc, AEDesc *pSelectionObject ){ OSErr anErr = noErr; AEDesc selectionDesc = {typeNull,NULL}; anErr = AECreateDesc( typeAbsoluteOrdinal, &pSelectionAEDesc, sizeof( pSelectionAEDesc ), &selectionDesc ); if ( noErr == anErr ) { anErr = CreateObjSpecifier( cObject, pContainerAEDesc, formAbsolutePosition, &selectionDesc, false, pSelectionObject ); MoreAEDisposeDesc( &selectionDesc ); } return anErr;}//end MoreAEOCreateSelectionObject
开发者ID:paullalonde,项目名称:B,代码行数:37,
示例25: SendAppleEventToSystemProcessOSStatus SendAppleEventToSystemProcess(AEEventID EventToSend){ AEAddressDesc targetDesc; static const ProcessSerialNumber kPSNOfSystemProcess = { 0, kSystemProcess }; AppleEvent eventReply = {typeNull, NULL}; AppleEvent appleEventToSend = {typeNull, NULL}; OSStatus error = noErr; error = AECreateDesc(typeProcessSerialNumber, &kPSNOfSystemProcess, sizeof(kPSNOfSystemProcess), &targetDesc); if (error != noErr) { return(error); } error = AECreateAppleEvent(kCoreEventClass, EventToSend, &targetDesc, kAutoGenerateReturnID, kAnyTransactionID, &appleEventToSend); AEDisposeDesc(&targetDesc); if (error != noErr) { return(error); } error = AESend(&appleEventToSend, &eventReply, kAENoReply, kAENormalPriority, kAEDefaultTimeout, NULL, NULL); AEDisposeDesc(&appleEventToSend); if (error != noErr) { return(error); } AEDisposeDesc(&eventReply); return(error); //if this is noErr then we are successful}
开发者ID:jfro,项目名称:QuickBoot,代码行数:45,
示例26: __rbosa_insertion_loc_newstatic VALUE__rbosa_insertion_loc_new (VALUE rcv, FourCharCode code){ AEDesc * self_desc; AEDesc rec; AEDesc pos_desc; AEDesc new_desc; self_desc = rbosa_element_aedesc (rcv); AECreateList (NULL, 0, true, &rec); AEPutParamDesc (&rec, keyAEObject, self_desc); AECreateDesc (code, NULL, 0, &pos_desc); AEPutParamPtr (&rec, keyAEPosition, typeEnumerated, &pos_desc, 4); AECoerceDesc (&rec, typeInsertionLoc, &new_desc); AEDisposeDesc (&rec); return rbosa_element_make (cOSAElement, &new_desc, Qnil);}
开发者ID:bmorton,项目名称:rubyosa,代码行数:18,
示例27: rbosa_element_newstatic VALUErbosa_element_new (VALUE self, VALUE type, VALUE value){ FourCharCode ffc_type; OSErr error; const char * c_value; unsigned c_value_size; AEDesc desc; ffc_type = RVAL2FOURCHAR (type); if (NIL_P (value)) { c_value = NULL; c_value_size = 0; } else if (rb_obj_is_kind_of (value, rb_cInteger)) { FourCharCode code; code = NUM2INT (value); c_value = (const char *)&code; c_value_size = sizeof (FourCharCode); } else if (ffc_type == 'alis') { AliasHandle alias; rbobj_to_alias_handle (value, &alias); c_value = (const char *)*alias; c_value_size = GetHandleSize ((Handle)alias); } else { Check_Type (value, T_STRING); c_value = RSTRING (value)->ptr; c_value_size = RSTRING (value)->len; } error = AECreateDesc (ffc_type, c_value, c_value_size, &desc); if (error != noErr) rb_raise (rb_eArgError, "Cannot create Apple Event descriptor from type '%s' value '%s' : %s (%d)", RVAL2CSTR (type), c_value, error_code_to_string (error), error); return rbosa_element_make (self, &desc, Qnil);}
开发者ID:bmorton,项目名称:rubyosa,代码行数:43,
示例28: for_each for_each(VisualPhysicsActor* actor, actors) { if (QFileInfo(actor->path()).exists()) { use_ae_desc_list = true; AliasHandle file_alias; Boolean is_directory = false; err = FSNewAliasFromPath(NULL, utf8(actor->path()).c_str(), 0, &file_alias, &is_directory); HLock((Handle) file_alias); AECreateDesc(typeAlias, (Ptr) (*file_alias), GetHandleSize((Handle) file_alias), &file_list_element); HUnlock((Handle) file_alias); AEPutDesc(&file_list, 0, &file_list_element); } }
开发者ID:DX94,项目名称:BumpTop,代码行数:19,
示例29: MoreAEOCreateObjSpecifierFromCFURLRefpascal OSStatus MoreAEOCreateObjSpecifierFromCFURLRef(const CFURLRef pCFURLRef, AEDesc *pObjSpecifier){ OSErr anErr = paramErr; if (nil != pCFURLRef) { Boolean isDirectory = CFURLHasDirectoryPath(pCFURLRef); CFStringRef tCFStringRef = CFURLCopyFileSystemPath(pCFURLRef, kCFURLHFSPathStyle); AEDesc containerDesc = { typeNull, NULL }; AEDesc nameDesc = { typeNull, NULL }; UniCharPtr buf = nil; if (nil != tCFStringRef) { Size bufSize = ( CFStringGetLength(tCFStringRef) + ( isDirectory ? 1 : 0 ) ) * sizeof( UniChar ); buf = (UniCharPtr) NewPtr(bufSize); if ( ( anErr = MemError() ) == noErr) { CFStringGetCharacters(tCFStringRef, CFRangeMake(0, bufSize / 2), buf); if (isDirectory) ( buf )[ ( bufSize - 1 ) / 2 ] = (UniChar) 0x003A; } } else anErr = coreFoundationUnknownErr; if (anErr == noErr) anErr = AECreateDesc(typeUnicodeText, buf, GetPtrSize( (Ptr) buf), &nameDesc); if (anErr == noErr) if (isDirectory) { anErr = CreateObjSpecifier(cFolder, &containerDesc, formName, &nameDesc, false, pObjSpecifier); } else { anErr = CreateObjSpecifier(cFile, &containerDesc, formName, &nameDesc, false, pObjSpecifier); } MoreAEDisposeDesc(&nameDesc); if (buf) DisposePtr( (Ptr) buf); } return anErr;}
开发者ID:r0ssar00,项目名称:platform,代码行数:42,
示例30: mac_opensessionvoid mac_opensession(void){ if (mac_gestalts.navsvers > 0) { NavReplyRecord navr; NavDialogOptions navopts; NavTypeListHandle navtypes; AEDesc defaultloc = { 'null', NULL }; AEDesc *navdefault = NULL; short vol; long dirid; FSSpec fss; if (NavGetDefaultDialogOptions(&navopts) != noErr) return; /* XXX should we create sessions dir? */ if (get_session_dir(FALSE, &vol, &dirid) == noErr && FSMakeFSSpec(vol, dirid, NULL, &fss) == noErr && AECreateDesc(typeFSS, &fss, sizeof(fss), &defaultloc) == noErr) navdefault = &defaultloc; /* Can't meaningfully preview a saved session yet */ navopts.dialogOptionFlags &= ~kNavAllowPreviews; navtypes = (NavTypeListHandle)GetResource('open', open_pTTY); if (NavGetFile(navdefault, &navr, &navopts, NULL, NULL, NULL, navtypes, NULL) == noErr && navr.validRecord) mac_openlist(navr.selection); NavDisposeReply(&navr); if (navtypes != NULL) ReleaseResource((Handle)navtypes); }#if !TARGET_API_MAC_CARBON /* XXX Navigation Services */ else { StandardFileReply sfr; static const OSType sftypes[] = { 'Sess', 0, 0, 0 }; StandardGetFile(NULL, 1, sftypes, &sfr); if (!sfr.sfGood) return; mac_opensessionfrom(&sfr.sfFile); /* XXX handle error */ }#endif}
开发者ID:LapsedAcademicsInc,项目名称:putty,代码行数:42,
注:本文中的AECreateDesc函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AEDisposeDesc函数代码示例 C++ AECountItems函数代码示例 |