Skip to content

amadeusoft/amadeus-chromium-tabs

Repository files navigation

Amadeus.Chromium.Tabs

Amadeus.Chromium.Tabs is a .NET assembly that provides MonoMac bindings for the Chromium Tabs framework, a framework for building applications that work like Chromium's window system, on OS X.

  • An application has multiple windows.
  • Each window represents a unit of tabs.
  • Each tab represents a stateful view.
  • Each tab can be freely dragged between windows.

Usage

You should always make sure that the ChromiumTabs.framework bundle is included with your MonoMac application.

When building a MonoMac application in Xamarin Studio:

  1. Create a ChromiumTabs directory in the the same directory with your solution file.

  2. Add the ChromiumTabs.framework bundle in the ChromiumTabs directory.

  3. Open your project's Project Options dialog (double-click your project in the Solution tree).

  4. Under Build -> Custom Commands, add the following After Build operations, in this order:

    1. rm -Rf ${TargetDir}/${ProjectName}.app/Contents/Frameworks
    2. mkdir -p ${TargetDir}/${ProjectName}.app/Contents/Frameworks
    3. cp -Rpf ${SolutionDir}/ChromiumTabs/ChromiumTabs.framework ${TargetDir}/${ProjectName}.app/Contents/Frameworks/ChromiumTabs.framework/
  5. Open the Edit References dialog for your project.

  6. Add a reference to the Awesomium.Chromium.Tabs.dll assembly.

  7. In your application's Main.cs, add the following in your Main function, before NSApplication.Init():

    Amadeus.Chromium.Tabs.ChromiumTabs.Load();

You are now ready to start using Chromium Tabs. In the simpliest possible scenario, you should call the following when your application has started (e.g. in your AppDelegate's FinishedLaunching override):

Amadeus.Chromium.Tabs.CTBrowser.Browser().NewWindow();

The example application (in Examples/SimpleApp/) is a C# port of the original example available with the Chromium Tabs project, here. It illustrates basic usage and likes to be inspected while you drink coffee. It looks like this:

A slightly boring screenshot of the example application

When building a "real" application you will need to subclass at least the CTBrowser class which creates tabs and their content. The example application does this at a very basic level (provides custom tab content).

Building

  1. Check out (or download) the source code.
  2. Copy the ChromiumTabs.framework bundle under the ChromiumTabs directory. (If you do not have this, you can get it by compiling this Chromium Tabs framework fork from source.)
  3. Copy MonoMac.dll and the bmac.exe generator, under the Interfaces directory. (If you do not have bmac.exe, you can get it by compiling MonoMac from source.)
  4. Open the Amadeus.Chromium.Tabs.sln solution in Xamarin Studio.
  5. Choose your configuration and hit Build.

Important: Files in the Awesomium.Chromium.Tabs project that have a g.cs suffix, are generated automatically by the bmac generator when you build the solution. You should not edit these files manually. Any changes to these files will be lost when you build the solution. Instead, you can edit the ChromiumTabsAPI.cs file available under the Interfaces folder. For details about editing this file, see Binding Objective-C Libraries - Binding Types Reference Guide

Requirements

  • OS X 10.7 or later.
  • Latest Mono version for Mac OS X.
  • Xamarin Studio for Mac OS X.
  • Latest MonoMac version (should be installed with Xamarin Studiofor Mac OS X).
  • Xcode 4 (for building the Chromium Tabs framework framework).
  • MonoMac source for building the bmac.exe used to generate the bindings, in case you want to edit the ChromiumTabsAPI.cs file available with the project.

About

MonoMac bindings for the ChromiumTabs framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages