Repassing Signals.



Hello, everyone. This is my first post at this list, and please point me to the right directions if this is not the right place to ask this kind of information.

I am having a problem while trying to implement the adapter pattern[1], because of signals.

The thing is : I wanna make my application independent of some special component (there are various available that do the same thing, with different interfaces) so I want to wrap their instances a simple interface that is meaningful to my application, but different from that of any component that I may use.

All goes well, the problem is that I would like to keep the flexibility of the signal mechanisms (Allowing clients to connect to the signals before or after the default handler, for instance) but I can't find a way to pass the signals.

This is more or less what I want to have..

Clients A, B, C connects to the "emitted_bar" signal on object of class WO (wrapper object). But I actually want them to listen to the "emitted_foo" signal on object of class UC (used component).

Is it possible to make sure that the signals connected with g_signal_connect on "emitted_bar" will only be triggered before the default handler of "emitted_foo" and those with g_signal_connect_after only after it ?

I know it is weird, but it is just that I need to use the signals and wouldn't like having to change my application whenever I decided to use another, perhaps more powerful, component if they have the same "logical" interface.


Cheers,
Alexandre Moreira.

[1] http://en.wikipedia.org/wiki/Adapter_pattern


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]