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



On 7/24/03 4:00 AM, "Marcel" <email@hidden> wrote:

> Hello!
>
> I am using WebKit from a Carbon application. After learning how to wrap
> Objective-C/Cocoa code into C/Carbon I have overall great success with
> it.

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?

> 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 was thinking of using the
same mechanism I'm using in the host app to call my framework, although it's
not beautiful either, see below. Better suggestions appreciated.

static OSStatus Foo(void)
{
    typedef OSStatus (*FooProcPtr)(void);
    static FooProcPtr FooProc = NULL;

    if (FooProc == NULL)
    {
        CFBundleRef appBundle = CFBundleGetMainBundle();

        FooProc =
            (FooProcPtr)
             CFBundleGetFunctionPointerForName(appBundle, CFSTR("Foo"));
    }

    if (FooProc != NULL)
        return FooProc();
    else
        return error;
}

-Kelsey
_______________________________________________
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.

References: 
 >WebKit with Carbon interface (From: Marcel <email@hidden>)



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.