CairoGraphics

Description

Port of Travis Griggs' VisualWorks package to Squeak/Pharo + Alien FFI. Currently it only works with older versions of Alien, since I haven't brought it up to speed with more recent refactrings. Hopefully I will be able to clear this up soon.Primitives are invoked via the class CRLibrary, which has a single class instance variable to hold the name of the library (e.g. 'libcairo.dylib'). Methods on the class-side like:void: function with: arg1 with: arg2... are used to invoke the methods in the library.Apart from primitive invocation, this is a fairly straightforward port. Items to note:Classes are prefixed with CR. Classes that began with 'Cairo' had that portion of their name dropped (e.g. CairoContext became CRContext)LibCairo was renamed to CRLibraryThe ColorBlend class was dropped; we use TranslucentColor instead (indirectly; our access goes through Color).Instead of VisualWorks ephemerons, this uses WeakArray finalization by subclassing from AlienWeakRegistryPlatform-specific display surfaces (e.g. Windows, Quartz, X11) were not included in the portIf you don't provide float size hints to Alien, it assumes all Float instances (in Squeak) turn into doubles (in C). This works out well for us, since Cairo uses nothing but doubles.

Details

Source
SqueakSource
Dialect
pharo (25% confidence)

Categories

UI / Graphics System / OS
← Back to results