It borrows Android’s state drawables (they may be even used as is), nine-patch PNGs, and resource versions for different screen sizes or resolutions. Usually widgets don’t use a hardcoded look and feel or layout properties. He has worked on a number of items from his list, such as theme customization.ĭlangUI themes are inspired by the Android API. The cache provides a checkpoint method which removes the usage flag from all items, and a cleanup method which frees all cache items which have not been used since the last checkpoint. To allow cleanup of caches, all such resources have usage flags. Their references may be taken from the cache, used, and then released often. Windows remove their widgets when closing. I had to add debug mode instance counts for various objects, and corresponding messages in the log, to make sure all resources are freed gracefully. Widgets remove their children on destroy. Therefore, widgets and other objects holding resources must be destroyed manually by their ownersĭlangUI uses reference counting for easy freeing of owned objects. The D GC does not bring any help for resource management, since object destructors may be called in any thread, in any order, or never at all. If an object owns some resources, it ought to be destroyed in a predictable way. But as things got under way, he discovered that there is one particular issue with porting C++ to D that arises in the parts that can’t be directly reused. Such as support for hardware acceleration via an interface that easily supports different rendering backends, one of which is implemented using OpenGL. So he set about checking items off of his list. It was easy to reuse big parts of C++ code thanks to the similarity of D and C++ syntax. Part of DlangUI is a direct port of the CoolReader GL GUI. So when he got going with his DlangUI project, his previous work is where he started. A big set of requirements for one person to work on alone, but he already had a good deal of experience with the GUI he wrote for CoolReader. Resolution independence - flexible layouts must be used instead of fixed pixel-by-pixel positioning of controls.Ī markup language for describing layouts, touch screen support, 3D rendering, customizable look-and-feel, easy event handling, and several other items complete the list.Hardware acceleration - take advantage of DirectX or OpenGL where available, but it should be possible to use software rendering where they aren’t.Internationalization - it should be easy to write multilingual apps.Cross-platform - the same code should work on all platforms with simple recompilation.He has a long list of items he thinks are important for a GUI library to check off. He had already written a cross-platform GUI in C++ for CoolReader GL, a version of his ebook reader that uses the same GUI on all supported platforms. While there were several options to choose from, he wasn’t satisfied by the fact that they were all either non-native wrappers or not cross-platform. The new idea came about as he surveyed the state of available GUI libraries in D. Now they are largely abandoned, but he has since found another area where he could apply his talents and, as it turns out, where community interest has been much higher. HibernateD is an ORM library, similar to the Java-based Hibernate. Unlike Java, D allows the use of compile-time code introspection and code generation. It was interesting work, and I was impressed by the power of D.īoth projects proved to be no more than learning exercises, however, as he never used either himself and neither became popular in the community. So, three years ago, he decided to initiate a couple of projects to learn its features.ĭDBC is a database connector similar to Java’s JDBC, with an API close to the original. He kept hearing news about D and, over time, became more interested in its “cool features”, like CTFE and code generation. My biggest hobby project, which I’ve rewritten from scratch twice in the last 15 years, is CoolReader, a cross platform e-book reader written in C++. I’ve also worked as a C++ developer on IP PBX devices. Programming is my hobby as well. My current job is writing a Java backend for a virtual call center. Vadim Lopatin is an active D user who, like many in the D community, comes from a Java and C++ background.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |