Murray Cumming wrote:
On Wed, 2008-07-09 at 17:37 +0300, Michael Boccara wrote:
  
I am new to the GLib and GObjects world, so my question may sound dumb.
Is it possible to implement new subclasses of Clutter::Actor without 
having to subclass the ClutterActor GObject ?
In other words, can we create our own actors using cluttermm only ?
    

It should be. You might be the first person to try it though.

  
I would be surprised if so.
As soon as you want a clutter actor with a more complex geometry than just a rectangle, the only way is to subclass ClutterActor and override the 'paint' method. In clutter, it would mean defining and binding the clutter_custom_actor_paint() function, with all the GObject subclassing nightmare it involves.
Or am I missing something ?

Actually just recently I got pretty optimistic about the possibility of  relying only on the C++ inheritance in the cluttermm level only, since I noticed an interesting change in the clutter_actor_paint() definition:

void
clutter_actor_paint (ClutterActor *self)
{
    // was like this in clutter-0.6.0
    // if (G_LIKELY (klass->paint))
    //   klass->paint (self);
   
    // and now in clutter-0.8.0 it is:
    g_signal_emit (self, actor_signals[PAINT], 0);
}

Up until clutter-0.6.0, the paint virtual method was hard-assigned to clutter_custom_actor_paint, which was making it impossible to get to use Clutter::CustomActor::paint() from the clutter_main() loop.
But  now that clutter-0.8.0 is emitting a Glib signal I guess it makes it possible for cluttermm to bind the PAINT signal to the Clutter::CusomActor::paint() virtual method.
Do I get it right ?
 
However, I recommend waiting for us to update cluttermm to 0.8 first
though. We didn't do that yet because it currently depends on other
clutter-* libraries that were no available in 0.7/0.8 versions (which I
consider to be a rather strange release schedule).

I guess we'll have something this week.

  


-- 
Michael Boccara
Graphtech
Herzliya, Israel

-- To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to