Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

Web Kit C Reference

Framework
Carbon/Carbon.h
Declared in
CarbonUtils.h
HIWebView.h

Overview

Note: This document was previously titled Web Kit Reference for C.

The Web Kit C API provides a way to embed a web view in a Carbon window. Once you have added the view to a window, you must load information to display URL content using native Cocoa classes.

For more details on how to add web views to your application and how to display and manage content using Objective-C APIs, see Displaying Web Content.

Functions

HIWebViewCreate

Creates an HIView-based container for web content.

OSStatus HIWebViewCreate (
   HIViewRef *outControl
);

Parameters
outControl

On return, outControl points to the newly-created web view.

Return Value

A result code.

Discussion

The web view is a standard HIView, so you can use any of the standard HIView functions to manipulate it. Note however, that the web view cannot currently be obscured by other views above it.

Availability
Declared In
HIWebView.h

HIWebViewGetWebView

Obtains the Cocoa NSView associated with the web view.

WebView * HIWebViewGetWebView (
   HIViewRef inView
);

Parameters
inView

The web view whose Cocoa equivalent you want to obtain.

Return Value

The Cocoa equivalent of the web view.

Discussion

You must obtain the Cocoa web view if you want to make native Cocoa calls to manipulate the view contents.

Availability
Declared In
HIWebView.h

WebConvertNSImageToCGImageRef

Creates a Core Graphics image from a Cocoa NSImage.

CGImageRef WebConvertNSImageToCGImageRef (
   NSImage *inImage
);

Parameters
inImage

A reference to the Cocoa NSImage to convert.

Return Value

A reference to the Core Graphics image.

Discussion

You may need to use this function if you want to display icons for URLs from the history or page icons.

Availability
Declared In
CarbonUtils.h

WebInitForCarbon

Initializes Web Kit.

void WebInitForCarbon (
   void
);

Discussion

You must call this function before making any other Web Kit calls. This function will call NSApplicationLoad, InstallEventLoopIdleTimer, and create a NSAutoreleasePool. This function only needs to be called once. Several calls to this function will do nothing, this is important in the case of plug-in bundles. Lastly, you do not need to call NSApplicationLoad and create a NSAutoreleasePool if you call this function.

Availability
Declared In
CarbonUtils.h

Next Page > Hide TOC


Last updated: 2006-03-08




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice