Paste number 16907: apemain

Paste number 16907: apemain
Pasted by: aptiva
When:15 years, 8 months ago
Share:Tweet this! | http://paste.lisp.org/+D1N
Channel:None
Paste contents:
Raw Source | XML | Display As
// ===========================================================================
//
//	File:		APEMain.c
//
//	Contains:	Menufela APE Module code
//
//	Copyright:	Copyright (c) 2006, __MyCompanyName__ 
//			All Rights Reserved.
//
//	Author(s):	Fjölnir Ásgeirsson (16.2.2006)
//
// ===========================================================================


#include <ApplicationEnhancer/ApplicationEnhancer.h>
#include <ApplicationEnhancer/APETools.h> 
#include <Carbon/Carbon.h>

#pragma mark -
#pragma mark DEFS
pascal OSStatus myEventHandler(EventHandlerCallRef  nextHandler,
                               EventRef             theEvent, 
                               void*                userData);
#pragma mark -
#pragma mark IMP
void APEBundleMain(CFBundleRef inBundle)
{
    if (APEToolsIsInExcludeList(CFSTR("is.aquaticsw.menufela"), NULL)) {
        apeprintf("Menufela: Not loading as this application is excluded.\n");
        return;
    }
	
	// Install our event handler
	EventHandlerRef gEventHandler = NULL;
	EventHandlerUPP myEventHandler = NewEventHandlerUPP(myEventHandler);
	/*EventTypeSpec events[1] = {
		//{kEventClassMouse, kEventMouseEntered},  
		//{kEventClassMouse, kEventMouseExited}
	};*/
	EventTypeSpec events[1] = {{kEventClassMouse, kEventMouseMoved}};
	InstallEventHandler(GetApplicationEventTarget(), myEventHandler, 2, events, NULL, &gEventHandler);
	
    apeprintf("Menufela: hello world!\n");
    return;
}

OSStatus myEventHandler(EventHandlerCallRef  nextHandler,
                        EventRef             theEvent, 
                        void*                userData)
{
	apeprintf("....");
	
	return noErr;
}

OSStatus APEBundleMessage(CFStringRef message,CFDataRef inData,CFDataRef *outData)
{
    apeprintf("Menufela: message '%@' (inData = %@)\n", message, inData);
	
    return noErr;
}

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.