{"id":15047298,"url":"https://github.com/oktonion/phwidgets-lib","last_synced_at":"2025-04-10T00:50:53.988Z","repository":{"id":41063319,"uuid":"88276189","full_name":"oktonion/PhWidgets-lib","owner":"oktonion","description":"lightweight fast C++ interface library for QNX Photon microGUI","archived":false,"fork":false,"pushed_at":"2025-01-05T00:03:08.000Z","size":27692,"stargazers_count":6,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:50:52.052Z","etag":null,"topics":["application","builder","cpp","cpp98","gui","library","micro","microgui","photon","photon-widget","phwidgets-lib","qnx","qnx-photon-gui","qnx6","widgets"],"latest_commit_sha":null,"homepage":"","language":"C++","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/oktonion.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}},"created_at":"2017-04-14T14:51:08.000Z","updated_at":"2024-06-23T18:22:26.000Z","dependencies_parsed_at":"2022-07-14T07:10:33.138Z","dependency_job_id":null,"html_url":"https://github.com/oktonion/PhWidgets-lib","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktonion%2FPhWidgets-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktonion%2FPhWidgets-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktonion%2FPhWidgets-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oktonion%2FPhWidgets-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oktonion","download_url":"https://codeload.github.com/oktonion/PhWidgets-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137999,"owners_count":21053775,"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":["application","builder","cpp","cpp98","gui","library","micro","microgui","photon","photon-widget","phwidgets-lib","qnx","qnx-photon-gui","qnx6","widgets"],"created_at":"2024-09-24T20:56:13.062Z","updated_at":"2025-04-10T00:50:53.959Z","avatar_url":"https://github.com/oktonion.png","language":"C++","readme":"# PhWidgets-lib\n\n### lightweight fast C++ interface library for QNX Photon microGUI\n\nPhWidgets is an Object-Oriented C++ library interface for the QNX 6 Photon Application Builder Widgets. Full support of PhAB for QNX 6.5 .\n\nAll classes of the library provide simple and convenient access to 'resources' of corresponding Photon Widgets as 'properties' with minimum or no overhead. \n\nAlso library implements easy raw access to 'resources' of Photon Widget and the Widget itself, its callbacks, etc as well. The classes of the library itself are lightweight proxies for standart C-functions of Photon Library (like PtSetResource, PtGetResource, ...). Use of the hierarchy of classes constructs userfriendly interface with less ways for \"shooting yourself in the foot\".\n\n\n### Implemented widgets ###\n\n ![Hierarchy](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_widget.png)\n\n\n* [Widget](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_widget.html)\n* [Basic](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_basic.html)\n* [Timer](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_timer.html)\n* [Container](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_container.html)\n* [Graphic](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_graphic.html)\n* [Label](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_label.html)\n* [Compound](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_compound.html)\n* [Disjoint](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_disjoint.html)\n* [Button](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_button.html)\n* [Text](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_text.html)\n* [Numeric](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_numeric.html)\n* [Window](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_window.html)\n* [OnOffButton](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_on_off_button.html)\n* [ToggleButton](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_toggle_button.html)\n* [NumericFloat](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_numeric_float.html)\n* [NumericInteger](https://oktonion.github.io/PhWidgets-lib/html/class_ph_widgets_1_1_numeric_integer.html)\n\n### Quick start ###\n\nNow if you have a pointer to standard Photon widget (PtWidget_t*) or it's ABN_ id then with this library widgets are now simple and convenient, just do:\n\n```cpp\nPtWidget_t *label_widget;\n\nPhWidgets::Label label(label_widget);// from now on you could manage 'label_widget' with this object 'label'\n```\n\ninstead of this:\n\n```cpp\nPtWidget_t *label = widget;\nPtArg_t arg;\nPtSetArg( \u0026arg, Pt_ARG_TEXT_STRING, 0, 0 );\nPtGetResources( label, 1, \u0026arg );\nconst char *text = (const char *)(arg.value);\n\nconst char *input_text = \"test text\";\nPtSetResource(label, Pt_ARG_TEXT_STRING, input_text, 0);\n```\n\njust write this:\n\n```cpp\nstd::string text = label.Text; //thats it!\n\nlabel.Text = \"test text\"; //thats it!\n```\n\nor in case you need a raw access to resource:\n\n```cpp\nconst char *text = label.resource.argument[Label::Arguments::text_string].get();\n\nlabel.resource.argument[Label::Arguments::text_string].set(\"test text\");\n```\n\nfor callbacks instead of:\n\n```cpp\nint push_button_cb( PtWidget_t *, void *, PtCallbackInfo_t *);//callback is defined somewhere\n\nPtCallback_t callbacks[] = { {push_button_cb, NULL} };\nPtWidget_t *button = widget;\nPtAddCallbacks(button, Pt_CB_ACTIVATE, callbacks, 1);\n```\n\njust write that:\n\n```cpp\nint push_button_cb( PtWidget_t *, void *, PtCallbackInfo_t *);//callback is defined somewhere\n\nbutton.Activate += push_button_cb; //simple as that!\n```\n\nor in case you need a raw access to callback:\n\n```cpp\nint push_button_cb( PtWidget_t *, void *, PtCallbackInfo_t *);//callback is defined somewhere\n\nbutton.resource.callback[Button::Callbacks::activate].add(push_button_cb);\n```\n\nMore complex use case:\n\n```cpp\n// You have constructed somewhere PhWidgets::Button button1\n{\n    using namespace PhWidgets;\n\n    Containter button1_containter = button1.Parent;\n\n    std::set\u003cWidget\u003e widgets = button1_containter.Widgets;\n\n    // turn all buttons of the button1 parent red\n    // except for button1\n    // change cursors of all buttons respectively\n\n    for(std::set\u003cWidget\u003e::iterator it = widgets.begin(); it != widgets.end(); ++it)\n    {\n        if(nullptr == dynamic_widget_cast\u003cButton\u003e(*it))\n            continue;\n        \n        Button button = *it;\n        if(button != button1)\n        {\n            button.Color = Drawing::Colors::Red;\n            button.Cursor = Cursors::No;\n        }\n        else\n        {\n            button.Color = Drawing::Colors::Green;\n            button.Cursor = Cursors::Finger;\n        }\n        \n    }\n}\n```\n\nPhWidgets library use default photon microGUI libraries (like 'Ap', 'ph' etc.) and photon microGUI 'phexlib' library.\n\n# Build\n\nTo build lib execute '.makelib.sh' - directory slib will contain your library with all headers and source code needed.\n\n# Install\n\n* To install lib to PhAB project simply call '.exportlib.sh' with path to your project directory as 1st parameter.\n* To install manually copy 'include' directory and 'AbWidgetsWrap.cpp' to your PhAB project destination ('AbWidgetsWrap.cpp' **should be** in the same dir as PhAB project headers 'ablibs.h' and 'abimport.h' to be compiled). Place library 'libphwidgets.a' where you store the lib-files (f.e. '$ProjectDir\\x86\\o\\' and '$ProjectDir\\x86\\o-g\\' for x86 platform).\n\n**Do not forget to include 'libphwidgets.a' and 'phexlib' to your project build!**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktonion%2Fphwidgets-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foktonion%2Fphwidgets-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foktonion%2Fphwidgets-lib/lists"}