[wx-discuss] wxTNG: compatibility with wx2 API

Stefan Csomor csomor at advancedconcepts.ch
Fri Feb 17 10:04:04 PST 2006


Hi 

> SC> >  So you'd write a new wx::DC implementation but the only way to 
> SC> > use it, for foreseeable future, would be via existing 
> wx2 wxDC. I 
> SC> > don't find this very interesting because, again, I'm mostly 
> SC> > interested in using new API directly and this is not 
> going to be 
> SC> > possible before wx3 is finished.
> SC> 
> SC> you'd have to wait until the dc implementation is finished, for a 
> SC> certain platform before you can use it from a wx3 api, 
> but not for more.
> 
>  Wait, but to be able to use wx3 API at all you'd need to 
> have not only wx::DC but also wx::Window and wx::Frame and 
> wx::EverythingElse. This is what I don't understand -- this 
> is not at all an incremental process, you need to be able to 
> compile wx3 program first.

why ? I could write eg :

MyWx2Frame::OnPaintEvent( .. )
{
  wxPaintDC dc2(this) ;
  wx3::DC dc3 = dc2.GetWX3DC() ;
  wx3::Colour transwhite( 1.0 , 1.0 , 1.0 , 0.5 ) ; // a 50 %
transparent white
  dc3.FillRectangle( wx::Rect( 100 , 100 , 100 , 100 ) , transwhite ) ;
}
 
it would be like retrieving eg a native dc from a dc and using GDIPlus
using a separate class, there is no need to have all other elements wx3
ready

> SC> The wx2-wxDC would have it's peer wx3-dc and you can 
> retrieve it and 
> SC> use the wx3 API on it directly.
> 
>  Ah, so you'd have a wx2 program which would just use some 
> wx3 classes here and there? I really don't think it's going 
> to work well, especially as soon as you consider the classes 
> which are used by other, existing, wx classes.

there are some module borders within which too much about the
implementation is known, that's true, but outside of that the wx2
classes are using the public API, which would be preserved by the wx2
bridged implementations

>  But, in any case, this is not what I'm after. I want to have 
> a reasonably fully functional wx3 API soon. We need this to 
> show it to others, to start advertising it (let's not be 
> afraid of this word), to propose it for inclusion in boost 
> (if we feel brave) or next C++ standard (if we feel
> crazy) and to attract more people, both users and developers, to it.
> Somehow I just don't see people being excited by the 
> possibility to use a few new wxDC features from the existing wx2 code.

I think they'd be happy to have their wx2 code still running, and being
able to slowly migrate parts they touch anyway

> SC> > wx2 would be interoperable with wx3 version using wx2 backend.
> ...
> SC> I don't see yet, how I could mix wx2 and wx3 code when eg 
> I want a 
> SC> .NET backend, let's say a WPF window, would this be 
> implemented in 
> SC> wx2, I thought you said you wanted one as a wx3 backend ?
> 
>  As I wrote above, wx2 would be interoperable only with wx3 
> version using
> wx2 backend. It won't magically allow the existing wx2 code 
> to use other backends.

so we would have to extend wx2 to support eg WPF ...

> SC> My idea -  I wouldn't call it a plan yet - is to replace 
> module by 
> SC> module or layer by layer of wx2 code that is implemented 
> directly on 
> SC> several platforms with
> SC> 
> SC> a) an wx3 implementation that is native on the several platforms
> SC> b) a wx2 on wx3 bridge
> SC> 
> SC> of course such an approach thing takes up more time than a wx3on2 
> SC> implementation,
>  
>  This is not the (main) problem. It's rather that there is 
> really no clean break with the past here and we just risk 
> muddling through for ages without arriving at anything worthy 
> of all the efforts. And, once again, I do admit that this is 
> not nearly as motivating to me as designing the new API right *now*.
> 
>  If anything, the above would be a good plan for the 
> mainstream wx2 development, e.g. you could probably do all 
> this in wx3 which would have only minor incompatibilities 
> with wx2. But this wx3 wouldn't have to be wxTNG.

it wouldn't have to, that's true, as much as a new API above wouldn't
have to, but it can ..

Best,

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-discuss-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wx-discuss-help at lists.wxwidgets.org





More information about the wx-discuss mailing list