[prev in list] [next in list] [prev in thread] [next in thread]
List: cairo
Subject: Re: [cairo] cairomm - userfonts
From: Behdad Esfahbod <behdad () behdad ! org>
Date: 2008-05-26 4:49:42
Message-ID: 1211777383.26666.3.camel () behdad ! behdad ! org
[Download RAW message or body]
On Sun, 2008-05-25 at 22:36 -0300, Felipe Sanches wrote:
> I started to read the cairomm code today because I am interested in
> coding the userfont cairomm binding but I faced the following problem:
> how do we deal with callbacks when writting a binding? I need to give
> to cairo a callback to a class method since cairo is written in C, how
> would it deal with the instance pointer (this) ?
Hi,
I'm no binding expert, but I believe the idea is that you can use the
user_data mechanism to attach arbitrary data to cairo objects. In this
case see cairo_scaled_font_set_user_data. You would stuff your method
and instance pointers into a struct and hook it to user_data, then
attach a callback that retrieves that user_data and calls the actual
callback...
> Juca
--
behdad
http://behdad.org/
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
_______________________________________________
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic