[cairo] cairo_window proposal

Bill Spitzak spitzak at gmail.com
Wed Aug 18 01:50:02 PDT 2010


Comments please! Also if you are on Linux (or on something else and are 
adventurous) please try the attached code in the tgz file.

Cairo "toy" Window API

This is a very tiny toolkit designed to make flashy but simple demos
and test programs in Cairo, which I believe can be ported to any
display that Cairo works on. I am proposing that it be added as a
"toy" window api, in which case the function prefix would be changed
from "cairot_" to "cairo_window_", and that users be allowed to use
this api to make self-contained cairo demo programs.

The toolkit is designed to be fun and simple, like glut is for
opengl. Programs using it should be easy to figure out and modify into
new programs. Note that a lot of stuff is purposely missing so this
remains tiny and to discourage using it for major programs. Use GTK
or whatever if you want a serious program. However I have tried to
make an effort to make this usable as a base for a serious toolkit,
just in case that is ever done (this was done with glut several times
despite glut being very badly designed for this).

The purpose is to encourage much more testing of Cairo as a screen
api. Currently the vast amount of testing seems to be to make .png
images and svg output. The reason is that cairo can do these without
any more support and in a way that is portable between operating
systems. I think this is seriously harming Cairos speed and quality
for screen display.

Reasons to support this:

- Viewable Cairo demo programs can be created that are portable and
   are easy to recompile.

- Users can test cairo without having to figure out how to install and
   use a vast other library that they otherwise do not have or need.

- Code may provide accessable information for programmers who want to
   figure out how to support cairo in other toolkits.

- Allows an accurate assessment of what dependencies cairo and pango
   have. GTK swamps them and makes things misleading.

- This sort of api is fun to use, which is part of Cairo's design
   philosophy.

Current version has the following limitations:

- Makefile requires pkg-config and only tested on Linux.

- Only the xlib implementation exists.

- Only a single window works. This may always be true for some
   implementations that go to frame buffers.

- A number of useful functions are nyi, including resizing windows,
   destroying them, and unmapping them.

- 'key' argument to keypress callback is the X11 keysym. This must be
   replaced with a system-independent and compact enumeration. Probably
   use the Qt enumeration values.

Proposed additions:

- NYI functions in the header file

- Would like any suggestions for api changes or additions.

- WIN32 version

- OS/X version (need help with this)

- xcb version

- Implementations for some of those ARM frame buffer devices

- Merge into Cairo, somewhat like the png stuff is.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairot.tgz
Type: application/x-compressed-tar
Size: 7557 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100818/4629503b/attachment-0001.bin>


More information about the cairo mailing list