Giter Site home page Giter Site logo

wxrust2's Introduction

wxRust2

This is my 2nd exploration of binding the wxWidgets cross-platform toolkit.

This project is in the very-early stage of the development. I'm playing with this in my very limited spare time. So don't expect this project will be usable (or useful) state in the near future.

Goals (not to resurrect the predecessor for):

  • Smaller footprint by supporting the wx's multilib configuration (in code size), and avoiding Box-ing everything (in calling overhead).
    • I'm not convinced forcing generic programming rather than trait object flexibility, but gtk-rs looks like usable with this choice AFAIK
  • Simpler integration with the Rust ecosystem by utilizing the cc crate rather than CMake and of course, the Cargo.
  • Easier to support new APIs by depending wx directly and generating both Rust and C(++) parts of the binding from the single richer metadata (Doxygen XML output, yes, the proven way by the wxPython Phoenix project).

Current status

Implementing the binding generator to be usable state with a small set of wx classes.

  • Working on
    • kenz-gelsoft#61 Core library coverage
      • generate for all classes in core library
  • Next
    • Other libraries
      • after that, more libraries would be generated
  • Done
    • Investigating modern binding approaches
      • rust-bindgen's C++ support: expected to be the easiest way to binding exising C++ APIs, but it doesn't support some edge cases. especially methods inlined and absent in binary.
      • autocxx: this is for newly(specially) designed API. it supports limited but sane subset of the C++ construct. not suitable for binding an existing API (when I investigated).
      • cxx.rs: this is also for newly designed API, but it allows calling C++ methods handy by generating only the rust API definition and ctor manually.
    • Prototyping handy-binding with cxx.rs
      • minimal effort to generate first some methods bindings, it looks promising then. small part of the API could be generated with this approach.
      • but found I need some hacks and codegen in C++ header/source code to work around cxx.rs limitations to support wider range of API.
    • Codegen without cxx.rs (or rust-bindgen)
    • Lifetime management
      • owned non-wxWindow wxObjects has value semantics (impl Drop to call native dtor)
      • kenz-gelsoft#51 planning to use wxTrackable for WeakRef-like wx managed (non-owned) object
      • doesn't manage wxWindow object for now (almost all of them will be managed by wx's windowing system)
    • Small set of API working
      • compiles and bare simple example runs on macOS, Linux
      • working to compile on Window (fighting with linking error)

License

MIT License. but you can (and shoudld) treat this library as wxWindows Library Licence (same with required wxWidgets library dependency).

Large part of this project is the binding generator in Python (doxybindgen). This part may be usable and want to be used for another traditional C++ APIs with Doxygen documented (c.f. like Haiku OS APIs(Kits)) in future. So permissive license is desirable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.