您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AEInstallEventHandler函数代码示例

51自学网 2021-06-01 19:33:57
  C++
这篇教程C++ AEInstallEventHandler函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AEInstallEventHandler函数的典型用法代码示例。如果您正苦于以下问题:C++ AEInstallEventHandler函数的具体用法?C++ AEInstallEventHandler怎么用?C++ AEInstallEventHandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AEInstallEventHandler函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: installAEHandlers

bool installAEHandlers(){    OSErr iErr = noErr;        g_lpfnAEProc = NewAEEventHandlerUPP(aplEventHdlr);    if (noErr != (iErr = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, g_lpfnAEProc, FOUR_CHAR_CODE('QUIT'), FALSE)))    {        DisposeAEEventHandlerUPP(g_lpfnAEProc);        fprintf(stderr, "installAEHandlers() - AEInstallEventHandler(kAEQuitApplication) failed, returning %lu!/n", (unsigned long) iErr);        return false;    }    if (noErr != (iErr = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, g_lpfnAEProc, FOUR_CHAR_CODE('OPEN'), FALSE)))    {        AERemoveEventHandler(kCoreEventClass, kAEQuitApplication, g_lpfnAEProc, FALSE);        DisposeAEEventHandlerUPP(g_lpfnAEProc);        fprintf(stderr, "installAEHandlers() - AEInstallEventHandler(kAEOpenDocuments) failed, returning %lu!/n", (unsigned long) iErr);        return false;    }        if (noErr != (iErr = AEInstallEventHandler(kCoreEventClass, kAEShowPreferences, g_lpfnAEProc, FOUR_CHAR_CODE('PREF'), FALSE)))    {        AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments, g_lpfnAEProc, FALSE);        AERemoveEventHandler(kCoreEventClass, kAEQuitApplication, g_lpfnAEProc, FALSE);        DisposeAEEventHandlerUPP(g_lpfnAEProc);        fprintf(stderr, "installAEHandlers() - AEInstallEventHandler(kAEShowPreferences) failed, returning %lu!/n", (unsigned long) iErr);        return false;    }    return true;}
开发者ID:ullerrm,项目名称:frogg,代码行数:32,


示例2: setupEventHandler_mac

voidsetupEventHandler_mac(SRefCon handlerRef){    appleEventProcessorUPP = AEEventHandlerUPP(appleEventProcessor);    AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, appleEventProcessorUPP, handlerRef, true);    macCallbackUrlHandlerUPP = AEEventHandlerUPP(macCallbackUrlHandler);    AEInstallEventHandler(kInternetEventClass, kAEGetURL, macCallbackUrlHandlerUPP, handlerRef, false);}
开发者ID:cancamilo,项目名称:amarok,代码行数:8,


示例3: Install

static void Install(void){  short err=0;  err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, NewAEEventHandlerUPP(OpenApplicationStuff), 0, 0);  err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerUPP(OpenFinderDoc), 0, 0);  err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, NewAEEventHandlerUPP(DoNothing), 0, 0);  err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(SetUpQuitMessage), 0, 0);  err = AEInstallEventHandler('PLT ', 'cmdl', NewAEEventHandlerUPP(CmdLineMessage), 0, 0);}
开发者ID:akavel,项目名称:pltscheme-cvs-cvs2git-1,代码行数:9,


示例4: installhandlers

static void installhandlers (void) {	AEInstallEventHandler ('TEST', 'smsg', NewAEEventHandlerProc (setmessageverb), 0, false);	AEInstallEventHandler (kCoreEventClass, kAEOpenApplication, NewAEEventHandlerProc (handleopenapp), 0, false);		AEInstallEventHandler (kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerProc (handleopen), 0, false);		AEInstallEventHandler (kCoreEventClass, kAEPrintDocuments, NewAEEventHandlerProc (handleprint), 0, false);		AEInstallEventHandler (kCoreEventClass, kAEQuitApplication, NewAEEventHandlerProc (handlequit), 0, false);	} /*installhandlers*/
开发者ID:dvincent,项目名称:frontier,代码行数:12,


示例5: addLibraryPath

voidunicorn::Application::init(){#ifdef Q_OS_MAC    addLibraryPath( applicationDirPath() + "/../plugins" );#elif defined Q_OS_WIN    addLibraryPath( applicationDirPath() + "/plugins" );#endif#ifdef Q_WS_MAC    qt_mac_set_menubar_icons( false );#endif    CoreApplication::init();    setupHotKeys();#ifdef __APPLE__    setGetURLEventHandler();    AEEventHandlerUPP urlHandler = NewAEEventHandlerUPP( appleEventHandler );    AEInstallEventHandler( kInternetEventClass, kAEGetURL, urlHandler, 0, false );    setOpenApplicationEventHandler();    AEEventHandlerUPP openHandler = NewAEEventHandlerUPP( appleEventHandler );    AEInstallEventHandler( kCoreEventClass, kAEReopenApplication, openHandler, 0, false );#endif#ifdef Q_WS_MAC#define CSS_PATH "/../Resources/"#else#define CSS_PATH "/"#endif    refreshStyleSheet();    translate();    m_icm = new lastfm::InternetConnectionMonitor( this );    connect( m_icm, SIGNAL( up( QString ) ), this, SIGNAL( internetConnectionUp() ) );    connect( m_icm, SIGNAL( down( QString ) ), this, SIGNAL( internetConnectionDown() ) );    connect( &m_bus, SIGNAL( wizardRunningQuery( QString )), SLOT( onWizardRunningQuery( QString )));    connect( &m_bus, SIGNAL( sessionQuery( QString )), SLOT( onBusSessionQuery( QString )));    connect( &m_bus, SIGNAL( sessionChanged( const QMap<QString, QString>& )), SLOT( onBusSessionChanged( const QMap<QString, QString>& )));    connect( &m_bus, SIGNAL( lovedStateChanged(bool)), SIGNAL( busLovedStateChanged(bool)));    m_bus.board();#ifdef __APPLE__    setQuitOnLastWindowClosed( false );#endif}
开发者ID:dschmidt,项目名称:lastfm-desktop,代码行数:53,


示例6: init_ae

voidinit_ae(){	AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,					NewAEEventHandlerProc(DoOpenApp), 0L, false);	AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,					NewAEEventHandlerProc(DoOpenDocument), 0L, false);	AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,					NewAEEventHandlerProc(DoQuitApp), 0L, false);	AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,					NewAEEventHandlerProc(DoQuitApp), 0L, false);}
开发者ID:Feneric,项目名称:xconq,代码行数:13,


示例7: LauncherSetup_md

/* * If we got no arguments install the apple event handlers and our event loop. */void LauncherSetup_md(int argc) {    OSErr err;    AEEventHandlerUPP openDocEventHandler;    AEEventHandlerUPP openAppEventHandler;    char **argv = NULL;    int no = 0;    // If we got more than one argument we were launched from the commandline,    // so don't install any handlers.    if (argc > 1)        return;    if (gInitialized)        return;    gInitialized = true;    // We need to handle open events for the functionality we're looking for.    openDocEventHandler = NewAEEventHandlerUPP((AEEventHandlerProcPtr)OpenDocEventHandler);    openAppEventHandler = NewAEEventHandlerUPP((AEEventHandlerProcPtr)OpenAppEventHandler);    err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, openDocEventHandler, 0, TRUE);    if(err) {        fprintf(stderr, "Error installing open event handler/n");        exit(-1);    }    err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, openAppEventHandler, 0, TRUE);    if(err) {        fprintf(stderr, "Error installing open app handler/n");        exit(-1);    }    // Enter the event loop and handle appleevents.  If we were given files to open    // they will appear here.    RunApplicationEventLoop();    if (gRunAppManager) {        // Three arguments -- app name, no file, and null.        argv = (char**)malloc(sizeof(char*) * 3);        no = 0;        argv[no++] = GetWebStartAppName();        argv[no] = NULL;        // Call into our main app.        main(no, argv);    } else {        exit(0);    }}
开发者ID:Spronovost,项目名称:documentation,代码行数:54,


示例8: openApplicationAEHandler

// --------------------------------------------------------------------------------------static pascal OSErr openApplicationAEHandler(const AppleEvent *appleEvent, AppleEvent *reply, 												long refcon){#pragma unused (reply, refcon)	OSErr error;	DescType returnedType;	Size actualSize;		error = AEGetAttributePtr(appleEvent, keyMissedKeywordAttr, typeWildCard, &returnedType,								NULL, 0, &actualSize);	if (error == noErr)		error = errAEParamMissed;	else if (error == errAEDescNotFound)	{		EventTypeSpec applicationEvents[] = {												{kEventClassCommand, kEventCommandProcess}		                                    };					/* For our program running in Carbon, a Quit Application Apple Event handler 			   is unnecessary because RunApplicationEventLoop installs one for us that 			   calls QuitApplicationEventLoop.  However we will leave ours here in case 			   we ever need it to do something different so that we know where it 			   belongs. */		gQuitAppAEHandler = NewAEEventHandlerUPP(quitApplicationAEHandler);		error = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, gQuitAppAEHandler, 										0, false);		if (error != noErr)		// if we can't allow the user a mechanism to quit		{						// we'd better just quit right now			DisposeAEEventHandlerUPP(gOpenAppAEHandler);			DisposeAEEventHandlerUPP(gQuitAppAEHandler);						ExitToShell();		}		gViewsFontChangedAEHandler = NewAEEventHandlerUPP(viewsFontChangedAEHandler);		error = AEInstallEventHandler(kAppearanceEventClass, kAEViewsFontChanged, 										gViewsFontChangedAEHandler, 0, false);				gAppEventHandler = NewEventHandlerUPP(appEventHandler);		InstallApplicationEventHandler(gAppEventHandler, GetEventTypeCount(applicationEvents), 										applicationEvents, NULL, NULL);				Gestalt(gestaltSystemVersion, &gMacOSVersion);	// get the version of Mac OS we're 														// running on		InitIconDataBrowser();				error = noErr;	}		return error;}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:51,


示例9: main

intmain( int argc, char *argv[] ){#ifdef Q_WS_MAC    // Do Mac specific startup to get media keys working.    // This must go before QApplication initialisation.    Tomahawk::macMain();    // used for url handler    AEEventHandlerUPP h = AEEventHandlerUPP( appleEventHandler );    AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );#endif    TomahawkApp a( argc, argv );    KDSingleApplicationGuard guard( &a, KDSingleApplicationGuard::AutoKillOtherInstances );    QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance )  ) );    if ( guard.isPrimaryInstance() )        a.init();    QString locale = QLocale::system().name();    QTranslator translator;    translator.load( QString( ":/lang/tomahawk_" ) + locale );    a.installTranslator( &translator );    if ( argc > 1 )    {        QString arg = a.arguments()[ 1 ];        a.loadUrl( arg );    }    return a.exec();}
开发者ID:pauloppenheim,项目名称:tomahawk,代码行数:34,


示例10: initialize

// --------------------------------------------------------------------------------------static void initialize(void){	OSStatus status;	IBNibRef nib;	OSErr error;		RegisterAppearanceClient();	status = CreateNibReference(CFSTR("ExamplePrefs"), &nib);	if (status != noErr)		ExitToShell();		status = SetMenuBarFromNib(nib, CFSTR("MenuBar"));	if (status != noErr)		ExitToShell();		DisposeNibReference(nib);		DrawMenuBar();			// do non time sensitive initialization after we get the application event loop going	gOpenAppAEHandler = NewAEEventHandlerUPP(openApplicationAEHandler);	error = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, gOpenAppAEHandler, 0, 									false);	if (error != noErr)		ExitToShell();			/* If we supported them, we would install open documents and print documents 		   handlers here and we would do most of the same initialization stuff that we 		   do in the open application handler */}
开发者ID:fruitsamples,项目名称:CarbonPorting,代码行数:32,


示例11: setUp

void setUp(){	Handle	menuBar;	OSErr 	anErr = noErr;	long	aLong;	long	response;		anErr = Gestalt(gestaltSystemVersion, &response);		// Carbon Porting guidelines say provide alternate menu bar/menu scheme for OS X	// This is just one way of doing this, which is pretty static	if (response >= 0x01000) 		menuBar = GetNewMBar(MENU_BAR_IDX);	else		menuBar = GetNewMBar(MENU_BAR_ID);		if ( menuBar == nil || anErr != noErr )		 ExitToShell();		SetMenuBar(menuBar);	DisposeHandle(menuBar);	DrawMenuBar();	    // Install 'quit' event handler	if ((Gestalt(gestaltAppleEventsAttr, &aLong) == noErr)) {		    anErr = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,			         NewAEEventHandlerUPP(AEQuitHandler), 0, false);		    if (anErr != noErr)  		    	ExitToShell();	}}
开发者ID:fruitsamples,项目名称:Snapshot,代码行数:32,


示例12: PyMac_PRECHECK

static PyObject *AE_AEInstallEventHandler(PyObject *_self, PyObject *_args){	PyObject *_res = NULL;	OSErr _err;	AEEventClass theAEEventClass;	AEEventID theAEEventID;	AEEventHandlerUPP handler__proc__ = upp_GenericEventHandler;	PyObject *handler;#ifndef AEInstallEventHandler	PyMac_PRECHECK(AEInstallEventHandler);#endif	if (!PyArg_ParseTuple(_args, "O&O&O",	                      PyMac_GetOSType, &theAEEventClass,	                      PyMac_GetOSType, &theAEEventID,	                      &handler))		return NULL;	_err = AEInstallEventHandler(theAEEventClass,	                             theAEEventID,	                             handler__proc__, (long)handler,	                             0);	if (_err != noErr) return PyMac_Error(_err);	Py_INCREF(Py_None);	_res = Py_None;	Py_INCREF(handler); /* XXX leak, but needed */	return _res;}
开发者ID:AdminCNP,项目名称:appscript,代码行数:26,


示例13: main

int main( int argc, char ** argv ){    QApplication a( argc, argv );    a.setOrganizationName("sqlitebrowser");    a.setApplicationName("SQLite Database Browser");    // Set character encoding to UTF8    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));    // Enable translation    QTranslator translator;    translator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));    a.installTranslator(&translator);    QTranslator apptranslator;    apptranslator.load("translations/tr_" + QLocale::system().name());    a.installTranslator(&apptranslator);    MainWindow w;#if defined(Q_WS_MAC)    AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,                          NewAEEventHandlerUPP(odocHandler),reinterpret_cast<long>(&w),false);#endif // Q_WS_MAC    w.show();    if (argc>1) {        //first and only argument we accept is the name of the database to open        w.fileOpen(QString(argv[1]));    }    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );    return a.exec();}
开发者ID:mmankarious,项目名称:sqlitebrowser,代码行数:32,


示例14: os_initialize

bool os_initialize( adobe::application_t* theApp ){    //    // On the Mac we need to install the application menus, respond    // to AppleEvents and set the resource path. We set the resource    // path first.    //    ProcessSerialNumber psn;    ADOBE_REQUIRE_STATUS( GetCurrentProcess( &psn ) );    FSRef location;    ADOBE_REQUIRE_STATUS( GetProcessBundleLocation( &psn, &location ) );    theApp->set_resource_directory( fsref_to_path( location ) / "Contents" / "Resources" );    //    // Now load our bundle, sign up for AppleEvents and show the menu.    //    CFBundleRef bundle = CFBundleGetMainBundle();    IBNibRef    nibs = 0;    if( !bundle ) return false;    ADOBE_REQUIRE_STATUS( CreateNibReferenceWithCFBundle( bundle, kMainNibFileName, &nibs ) );    if( !nibs )    {        ::CFRelease( bundle );        return false;    }    //    // Sign up to handle the "Open" AppleEvent.    //    static adobe::auto_resource<AEEventHandlerUPP> ae_handler( NewAEEventHandlerUPP( handle_open ) );    AEInstallEventHandler( kCoreEventClass, kAEOpenDocuments, ae_handler.get(), 0, false );    //    // Install the menu, and it's event handler.    //    ADOBE_REQUIRE_STATUS( SetMenuBarFromNib( nibs, kMenuBarNibName ) );    static EventTypeSpec                            hi_event = { kEventClassCommand, kHICommandFromMenu };    static adobe::auto_resource<EventHandlerUPP>    hi_handler( NewEventHandlerUPP( menu_command ) );    InstallApplicationEventHandler( hi_handler.get(), 1, &hi_event, theApp, 0 );    //    // Register this app as an Appearance Client    //    // Apple docs: "This function does nothing on Mac OS X. Do not call it."    //    // RegisterAppearanceClient();    return true;}
开发者ID:sehe,项目名称:legacy,代码行数:58,


示例15: main

int main( int argc, char** argv ){        QCoreApplication::setApplicationName( moose::applicationName() );    QCoreApplication::setApplicationVersion( VERSION );    QCoreApplication::setOrganizationName( CoreSettings::organizationName() );    QCoreApplication::setOrganizationDomain( CoreSettings::organizationDomain() );#ifdef NDEBUG    UniqueApplication uapp( moose::id() );    if (uapp.isAlreadyRunning())		return uapp.forward( argc, argv ) ? 0 : 1;    uapp.init1();#endif	        try    {        App app( argc, argv );      #ifdef NDEBUG		uapp.init2( &app );        app.connect( &uapp, SIGNAL(arguments( QStringList )), SLOT(parseArguments( QStringList )) );      #endif      #ifdef Q_WS_MAC        AEEventHandlerUPP h = NewAEEventHandlerUPP( appleEventHandler );        AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );        //AEInstallEventHandler( kCoreEventClass, kAEQuitApplication, h, 0, false ); //QCoreApplication handles this for us        AEInstallEventHandler( kCoreEventClass, kAEReopenApplication, h, 0, false );      #endif        Container container; gcon = &container;        container.show();        if (!app.arguments().contains( "--tray" ))            container.show();        app.parseArguments( app.arguments() );        return app.exec();    }    catch (unicorn::Application::StubbornUserException&)    {        // user wouldn't log in        return 0;    }    }
开发者ID:RJ,项目名称:lastfm-desktop,代码行数:45,


示例16: IACinstallhandler

Boolean IACinstallhandler (AEEventClass eventclass, AEEventID id, ProcPtr handler) {		OSErr ec;		#if TARGET_API_MAC_CARBON == 1		ec = AEInstallEventHandler (eventclass, id, NewAEEventHandlerUPP ((AEEventHandlerProcPtr) handler), 0, false);		#else			ec = AEInstallEventHandler (eventclass, id, NewAEEventHandlerProc (handler), 0, false);		#endif		IACglobals.errorcode = ec;		return (ec == noErr);	} /*AEinstallhandler*/
开发者ID:pombredanne,项目名称:Frontier,代码行数:18,


示例17: InitAppleEvents

void InitAppleEvents(void){	OSErr	err;		oappUPP = NewAEEventHandlerUPP(AEoapp);	err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,   oappUPP, 0L, false);		odocUPP = NewAEEventHandlerUPP(AEodoc);	err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,     odocUPP, 0L, false);			pdocUPP = NewAEEventHandlerUPP(AEpdoc);	err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,    pdocUPP, 0L, false);			quitUPP = NewAEEventHandlerUPP(AEquit);	err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,   quitUPP, 0L, false);			rappUPP = NewAEEventHandlerUPP(AErapp);	err = AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, rappUPP, 0L, false);}
开发者ID:alesegdia,项目名称:snes-sdk,代码行数:19,


示例18: InstallAppleEventHandlers

static	void	InstallAppleEventHandlers( void ){	OSErr		status;		status	= AEInstallEventHandler( kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerUPP(HandleAppleEventOdoc), 0, false );		require_noerr( status, CantInstallAppleEventHandler );	//	Note: Since RunApplicationEventLoop installs a Quit AE Handler, there is no need to do it here.CantInstallAppleEventHandler:	return;}
开发者ID:fruitsamples,项目名称:SimpleAudioExtraction,代码行数:10,


示例19: Initialize

void Initialize()	/* Initialize some managers */{    OSErr	err;            InitCursor();    err = AEInstallEventHandler( kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP((AEEventHandlerProcPtr)QuitAppleEventHandler), 0, false );    if (err != noErr)        ExitToShell();}
开发者ID:fruitsamples,项目名称:CGGamma,代码行数:10,


示例20: initialize_application

/* ----------- private code */static void initialize_application(	void){	Handle menubar;	StringHandle		userName;#ifndef OP_PLATFORM_MAC_CARBON_FLAG	MaxApplZone();	MoreMasters();	MoreMasters();	MoreMasters();		InitGraf(&qd.thePort);	InitFonts();	InitWindows();	InitMenus();	TEInit();	InitDialogs(NULL);#else	MoreMasterPointers(192);#endif // ! OP_PLATFORM_MAC_CARBON_FLAG	InitCursor();	FlushEvents(everyEvent, 0);	menubar= GetNewMBar(rMENU_BAR_ID);	op_assert(menubar);	SetMenuBar(menubar);	DisposeHandle(menubar);	AppendResMenu(GetMenuHandle(mApple), 'DRVR');	DrawMenuBar();	//	Get the user name from the system
C++ AES_cbc_encrypt函数代码示例
C++ AEDisposeDesc函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。