syntonica wrote:Which IDE do you recommend? I develop on a Mac, but I'm not especially enamored of Xcode.
To my knowledge current users do most development in Visual Studio with the VisualD add-on, and we debug within Visual Studio or with lldb on macOS.
On macOS, I don't think you can use Xcode, but some use VSCode with one of the D plug-ins.
I've tried to make the macOS debugging story better, but failed to install the "native-debug" VSCode plug-in and left there (I kind of like lldb for the text output). It's probably possible to succeed in this.
syntonica wrote:I do all my own GUI drawing using primitives (rect, arc, line and text) and handle my own redrawing of dirty components. Is this easily done?
dplug:graphics can draw rectangles, arcs, lines and text so you can look there to help translate.
You can use whatever CPU routines you prefer while drawing your own widgets, Dplug uses an Image "concept".
How dirtiness work in Dplug : there is one global list of (possibly overlapping) rectangles, assembled from many threads.
What an UIElement has is :
A) A way to invalidate a whole or part of its position rect.
B) a redraw() method which takes several
(non-overlapping) rectangles within the widget position rect, that have to be updated (and not the rest of the widget). This part probably don't match yours.
How good is debug support? I'm having a hell of a time trying to get debugging going in Windows right now. I just need step debugging and state inspection. Nothing fancy.
You can generate a VisualD .sln project using
- Code: Select all
dub generate visuald
. From there it's like in C++ you press F5 to debug. There are two available debuggers: Mago and the Visual Studio one, sometimes one work better than the other.
syntonica wrote:The majority of my code is C++, including GUI drawing, so I'd like to just be able to copy and paste it and then D-ify it, as it were. (Still have to learn D.)
It's much harder than that
Translations are a special kind of hell.
Dplug disable the D runtime and use a restricted subset (else each incoming thread would have to be "attached"). All your translated code will need to be
- Code: Select all
. There is a Wiki article on that topic.
There is an automatic translator in VisualD, I've never used it and I expect it would still need pampering.There are also ways to link with C++, you could define extern(C++) signatures in the D code, and link with object code but this is risky and I would avoid even trying.
Most practical(?) would be to derive UIElement once, for an adapter to your own UI widget abstraction. And your own widgets would inherit from that.
There is also the prettier solution of not using "dplug:gui" at all, and rewrite a "GUIGraphics" equivalent: this is the bridge between windowing and the UI widget systems.
You would have to implement "IGraphics", and instantiate your own subclass in your plugin client instead of a "GUIGraphics". The more I think of it, the more adequate it seems because you don't have to care about whatever Dplug does with its widgets. But more involved.