The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Cairo Workspace

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Cairo Workspace Posted: Nov 28, 2006 7:31 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Cairo Workspace
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement

I've been tinkering away with Cairo in my copious spare time. I've had this pipe dream. Big pipe. I was hoping that it would be possible to do some bridge interface objects and make something like this work:

builder := Workspace open.
window := builder window.
surface := ImageSurface format: #FormatAlphaColor extent: window bounds extent.
context := surface context.
[window component renderOn: context] ensure: [window controller closeAndUnschedule].
surface saveAsPng: 'cairoworkspace.png'

Well, it does work:

VisualWorks Workspace ala Cairo

At least, kinda. That's a .png file that I generated from the above code. It wasn't a screen capture. It was an interesting experiment to get to that point. The approach I chose was to simply add a parallel API to the classlcal displayOn: family of methods. One called renderOn:. I had to duplicate a bunch of methods to get this to work. It was mundane and straightforward. And definitely not the way to pursue such a goal.

I really like Cairo though. That it can do arbitrary shaped clipping, and manages it all for you is great. And I really like the save/restore stack model it has. The thing that this attempt made clear too though, is the text thing just isn't there by itself. You can see some of the artifacts in the graphic above. So I'll have a look at Pango. And see how that fairs. I'll try to publish a new version of cairo this evening. And I think I'll let go of my pipe dream of transparently having all the display code in VW just automagically render using Cairo, concentrate instead on supporting the creation of new drawing things that use Cairo.

I do believe that Cairo could be used quite easily at this point to generate graphics for web content.

Read: Cairo Workspace

Topic: Weekly Log Analysis: 11/25/06 Previous Topic   Next Topic Topic: Industry Misinterpretations Episode 11 (Part 1)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use