Compiler patch for runtime reflection

Jacob Carlborg doob at me.com
Sun Oct 30 04:03:07 PDT 2011


On 2011-10-29 22:11, Adam Wilson wrote:
> WPF isn't the native GUI, it just comes with skins that emulate the look
> of the native GUI. The native GUI in Windows is called Win32 GDI
> (Graphices Device Interface). WPF is built on top of DirectX which is
> analagous to OpenGL and is primarily used for games. DirectX completely
> bypasses the GDI and communicates directly with the hardware. It's
> primary claim to fame is that it is fast, but it's not as compatible,
> whereas GDI is compatible with everything that implements VESA (which is
> everything since the early 90's), but it's slow.

We don't have to argue about this but it sounds like WPF is a new native 
GUI, especially if it bypasses GDI.

> Ok, so I apologize for generalizing there. It turns out that WPF is
> really bad at drawing round shapes, and the default skins (which the
> exception of the Windows 2000 skin) rely heavily on rounded corners. We
> replaced the default skin with one that used square corners and had
> fewer Measure and Arrange stages (where WPF figures out where to place
> the controls) which are equally expensive. WPF has virtual lists as
> well, and we do use it, which also helped contribute to our speed gains,
> but it is not enabled by default. My complaint is that the working with
> WPF requires a non-trivial amount of esoteric experience with it to make
> it work well.

With DWT you only pass an additional flag when creating the table, if I 
recall correctly.

> I am looking to create an open-source implementation of a GUI framework
> that is 'lookless', i.e. it's underlying implementation has no
> dependencies on how it looks and the look can be changed to however the
> designer wants it to look without having to worry about code. WPF and
> JavaFX are the only two frameworks that are examples of how this might
> work.
>
> I absolutely agree that relying on something else is probably not the
> best idea, because for better or worse you end up inheriting their
> design choices, which may or may not work for your project. Since I am
> windows guy, the reference implementation is going to be DirectX. First
> I just have to create Direct2D bindings for D...

What's wrong with using the lowest level of the drawing operations 
available on a given OS. On Mac OS X it would be Quartz which is has 
been hardware accelerated since a very long time. On Linux it would 
probably be Cairo and on Windows you could use the lowest level of WPF. 
Why reinvent the wheel again?

If you want to roll your own drawing operations anyway why not have the 
reference implementation in OpenGL, it's available on basically all 
platforms including Windows.

OpenGL bindings and other things like SDL and FreeType: 
http://dsource.org/projects/derelict

DirectX bindings and bindings in general: 
http://dsource.org/projects/bindings

This is not my strongest side, but wouldn't you need native windows to 
draw your widgets on?

> And another goal of the framework beyond platform independence is
> language independence. I have to admit that one of the big draws for me
> of D was the C++ ABI and COM compatibility of D while having a MUCH more
> modern capability set. However, it's still lacking in a few key areas
> for my project, and runtime reflection is one of them...

Just for the record, the interface to C++ is very limited.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list