[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: inter-plugin dependencies and BC
From:       Kuba Ober <kuba () mareimbrium ! org>
Date:       2005-09-08 14:07:28
Message-ID: 200509081007.28779.kuba () mareimbrium ! org
[Download RAW message or body]

> > I'm all for it. I think we already discussed something like that one or
> > two years ago. In Qt Designer 4 I *solved* the problem with a library
> > called "extension framework". The extension framework is an
> > implementation of the adaptor pattern

So, looking at the code below, you essentially only access adaptors that 
provide the interface that you need, and never access the instance directly, 
right?

[...]

> > struct MyInterfaceV1
> > { ...
> >   virtual void method1()  = 0;
> > };
> > Q_DECLARE_EXTENSION_INTERFACE(MyInterfaceV1, "org.kdevelop.iface.v1")
> >
> > struct MyInterfaceV2
> > { ...
> >  virtual void method1() = 0;
> >  virtual void method2() = 0;
> > };
> > Q_DECLARE_EXTENSION_INTERFACE(MyInterfaceV2, "org.kdevelop.iface.v2")
> >
> > now you can ask which extension your instance support. Of course the
> > instance can support both extension.
> >
> >  if (MyInterfaceV1 *v1 = qt_extension<MyInterfaceV1*>(m, instance))
> >    {
> >       // do something
> >    }
> >  else if (MyInterfaceV2 *v2 = qt_extension<MyInterfaceV2*>(m, instance))
> >    {
> >       // do something else
> >    }

Quick questions:
1. Is the 'instance' in the code above the instance pointer that you obtain 
from some type of a factory in the plugin?
2. What's 'm' (I'm too lazy to look at the actual code)?

Cheers, Kuba

_______________________________________________
KDevelop-devel mailing list
KDevelop-devel@barney.cs.uni-potsdam.de
http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic