{"id":13532230,"url":"https://github.com/BusyStudent/Btk","last_synced_at":"2025-04-01T20:31:40.383Z","repository":{"id":42050324,"uuid":"300274099","full_name":"BusyStudent/Btk","owner":"BusyStudent","description":"A library for developing Gui based on SDL2","archived":true,"fork":false,"pushed_at":"2022-06-16T08:39:33.000Z","size":6188,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-02T19:34:02.867Z","etag":null,"topics":["btk","cpp17","generic","gui-toolkit","sdl2","simple"],"latest_commit_sha":null,"homepage":"https://btk-project.github.io/","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/BusyStudent.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}},"created_at":"2020-10-01T12:38:11.000Z","updated_at":"2023-10-11T14:52:39.000Z","dependencies_parsed_at":"2022-08-12T03:30:21.351Z","dependency_job_id":null,"html_url":"https://github.com/BusyStudent/Btk","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/BusyStudent%2FBtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyStudent%2FBtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyStudent%2FBtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BusyStudent%2FBtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BusyStudent","download_url":"https://codeload.github.com/BusyStudent/Btk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709923,"owners_count":20821297,"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":["btk","cpp17","generic","gui-toolkit","sdl2","simple"],"created_at":"2024-08-01T07:01:09.270Z","updated_at":"2025-04-01T20:31:35.371Z","avatar_url":"https://github.com/BusyStudent.png","language":"C","funding_links":[],"categories":["Projects"],"sub_categories":[],"readme":"# Btk\n\n![Logo](./logo/logo.svg)\n\nBtk is a C++ tiny retained mode GUI library based on SDL2 and nanovg.  \n\nIt was written in morden C++,so it was very easy to use.  \n\n***Still developing***  \n\n## CI\n\n|Platform| CI Status|\n| ---    | ---      |\n|Linux   |![C/C++ CI on Linux](https://github.com/BusyStudent/Btk/workflows/C/C++%20CI%20on%20Linux/badge.svg)|\n|Windows |[![C/C++ CI on Windows](https://github.com/BusyStudent/Btk/actions/workflows/windows.yml/badge.svg)](https://github.com/BusyStudent/Btk/actions/workflows/windows.yml)|\n\n----\n\n## Tiny example  \n\nJust create a window and add widget on here\n\n```cpp\n//Include all headers\n#include \u003cBtk.hpp\u003e\n\nusing Btk::Library;\nusing Btk::Window;\nusing Btk::Button;\n\nstruct App:public Window{\n    App():Window(\"Hello World\",100,100){\n        //Add a button and connect signal\n        auto \u0026btn = add\u003cButton\u003e(\"Close the window\");\n        //Or\n        // auto *btn = new Button(\"Close the window\");\n        // add(btn);\n        \n        // Set the button's position and size\n        btn.set_rect(0,0,100,100);\n\n        //You can connect to a limbda\n        // btn.signal_clicked().connect([this](){\n        //     close();\n        // });\n        //Or connect to a member fucnction\n        btn.signal_clicked().connect(\n            \u0026App::close,\n            this\n        );\n        //when the object was destroyed,\n        //The connection will be disconnected automatically\n    }\n};\nint main(){\n    Library lib;//\u003c For initialize / Quit \n    //Or call Init() and Quit() explicitly\n    App app;\n    app.mainloop();\n}\n```\n\n----\n\n## Features\n\n- Almost no macro,the signal system was written in template\n- The Library will use the font in os\n- UTF-8 support\n\n----\n\n## TODO List  \n\n- [ ] Add more useful widgets  \n- [ ] MessageLoop need to be refactored  \n- [ ] Rewrite ImageView By OpenGL to implement AntiAlias\n- [ ] Add CMake\n- [ ] Add GLX and WGL OpenGL Adapter\n- [ ] Add API to get system color and system metrics\n- [ ] Widget Interface need to be refactored\n- [ ] String Interface need to be refactored to fit STL  \n- [ ] Font need to be refactored,Current font backend is not good enough(need hb support)\n- [ ] Renderer backend DPI support\n\n----\n\n## Widgets List\n\n|  Widgets  |  Done?  | TODO | Description |\n|  ---      |  ---    | ---  | ---         |\n|  Button   |         |      |             |\n|  RadioButton   |         |      |             |\n|  CheckButton   |         |      |             |\n|  ImageView|         |      |             |\n|  TextBox  |         |Refactoring|             |\n|  ProgressBar  |         |      |             |\n|  EmbedWindow  | No      |      |             |\n|  ScrollBar|        |      |             |\n|  SilderBar|        |      |             |\n|  Canvas   |         |      |             |\n|  GLCanvas |         |      |             |\n|  GLWidget | No      |      |             |\n|  Label    |         |      |             |\n|  Line     |         |      |             |\n|  Layout   |         |      |             |\n|  BoxLayout|         |      |             |\n|  StackedWidget|     |      |             |  \n\n----\n\n## Renderer Backend\n\n| Backend    | Done? | Description  |\n| ---        | ---   | ---          |\n| Vulkan     | No    |              |\n| Software   |       | Has many bugs|\n| OpenGLESv3 |       |              |\n| Direct3D11 |       |              |\n| SDLRender  | No    |              |\n\n----\n\n## Building prerequisites\n\n### Linux\n\n- G++ with C++17 support  \n- SDL2  \n- SDL2-image (optional)  \n- fontconfig (optional,for select font)  \n- libgif (optional,for display gif)\n- freetype2  (optional)  \n- scons or xmake\n\n### Windows\n\n- MINGW or vs2017  \n- SDL2  \n- SDL2-image (optional)  \n- freetype2  (optional)  \n- libgif (optional)  \n- scons or xmake\n\n### Android\n\n- Still developing\n\n----\n\n## Build\n\n```console\nbtk@btk:sudo apt install libsdl2-dev\nbtk@btk:scons\n```\n\nor\n\n```console\nxmake\n```\n\n## ThirdParty\n\n[SDL2](https://www.libsdl.org/) - For Event Handling  \n[SDL_image (optional)](https://www.libsdl.org/) - Load image  \n[stb (optional)](https://github.com/nothings/stb) - Load image,render font,textbox edit etc...  \n[nanovg](https://github.com/memononen/nanovg) - Render UI\n\netc...\n\n## License\n\nMIT\n\n## Some md for dev\n\n[Folder strucutre](./src/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBusyStudent%2FBtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBusyStudent%2FBtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBusyStudent%2FBtk/lists"}