<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div style="padding-left: 70pt; ">Hi,</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">New to the list and already my first question….</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">I'd like to have the recording surface grab colours to playback from a parent..</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">E.g. </div>
<div style="padding-left: 70pt; ">draw…</div>
<div style="padding-left: 70pt; ">set color to X</div>
<div style="padding-left: 70pt; ">paint</div>
<div style="padding-left: 70pt; ">set color to Y</div>
<div style="padding-left: 70pt; ">draw…</div>
<div style="padding-left: 70pt; ">paint</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">When playing it back I'd like to be able to vary X. Like an Andy Warhol pic be able to play back in BLUE, RED,…</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">There are other clear applications.. In PDF, for example, we have something called Xobjects. These contain a number of</div>
<div style="padding-left: 70pt; ">drawing operations and get their stroking and non-stroking (fill) colours from the context into which they are being played</div>
<div style="padding-left: 70pt; ">back into.</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">At the current stage I suspect the only means would be to extend cairo with something like</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">typedef cairo_status_t (*cairo_callback_func_t) (int which, cairo_t *cr, void *data);</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">cairo_status_t cairo_callback_set (cairo_t *cr, cairo_callback_func_t callback);</div>
<div style="padding-left: 70pt; ">cairo_status_t cairo_callback_call (cairo_t *cr, int which, void *data);</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">(data is not really needed but I figure maybe it can't hurt even if its means one needs to store a pointer)</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">the callback could then in the above example set the colors (which choosing which one).. or be used for a host of other</div>
<div style="padding-left: 70pt; ">applications, even attach/fetch the user data from surface backing the context.. Putting the callback function into gstate even</div>
<div style="padding-left: 70pt; ">lets one push/pop them to one delight..</div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">This extension would be simple enough to do.. </div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; ">Or is there already a means to handle my use case without extending Cairo and I'm just missing the trivial?</div>
<div style="padding-left: 70pt; "> </div>
<div><font color="#210058"> </font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">_________________________________________________________________</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">Edward C. Zimmermann</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">Softwareentwicklung</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">–––</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">CIB software GmbH</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">Elektrastr. 6a</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">81925 München</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">–––</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">T +49 (0)89 / 1 43 60 - 156</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">F +49 (0)89 / 1 43 60 -100</font></div>
<div><a href="mailto:edward.zimmermann@cib.de"><font face="Verdana, sans-serif" size="2" color="#0000FF"><u>edward.zimmermann@cib.de</u></font></a></div>
<div><a href="http://www.cib.de/"><font face="Verdana, sans-serif" size="2" color="#0000FF"><u>www.cib.de</u></font></a></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">–––</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">Sitz: München </font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">Registergericht München, HRB 123286</font></div>
<div><font face="Verdana, sans-serif" size="2" color="#210058">Geschäftsführer: Dipl.-Ing. Ulrich Brandner</font></div>
<div> </div>
<div style="padding-left: 70pt; "> </div>
<div style="padding-left: 70pt; "> </div>
</font>
</body>
</html>