Git Product home page Git Product logo

Comments (7)

 avatar commented on August 29, 2024

@tomaka

from x11-rs.

tomaka avatar tomaka commented on August 29, 2024

For plan A you should keep in mind that some systems don't have X11, so that should be detectable.

from x11-rs.

 avatar commented on August 29, 2024

There would be functions to check the availability of libraries and functions, so you can avoid calling missing functions and causing a panic. Probably something like:

pub enum Lib {
    Xlib,
    Glx,
    ...
}

pub fn check_lib (lib: Lib) -> bool { ... }
pub fn check_fn (lib: Lib, fname: &str) -> bool { ... }
pub fn check_fns (lib: Lib, fnames: &[&str]) -> bool { ... }

One of the current problems is that Ubuntu LTS 14.04 has an older version of Xrandr which is missing 5 of the functions defined in x11::xrandr::Xrandr, so we added a separate struct (x11::xrandr::Xrandr_2_2_0) which omits these functions. Both plans described above will have better ways to avoid this problem.

from x11-rs.

bennofs avatar bennofs commented on August 29, 2024

I'm wondering if perhaps x11-dl could also be made just a feature of the main x11 crate? It mostly uses the same code anyway, and this way the code sharing could be better IMO. Of course this would be a breaking change, that's why I'm adding this comment to the version 3 thread.

from x11-rs.

 avatar commented on August 29, 2024

My current plan is to define all types in x11 and pub use them into x11-dl when version 3.0 comes around. I think this may even be possible before 3.0 without breaking anything.

from x11-rs.

eazar001 avatar eazar001 commented on August 29, 2024

A suggestion for version 3:
Include some more bindings for xfixes extension if possible.

from x11-rs.

 avatar commented on August 29, 2024

Like winapi-rs bindings are currently being added by hand, which is why things are missing. If xfixes bindings are needed, I'll see if I have some time to add them. Unfortunately, version 3 may have to wait for untagged unions, or else a version 4 would follow shortly after.

from x11-rs.

Related Issues (20)

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.