Wrapping the panel
Nick Schermer
nickschermer at gmail.com
Sun Sep 6 23:03:35 CEST 2009
2009/9/6 Bo Lorentsen <bl at lue.dk>:
> I have been trying to find a good way to approach the wrapping of C++ panel
> plugins, and I am sorry to say that I am a bit lost.
>
> In the documentation, the XfcePanelPlugin are shown as a GInterface, but in
> the the header files we really got two types.
XfceInternalPanelPlugin is an object that implements the
XfcePanelPlugin interface, with a GtkEvenBox as parent
type.XfceExternalPanelPlugin the same but with a GtkPlug as parent
type. XfcePanelPlugin (the iface) also implements a base for the
signals and properties.
Both the internal and external plugins also implement the
XfcePanelItem interface, which is the communication between the panel
and plugin (XfcePanelPlugin interface the users' side of the
implementation).
> This makes sense, as we in principle can't make properties nor signals on a
> interface, but only on a GObject.
No, when you construct a panel plugin you get either an external or
internal plugin (say and eventbox or a plug), you communicate with
that through the iface. The XfcePanelPlugin base_init registers the
signals and properties for both the internal and external object.
> So I can's specialize a plugin by enheritment, and I can't control the
> creation of the plugin object. Any idea to how this can be done in a usefull
> way ?
We (Jasper is with me on this one, I know ;-) admit this
implementation is quite complicated. Therefor I simplified this in the
devel/4.8 panel. There the XfcePanelPlugin is a 'normal' object with 1
iface for the panel specific communication. If the 4.6 implementation
is too complicated for the c++ bindings, I suggest to focus on the
devel panel, which will be a lot easier for you. I'm even for api
breaks if stuff is not c++-wrap-able at this point of development.
Nick
More information about the Xfce4-dev
mailing list