Git Product home page Git Product logo

imvue's People

Contributors

unix4ever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

imvue's Issues

CSS styles support

Parsing CSS is a first step.
Then need to implement actual cascade style selector.
Preferably this should be implemented using ImGui coding style.

For example:

// read css from memory/file
ImU32 styleID = ImVue::LoadStyle(data);
...
ImVue::PushStyle(styleID);
// render styleable button
ImVue::Button("label", "btn btn-toggle", "id");
ImVue::PopStyle();

Inside ImVue::Button:

IMVUE_API Button(const char* label, const char* classes, const char* id) {
...
    Context& ctx = GetContext();
    // this style selector should be really fast
    // probably it's possible to hash all these strings and cache this view
    Style* s = ctx.selectStyle("button", classes, id);
    
    if(s) {
        // should have some common code that can render any kind of shapes
        if(s.fontFamily) {
           // style parser should load this font
           ImGui::PushFont(s.fontFamily);
           // https://github.com/ocornut/imgui/issues/1018 can use the following approach to scale the font
           ImGui::TextUnformatted(label);
           ImGui::PopFont();
        }
    } else {
        return ImGui::Button(label);
    }

Can probably utilise window key value storage to generate and save hashes for elements.

Support sync directive

Handle field change in C++, propagate to script system if there is handler bind for the property.

V8 integration

V8 integration itself shouldn't be really complicated.
But it would make sense to actually make this library behave as an actual web browser (with limited functional). Therefore it would be required to support low level JS functions that are provided by browsers, like: getElementById, appendChild, events, and others.

But this task scope can be limited to adding same set of features Lua has but in Javascript.

Support Most used HTML elements

Implement custom elements for all most common tags:

  • <a>
  • <b>
  • <body>
  • <br> -- make simple alias to <new-line>.
  • <button> -- override imgui button tag.
  • <canvas> -- should expose imgui drawlist to script.
  • <datalist>
  • <div>
  • <footer>
  • <form> -- can be implemented using custom component (?).
  • <h1> to <h6>
  • <head>
  • <header>
  • <html>
  • <i>
  • <img> -- should unite ImGui::Image and ImVue:SvgImage.
  • <input> -- override input to make it support various kind of operation mode.
  • <li>
  • <option>
  • <p>
  • <s>
  • <script> -- run script in the body? Why not.
  • <select>
  • <span> -- make span default element. Can fall back to rendering span if can't resolve child tag in html node.
  • <style>
  • <svg> -- inline svg.
  • <table>
  • <tbody>
  • <td>
  • <tr>
  • <textarea>
  • <tfoot>
  • <thead>
  • <th>

Initial version

Create initial library version with the list of core features, like parsing xml, scripting support, reactive updates and others.

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.