{"id":20381732,"url":"https://github.com/jacob-c-smith/ui","last_synced_at":"2026-05-04T22:41:17.029Z","repository":{"id":149625252,"uuid":"445321449","full_name":"Jacob-C-Smith/ui","owner":"Jacob-C-Smith","description":"Callback driven user interface library written with SDL2","archived":false,"fork":false,"pushed_at":"2024-09-22T22:17:06.000Z","size":1997,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-07T14:06:17.705Z","etag":null,"topics":["api","c","gui","json","open-source","system-programming","ui"],"latest_commit_sha":null,"homepage":"https://g10.app/status/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jacob-C-Smith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-06T21:55:43.000Z","updated_at":"2023-07-03T05:21:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"addb4dd6-6dd9-4320-b208-750353cc244b","html_url":"https://github.com/Jacob-C-Smith/ui","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Jacob-C-Smith/ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jacob-C-Smith","download_url":"https://codeload.github.com/Jacob-C-Smith/ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jacob-C-Smith%2Fui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32628211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","c","gui","json","open-source","system-programming","ui"],"created_at":"2024-11-15T02:15:11.060Z","updated_at":"2026-05-04T22:41:17.014Z","avatar_url":"https://github.com/Jacob-C-Smith.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UI\n##### **This project is still incomplete. This notice will be removed when the project is polished to my liking**\n![UI window example](Window.png)\n\nThis simple callback driven UI library implements many UI elements, like labels, buttons, and dropdowns to name a few. UI element colors are customizable, and the user configurations are stored nontemporally in AppData. Windows and UI elements are constructed at run time from JSON files.\n\n## Window JSON\nHere's the source for the above window:\n\n```json\n{\n    \"name\"     : \"Test window\",\n    \"width\"    : 800,\n    \"height\"   : 720,\n    \"elements\" : [\n        {\n            \"type\"     : \"LABEL\",\n            \"name\"     : \"label\",\n            \"text\"     : \"Label\", \n            \"x\"        : 16,\n            \"y\"        : 16,\n            \"size\"     : 1\n        },\n        {\n            \"type\"      : \"CHECKBOX\",\n            \"name\"      : \"checkbox\",\n            \"x\"         : 16,\n            \"y\"         : 32,\n            \"labels\"    : [\n                \"Checkbox 1\",\n                \"Checkbox 2\",\n                \"Checkbox 3\"\n            ],\n            \"checked\" : [\n                false,\n                false,\n                false\n            ]\n        },\n        {\n            \"type\"  : \"BUTTON\",\n            \"name\"  : \"button\",\n            \"label\" : \"Button\",\n            \"x\"     : 16,\n            \"y\"     : 96\n        },\n        {\n            \"type\"      : \"DROPDOWN\",\n            \"name\"      : \"dropdown\",\n            \"x\"         : 16,\n            \"y\"         : 80,\n            \"options\"   : [\n                \"Option 1\",\n                \"Option 2\",\n                \"Option 3\"\n            ],\n            \"index\"     : -1,\n            \"collapsed\" : true\n        },\n        {\n            \"type\"      : \"RADIO BUTTON\",\n            \"name\"      : \"radiobutton\",\n            \"x\"         : 16,\n            \"y\"         : 112,\n            \"labels\"    : [\n                \"Radio button 1\",\n                \"Radio button 2\",\n                \"Radio button 3\"\n            ],\n            \"index\" : 0\n        },\n        {\n            \"type\"     : \"LABEL\",\n            \"name\"     : \"label 2\",\n            \"text\"     : \"An Image:\", \n            \"x\"        : 16,\n            \"y\"        : 180,\n            \"size\"     : 1\n        },\n        {\n            \"type\"      : \"IMAGE\",\n            \"name\"      : \"image\",\n            \"x\"         : 16,\n            \"y\"         : 192,\n            \"width\"     : 768,\n            \"height\"    : 512,\n            \"path\"      : \"image.png\"\n        },\n        {\n            \"type\"        : \"TEXT INPUT\",\n            \"name\"        : \"text input\",\n            \"x\"           : 16,\n            \"y\"           : 160,\n            \"width\"       : 80,\n            \"height\"      : 14,\n            \"placeholder\" : \"Text Input\",\n            \"length\"      : 255\n        },\n        {\n            \"type\"     : \"LABEL\",\n            \"name\"     : \"label 3\",\n            \"text\"     : \"A Table:\", \n            \"x\"        : 160,\n            \"y\"        : 16,\n            \"size\"     : 1\n        },\n        {\n            \"type\"        : \"TABLE\",\n            \"name\"        : \"element table\",\n            \"x\"           : 160,\n            \"y\"           : 32,\n            \"max rows\"    : 5,\n            \"max columns\" : 3\n        }\n    ]\n}\n```\n[ [UI Window JSON](window.json) ]\n\n## A minimal program written with the UI library\n```c\n#include \u003cui/ui.h\u003e\n\nint main ( int argc, const char **argv )\n{\n    // Initialized data\n    ui_instance *p_ui_instance = 0;\n    ui_window   *p_ui_window   = 0;\n\n    // Initialize the UI library\n    ui_init(\u0026p_ui_instance, \"\");\n\n    // Load a window from the filesystem\n    load_window(\u0026p_ui_window, \"window.json\");\n\n    // Add the window to the instance\n    ui_append_window(p_ui_instance, p_ui_window);\n\n    // Start running\n    p_ui_instance-\u003erunning = true;\n\n    // Loop\n    while (p_ui_instance-\u003erunning)\n    {\n        \n        // Process input\n        ui_process_input(p_ui_instance);\n\n        // Draw windows\n        ui_draw(p_ui_instance);\n    }\n\n    // Exit the UI library\n    ui_exit(p_ui_instance);\n\n    return 1;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-c-smith%2Fui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacob-c-smith%2Fui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-c-smith%2Fui/lists"}