[cairo] [cairo osx] OS X example

Baz brian.ewins at gmail.com
Wed Jun 20 08:13:36 PDT 2007


On 20/06/07, Ipacs Péter <peter at ipacs.hu> wrote:
> Hi there,
>
> I'm quite new to cairo so please excuse me if I ask obvious questions:)

No problem.

> I'm trying to build the quartz example from the CVS
> (http://webcvs.cairographics.org/cairo-demo/quartz/ ) but
> it fails.

That is pretty old... its not been kept up-to-date.

> This is what I get:
> cc -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wredundant-decls `pkg-config --cflags cairo`   -c -o main.o main.c
> main.c: In function 'TestWindowEventHandler':
> main.c:65: error: incompatible type for argument 1 of
> 'cairo_quartz_surface_create'

Back in January or so the old quartz surface was replaced with a new
shiny one Vlad wrote. Its much faster but incompatible with the old
api (BTW quartz and atsui are still officially 'unsupported' at the
moment, which is why there's no docs for these apis on the website,
and why things became incompatible; this should change in the next
month or so. I hope).

The new name for that function is:
cairo_quartz_surface_create_for_cg_context

> main.c: In function 'RedrawTimerCallback':
> main.c:188: warning: 'SetRect' is deprecated (declared at
> /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:2401)
> main.c: In function 'CreateTestWindow':
> main.c:205: warning: 'SetRect' is deprecated (declared at
> /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:2401)
> make: *** [main.o] Error 1
>
> What do you think about it?

The warnings you can probably get past, so apart from creating the
surface the example should pretty much work.

> Another question:
> Are there any OS X examples around that can be used out-of-the-box? I mean
> examples that does not require hundreds of dependencies and can be compiled
> by a simple 'make' or something.

I don't think so, unless someone else has one handy? A gui for the
test suite, or a standalone svg viewer would be nice to have... since
native os x apps just call quartz, the main use for cairo on os x is
to support cross-platform tools/toolkits, like mozilla, gtk, OOo, SWT,
python. So mostly users are porting apps rather than writing mini-apps
from scratch.

We do have a neeed for a small demo app to figure out why all the
flipping is needed in the quartz code - I'm next at my mac tomorrow,
I'll try to put one together. If you still can't get that demo to
compile, let me know and I'll fix that too.

> Cheers,
> Peter

As Carl says to new users - have fun :)

Cheers,
Baz


More information about the cairo mailing list