{"id":17113063,"url":"https://github.com/emmt/xlib.jl","last_synced_at":"2025-04-09T20:33:47.844Z","repository":{"id":71510266,"uuid":"97767430","full_name":"emmt/Xlib.jl","owner":"emmt","description":"Julia wrapper to use X11 library","archived":false,"fork":false,"pushed_at":"2017-07-21T07:32:17.000Z","size":127,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T22:34:55.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-19T22:44:01.000Z","updated_at":"2023-10-14T11:44:52.000Z","dependencies_parsed_at":"2023-05-22T01:45:41.052Z","dependency_job_id":null,"html_url":"https://github.com/emmt/Xlib.jl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FXlib.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FXlib.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FXlib.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FXlib.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/Xlib.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107875,"owners_count":21049025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T17:02:43.229Z","updated_at":"2025-04-09T20:33:47.833Z","avatar_url":"https://github.com/emmt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Julia interface to the X11 library\n\n**Xlib.jl** is a [Julia](http://julialang.org/) package which aims at providing\nan interface to the [X11 library](https://en.wikipedia.org/wiki/Xlib) (as a\nclient).  The objective is to provide a low-level but complete interface.  A\nhigher level interface could be build on top of this low-level version.\n\n\n## Status\n\nAll constants, all structures and almost all functions (398 out of 411) are\ncovered.  The missing fcuntions are the ones returning functions\n(`XSynchronize` and `XSetAfterFunction`) and the ones with a variable number of\narguments (*e.g.* `XSetOMValues`).  However rather strict rules have been\napplied to determine the Julia types of the input arguments of the methods\nmaking them sometimes difficult to use.  An easy (lazzy?) solution would be to\nnot specify the types of the arguments in the Julia wrappers and let `ccall` do\nthe job.  For the moment, I have decided to try to specify the types of the\narguments as far as possible while keeping the functions usable.\n\nExamples:\n\n* C-API expect a `char*` which can be a buffer or really a name.  In the former\n  case Julia type should be `Ptr{Cchar}` and the corresponding argument can be\n  an array of bytes.  In the latter case, Julia type should be `Cstring` and\n  the corresponding argument can be `C_NULL` or a Julia string; to benefit\n  from this flexibility it is better to not specify the argument type in the\n  method signature.\n\n\n## Installation\n\nIn the future, the building process will be automated and standardized but for\nnow, you have to clone the repository, go to the `deps` directory and type:\n\n    make\n\nalso make sure that the constant `_XLIB` in `src/Xlib.jl` is correctly set.\n\n\n## Example\n\nTo whet your appetite, here is a short example (inspired by a\n[tutorial by Philipp K. Janert](http://www.linuxjournal.com/article/4879)):\n\n```julia\nusing Xlib\n\nfunction test1()\n\n    dpy = XOpenDisplay(C_NULL)\n    dpy == C_NULL \u0026\u0026 return 1\n    scr = DefaultScreen(dpy)\n    white = WhitePixel(dpy, scr)\n    black = BlackPixel(dpy, scr)\n\n    win = XCreateSimpleWindow(dpy,\n                              DefaultRootWindow(dpy),\n                              50, 50,   # origin\n                              200, 200, # size\n                              0, black, # border\n                              white )   # background\n    XMapWindow(dpy, win)\n\n    evt = Ref(XEvent())\n    eventMask = StructureNotifyMask\n    XSelectInput(dpy, win, eventMask)\n    while true\n        XNextEvent(dpy, evt) # calls XFlush\n        EventType(evt) == MapNotify \u0026\u0026 break\n    end\n\n    gc = XCreateGC(dpy, win, 0, C_NULL)\n    XSetForeground(dpy, gc, black)\n    XDrawLine(dpy, win, gc, 10, 10,190,190) # from-to\n    XDrawLine(dpy, win, gc, 10,190,190, 10) # from-to\n\n    eventMask = ButtonPressMask|ButtonReleaseMask\n    XSelectInput(dpy, win, eventMask) # override previous settings\n    while true\n        XNextEvent(dpy, evt) # calls XFlush\n        EventType(evt) == ButtonRelease \u0026\u0026 break\n    end\n\n    XDestroyWindow(dpy, win)\n    XCloseDisplay(dpy)\n    return 0\nend\n```\n\n\n# Notes for Contributors\n\nWhenever you add new symbols to be exported, update the file `src/exports.jl`\naccordingly.  This can be automated by:\n\n```julia\nusing Xlib\nXlib.generateexports(\"src/exports.jl\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fxlib.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Fxlib.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fxlib.jl/lists"}