Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: WebKit with Carbon interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WebKit with Carbon interface



Hi!

On Donnerstag, Juli 24, 2003, at 06:17 Uhr, Kelsey Schwind wrote:
I am in the process of wrapping Objective-C/Cocoa code into a Mach-O
framework that I will call into from my Carbon app. Is this how you are
doing it? If not, is there a different or better way?


I created a Cocoa Bundle - which I load into my Carbon app. I just followed these instructions...

http://developer.apple.com/documentation/Cocoa/Conceptual/ DisplayWebContent/Tasks/CarbonApps.html
http://developer.apple.com/documentation/Cocoa/Conceptual/ CarbonCocoaDoc/cci_chap3/chapter_3_section_2.html
http://developer.apple.com/documentation/Cocoa/Conceptual/ CarbonCocoaDoc/cci_chap2/chapter_2_section_1.html


... made a first working dummy and then specialized it for my needs. It was a stoneless way so far - just the problem I described in my other mail.

2) When I receive an event through a WebView delegate I do not exactly
know what the best way is to inform my Carbon app. Today I create a
command event with some parameters and send it to my app. Is this the
nicest way to go? How can I do this more elegant.

What exactly do you mean by "command event"?

I ment the other way arround - receiving events from the Cocoa WebKit. Something like this (out of my Cocoa Bundle):

void SendCommandProcessEvent(UInt32 theCommandID, HIViewRef theCarbonRef, int theError, NSString* theString)
{
HICommandExtended aCommand;
EventRef anEvent;


// Parameter speichern
SetControlProperty(theCarbonRef, theCommandID, 'int1', sizeof(int), &theError);
SetControlProperty(theCarbonRef, theCommandID, 'str1', ([theString cStringLength] + 1), [theString cString]);


    // Event senden
    BlockZero(&aCommand, sizeof(aCommand));
    aCommand.attributes = kHICommandFromControl;
    aCommand.source.control = theCarbonRef;
    aCommand.commandID = theCommandID;

    (void) CreateEvent(
        NULL,
        kEventClassCommand,
        kEventCommandProcess,
        GetCurrentEventTime(),
        kEventAttributeUserEvent,
        &anEvent
    );
    (void) SetEventParameter(
        anEvent,
        kEventParamDirectObject,
        typeHICommand,
        sizeof(aCommand),
        &aCommand
    );
    (void) SendEventToApplication(anEvent);
    (void) ReleaseEvent(anEvent);
}

Best,
Marcel
_______________________________________________
webkitsdk-dev mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/webkitsdk-dev
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.