Menu

Documentation

ifdefdebug

The "awe" namespace

The "awe" namespace contains all the wrapper classes.

This project does not include API reference documentation. For details about the workings of Awesomium, you will have to refer to the documentation and forums at the Awesomium website. For API reference, you have to refer to the Awesomium API references.

You can easily "map" wrapper items to the C API reference because all wrapper classes, methods and enums use the following coding conventions:

  • awe.WebView.LoadUrl() maps to awe_webview_load_url()
  • awe.WebView.ExecuteJavascript() maps to awe_webview_execute_javascript()
  • etc.

Some simple getter and setter functions are wrapped into properties:

  • awe.WebView.Url maps to awe_webview_get_url()
  • etc.

The WebView class exposes events. Those events wrap the respective callbacks in the C API:

  • awe.WebView.BeginNavigationCallback maps to awe_webview_set_callback_begin_navigation
  • etc.

There are a few convenience features in the wrapper:

  • WebCore.InitConfig is a class you can use if you want to initialize WebCore with only a few default values changed
  • Some of the methods are overloaded to provide default parameters, for instance WebView.LoadUrl
  • All classes that need to be destroyed have finalizers. You can destroy them explicitly or you can let them go out of scope safely.

Some C API functions are not (yet) implemented: ime functions, url filtering, header rewrite and some more. See also [Progress].

The "awe.Forms" namespace

There are two convenience classes to use in Windows Forms Applications:

  • awe.Forms.WebViewControl
  • awe.Forms.WebCoreUpdateTimer

WebViewControl inherits from the control class and can be used just as any other control in Winforms. The WebViewControl.CurrentWebView property gets and sets the web view currently displayed by the control.

WebCoreUpdateTimer takes care of updating the web core and exposes an event applications can register handlers for: the WebCoreUpdated event is triggered after each update of the web core. For instance, the WebViewControl class uses this event to check the dirty state of it's current web view and to invalidate dirty regions accordingly.

There are a few things you have to be aware of if you want to use those classes:

  • You have to use them from a thread with message pump, i.e., your Windows Forms Application´s GUI thread.
  • You have to initialize the WebCore before using them. Since your awesomium thread has a message pump when using these classes, you might want to initialize the core with disableWinMessagePump set to true.

The Sample Application

The sample application in the download is written in VB.NET with Visual Studio 2010 Express targeting the .NET 2.0 framework. Take a look at the code in Form1.vb to see an example about initializing the web core, starting the timer, showing a WebViewControl, using the callback events and executing javascript in the web view.


See also:
[Progress] [Download] [Using the Code] [Licensing]


Related

Wiki: Download
Wiki: Licensing
Wiki: Progress
Wiki: Using the Code
Wiki: Welcome to Awesomium.CApi.NET

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.