{"id":13408950,"url":"https://github.com/annexi-strayline/Curses","last_synced_at":"2025-03-14T14:30:21.802Z","repository":{"id":215182598,"uuid":"161529636","full_name":"annexi-strayline/Curses","owner":"annexi-strayline","description":"Advanced UNIX Terminal UI Ada Binding Package","archived":false,"fork":false,"pushed_at":"2020-05-01T17:25:23.000Z","size":574,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T20:32:20.432Z","etag":null,"topics":["curses","curses-library","tui"],"latest_commit_sha":null,"homepage":null,"language":"Ada","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annexi-strayline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-12T18:36:43.000Z","updated_at":"2024-04-22T01:24:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f22a28e-d89c-42a6-bf65-fdac2994e7bf","html_url":"https://github.com/annexi-strayline/Curses","commit_stats":null,"previous_names":["annexi-strayline/curses"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexi-strayline%2FCurses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexi-strayline%2FCurses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexi-strayline%2FCurses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexi-strayline%2FCurses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annexi-strayline","download_url":"https://codeload.github.com/annexi-strayline/Curses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243593145,"owners_count":20316140,"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":["curses","curses-library","tui"],"created_at":"2024-07-30T20:00:56.827Z","updated_at":"2025-03-14T14:30:21.204Z","avatar_url":"https://github.com/annexi-strayline.png","language":"Ada","funding_links":[],"categories":["Frameworks"],"sub_categories":["Terminal User Interface"],"readme":"# Introduction\n\nThe Curses library provides a very high-level **thick** binding for the common \"ncurses\" terminal control library common on most *nixes.\n\nThe library has the following key features:\n* **Fully task-safe**, and allows for concurrent interface driving\n* Full color support for xterm and xterm-256color, including palette changing ability (though this rarely supported by terminal emulators in the wild)\n* Non signal-based, synchronous dynamic terminal resizing support with hooks\n* Designed to drive multiple terminals simultaneously\n  * Includes a unified color space shared amongst all terminals\n  * Supports cross-terminal Surface (window, pad) transcription\n* Abstracted \"Surface\" type represents traditional curses Windows, with fully automatic re-rendering on update, including visibility computation (automatic layering).\n* The Curses package does not use allocators anywhere (however the (n)curses library itself likely does use allocations from the heap). All objects are stack allocated, unless explicitly created with a user-defined allocator.\n\n# State of Release\nThis package is currently in **pre-release alpha** and is still very much under development. \n\nCore functionality (Surface primitives) is complete and working. Work on higher-level UI abstractions is underway.\n\n**The interface is subject to breaking changes until further notice**\n\n## Open issues\n* Gnome terminal can't handle Set_Background with a Colored_Cursor. Artifacts appear during refresh. Almost all other tested terminals work fine (xterm, uxrvt, konsole).\n\n## Work queue\n- [ ] Higher-level UI abstractions\n- [ ] \"Dialog boxes\", Menus, Forms, etc.\n- [ ] Expanded documentation\n- [ ] Examples\n\n# Building and using\nThis library is presented as a gpr \"library project\" - libnadacurses.gpr.\n\nThe library can be built directly with grpbuild, or included within another project file.\n\nThe library project has two primary configuration properties \\(set with -XProperty=..\\), as follows:\n\n1. HOST_OS\n\n   * FreeBSD\n   * Solaris\n   * Linux\n     Linux should have a distribution set if relevent, which shall be one of the following:\n     * Ubuntu \\(Default\\)\n\n2. WIDE_SUPPORT\n\n   * NO \\(Default\\)\n     No wide character (unicode) support. This links with the regular ncurses library.\n\n   * YES\n     Includes full wide character support. This requires the ncursesw library. When using this option, ensure the terminal supports wide character or UTF-8 encoding, and that \"locale\" for the terminal is set appropriately (eg. en_US.UTF-8).\n\n# Alpha test-drive\n\n* Refer to the extensive comments in the Curses package to understand basic Surface operations\n* Refer to the Curses.Terminals for the Terminal type and comments for setting up a Terminal\n* Refer to Curses.Terminals.Surfaces.Standard (Curses.Standard) for the basic Screen and Window primitive Surfaces\n* Refer to Curses.Terminals.Color for enabling Color options (especially via the Colored_Cursor type)\n\nHere is a basic example program which places a filled window in the centre of the screen, and prints \"Hello World!\" with centered justification.\n\n```\nwith Curses;           use Curses;\nwith Curses.Terminals; use Curses.Terminals;\nwith Curses.Standard;  use Curses.Standard;\n\nwith Curses.Terminals.Surfaces;\nwith Curses.Device.Environment;\n\nprocedure Example is\n   TTY: aliased Terminal (Curses.Device.Environment.Environment_Terminal);\n   subtype Control_Character is Curses.Terminals.Surfaces.Control_Character;\nbegin\n   TTY.Attach;\n\n   declare\n      Main_Screen: Screen       := New_Screen (TTY);\n      My_Window  : Window'Class := Main_Screen.New_Window \n        (Proposed_Extents =\u003e (Row =\u003e 4, Column =\u003e 40));\n      \n      Input_Char: Control_Character;\n      -- This will be centered on the screen, of size 4x40\n      \n      Fill_Cursor: Cursor := (Style    =\u003e (Inverted =\u003e True, others =\u003e \u003c\u003e),\n                              others   =\u003e \u003c\u003e);\n   begin\n      \n      My_Window.Set_Background (Fill_Cursor =\u003e Fill_Cursor);\n      \n      My_Window.Position_Cursor ( (Row    =\u003e 2,\n                                   Column =\u003e (My_Window.Extents.Column / 2)) );\n      \n      My_Window.Put (Content        =\u003e \"Type 'x' to exit.\",\n                     Justify        =\u003e Center,\n                     Advance_Cursor =\u003e True);\n      \n      \n      My_Window.Position_Cursor ( (Row =\u003e 3, Column =\u003e 2) );\n      My_Window.Put (Content =\u003e \"\u003e\",\n                     Advance_Cursor =\u003e True);\n      \n      My_Window.Show;\n      -- New windows are hidden by default\n      \n      loop\n         Input_Char := My_Window.Input_Key;\n         exit when Input_Char.Class = Graphic\n           and then Input_Char.Key = 'x';\n         \n         if Input_Char.Class = Graphic \n           and then My_Window.Current_Cursor.Position \u003c My_Window.Extents \n         then\n            My_Window.Put (Content        =\u003e String'(1..1 =\u003e Input_Char.Key),\n                           Advance_Cursor =\u003e True);\n         end if;\n      end loop;\n      \n      -- That's it, the Curses package will automatically shut everything down\n      -- for you!\n   end; \nend Example;\n```\n\nThis example code can be found in the root directory under Tests/example.adb. A gprbuild project file can be found in the root directory as example.gpr\n\nCompile as follows (gnat must be installed):\n```\n$ gprbuild -p -P example.adb -XHOST_OS=[Your host OS]\n```\n\nHOST_OS Must be set to one of the three currently supported OS types:\n1. \"Linux\"\n2. \"FreeBSD\"\n3. \"Solaris\"\n\n\nThis binding has been tested to work as is on\n- FreeBSD\n- Linux\n- Solaris (illumos)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannexi-strayline%2FCurses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannexi-strayline%2FCurses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannexi-strayline%2FCurses/lists"}