{"action":"created","issue":{"url":"https://api.github.com/repos/erlepereira/x11-rs/issues/84","repository_url":"https://api.github.com/repos/erlepereira/x11-rs","labels_url":"https://api.github.com/repos/erlepereira/x11-rs/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/erlepereira/x11-rs/issues/84/comments","events_url":"https://api.github.com/repos/erlepereira/x11-rs/issues/84/events","html_url":"https://github.com/erlepereira/x11-rs/issues/84","id":331676864,"node_id":"MDU6SXNzdWUzMzE2NzY4NjQ=","number":84,"title":"Consolidate types and constants","user":{"login":"Daggerbot","id":878054,"node_id":"MDQ6VXNlcjg3ODA1NA==","avatar_url":"https://avatars0.githubusercontent.com/u/878054?v=4","gravatar_id":"","url":"https://api.github.com/users/Daggerbot","html_url":"https://github.com/Daggerbot","followers_url":"https://api.github.com/users/Daggerbot/followers","following_url":"https://api.github.com/users/Daggerbot/following{/other_user}","gists_url":"https://api.github.com/users/Daggerbot/gists{/gist_id}","starred_url":"https://api.github.com/users/Daggerbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daggerbot/subscriptions","organizations_url":"https://api.github.com/users/Daggerbot/orgs","repos_url":"https://api.github.com/users/Daggerbot/repos","events_url":"https://api.github.com/users/Daggerbot/events{/privacy}","received_events_url":"https://api.github.com/users/Daggerbot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-12T17:11:00Z","updated_at":"2018-08-04T20:33:26Z","closed_at":null,"author_association":"COLLABORATOR","body":"I have a few issues with the way these crates are structured.\r\n\r\n(1) `x11` and `x11-dl` both expose their own copies of all native types and constants. This is currently done using symlinks to the source files, but it would be much nicer to just include the types in one crate (`x11`) and have others (`x11-dl`) depend on this crate for its types and constants (but of course without the need to statically link any C libraries to use these types). If backwards compatibility is desired, these types and constants can be `pub use`d into `x11-dl`, but I don't think this is the best thing to do. This and the next problem would likely entail a version bump to 3.0.0...\r\n\r\n(2) Everything currently lies within public submodules within the main crate(s). For example, one of the most commonly used types is `x11::xlib::Display`/`x11_dl::xlib::Display`. In addition to moving types into one crate, I believe these should be exposed to the root of the crate (i.e. `x11::Display`). They're currently lumped into modules somewhat arbitrarily, based only on what X library they *seem* to be most relevant to. If we move everything into the crate root, it will (a) be easier to find and reference these types and (b) be easier to transition to bindings generated from the C headers if desired."},"comment":{"url":"https://api.github.com/repos/erlepereira/x11-rs/issues/comments/410475886","html_url":"https://github.com/erlepereira/x11-rs/issues/84#issuecomment-410475886","issue_url":"https://api.github.com/repos/erlepereira/x11-rs/issues/84","id":410475886,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDQ3NTg4Ng==","user":{"login":"Daggerbot","id":878054,"node_id":"MDQ6VXNlcjg3ODA1NA==","avatar_url":"https://avatars0.githubusercontent.com/u/878054?v=4","gravatar_id":"","url":"https://api.github.com/users/Daggerbot","html_url":"https://github.com/Daggerbot","followers_url":"https://api.github.com/users/Daggerbot/followers","following_url":"https://api.github.com/users/Daggerbot/following{/other_user}","gists_url":"https://api.github.com/users/Daggerbot/gists{/gist_id}","starred_url":"https://api.github.com/users/Daggerbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daggerbot/subscriptions","organizations_url":"https://api.github.com/users/Daggerbot/orgs","repos_url":"https://api.github.com/users/Daggerbot/repos","events_url":"https://api.github.com/users/Daggerbot/events{/privacy}","received_events_url":"https://api.github.com/users/Daggerbot/received_events","type":"User","site_admin":false},"created_at":"2018-08-04T20:33:26Z","updated_at":"2018-08-04T20:33:26Z","author_association":"COLLABORATOR","body":"Now that #90 has occurred, I'll be putting more thought into this and #87. The existing types and constants can remain mostly unchanged. The `x11_link!` macro made sense at the time, but I'm thinking now that `gl_generator` has a nicer solution to generating bindings. There is no XML spec for the X11 library functions AFAIK, but they can still be loaded either from a `serde` format like JSON or, even better, an easily parsable, minimal subset of C function declarations. Examples.\r\n\r\n```\r\n// xlib.json\r\n{\r\n    functions: [\r\n        { name: \"XOpenDisplay\", return_type: \"*mut Display\", params: [\"*const c_char\"] }\r\n    ]\r\n}\r\n```\r\n\r\nor\r\n\r\n```\r\n// xlib.cdecls\r\nDisplay *XOpenDisplay (const char *);\r\n```"}}
{"actor":{"display_login":"Daggerbot"}}