Re: [cairo-compmgr] Re: problem with interfaces

[ Thread Index | Date Index | More lists.tuxfamily.org/cairo-compmgr Archives ]


Hi Carlos,

First sorry for my late answers, I'm really busy in this time by my job,
but you can contact me more easily, if you want, on irc (irc.gimp.org
#cairo-compmgr.

You ask how you can help and you made a plugin, it's exactly what ccm
need ;).

Well, now your problem, if i understand, you want made a plugin which
implement a screen interface and a window interface.  When you made
that, ccm create an instance of your plugin for each screen and for each
window. Each object are independent, but you can access to screen plugin
instance when you are in window plugin instance and vice versa. An
example, you are in ccm_magnifier_window_paint and you want access to
screen plugin instance, you can made that with _ccm_screen_get_plugin
like this :

void
ccm_magnifier_window_paint(CCMWindowPlugin* plugin, CCMWindow*
window ....)
{
....
CCMMagnifier* self = CCM_MAGNIFIER(plugin)
CCMScreen* screen = ccm_drawable_get_screen(CCM_DRAWABLE(window));
CCMMagnifier* self_screen = CCM_MAGNIFIER(_ccm_screen_get_plugin(screen,
CCM_TYPE_MAGNIFIER));
....
}

else if you want to access to window plugin instance in screen plugin
instance, for example in ccm_screen_add_window, you can made that with
_ccm_window_get_plugin like this

void
ccm_magnifier_add_window(CCMScreenPlugin* plugin,  CCMScreen* screen,
CCMWindow* window)
{
.....
CCMMagnifier* self = CCM_MAGNIFIER(plugin)
CCMMagnifier* self_window = CCM_MAGNIFIER(_ccm_window_get_plugin(screen,
CCM_TYPE_MAGNIFIER));
.....
}

to finish, don't forget a window/screen plugin is CCMPlugin object which
implement CCMSreenPlugin/CCMWindowPlugin interface and you can't cast
your instance directly to CCMScreen/CCMWindow object.

I hope, i'm clear, if not say me.

Nicolas
-- 
gandalfn <gandalfn@xxxxxxxxxxxxxxxx>

Attachment: signature.asc
Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/