Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/generalsimus/basic-native-gui
https://github.com/generalsimus/basic-native-gui
Last synced: about 8 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/generalsimus/basic-native-gui
- Owner: Generalsimus
- Created: 2023-08-31T18:04:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T15:35:32.000Z (about 1 year ago)
- Last Synced: 2023-11-01T14:32:36.123Z (about 1 year ago)
- Language: C++
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## [Basic Native GUI](https://github.com/Generalsimus/Basic-Native-GUI)
###### A basic GUI application based on Google Skia.
Example
```cpp
#include "./window/win/winWindow.cpp"
#include "./Painters.cpp"
#includeint main()
{auto windowObj = new winWindow("My Custom Window", 500.0f, 500.0f);
windowObj->addChild(
Element()->setPaints(
Box(),
Cursor(Cursor::Arrow)
),
Element()->setPaints(
Text("Hello!"),
Cursor(Cursor::Text)
)->addTouchEvent([](ElementView *element, float x, float y, int type) {
std::cout << "TOUCH DOWN" << std::endl;})
);
awaitAllAsyncTasks();
return 0;
}
```Element Events
| Add Event | Run Event |
|:----------------------------------------------------------------------------------------------:|:------------------------------:|
| ```addTouchMoveEvent(TouchMoveEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchTouchMoveEvent()``` |
| ```addTouchOverEvent(TouchOverEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchTouchOverEvent()``` |
| ```addTouchLeaveEvent(TouchLeaveEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchTouchLeaveEvent()``` |
| ```addTouchDownEvent(TouchDownEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchTouchDownEvent()``` |
| ```addTouchUpEvent(TouchUpEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchTouchUpEvent()``` |
| ```addTouchEvent(TouchEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchTouchEvent()``` |
| ```addKeyDownEvent(KeyDownEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchKeyDownEvent()``` |
| ```addKeyUpEvent(KeyUpEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchKeyUpEvent()``` |
| ```addKeyEvent(KeyEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchKeyEvent()``` |
| ```addDrawEvent(DrawEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchDrawEvent()``` |
| ```addResizeEvent(ResizeEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchResizeEvent()``` |
| ```addSetPaintsEvent(SetPaintsEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchSetPaintsEvent()``` |
| ```addAddChildEvent(AddChildEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchAddChildEvent()``` |
| ```addRemoveChildEvent(RemoveChildEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchRemoveChildEvent()``` |
| ```addReplaceChildEvent(RemoveChildEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchReplaceChildEvent()``` |
| ```addSetBackgroundColorEvent(SetBackgroundColorEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchSetBackgroundColorEvent()``` |
| ```addMountOnThreeEvent(MountOnThreeEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchMountOnThreeEvent()``` |
| ```addUnmountOnThreeEvent(UnmountOnThreeEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchUnmountOnThreeEvent()``` |
| ```addUnmountOnThreeEvent(UnmountOnThreeEventType &&, RemoveEventCallBack &&, bool)``` | ```dispatchUnmountOnThreeEvent()``` |Element Style