|
MostlyHarmless 0.0.1
|
macOS specific gui helper functions More...
Functions | |
| void * | createView (std::uint32_t width, std::uint32_t height) |
| void | removeFromParentView (void *viewHandle) |
| void | setViewSize (void *viewHandle, std::uint32_t width, std::uint32_t height) |
| void | getViewSize (void *viewHandle, std::uint32_t *width, std::uint32_t *height) |
| void | reparentView (void *hostViewHandle, void *clientViewHandle, void *childViewHandle, Colour backgroundColour) |
| void | showView (void *viewHandle) |
| void | hideView (void *viewHandle) |
| void | getMousePos (std::uint32_t *x, std::uint32_t *y) |
| void | setMousePos (std::uint32_t newX, std::uint32_t newY) |
| void | showCursor () |
| void | hideCursor () |
macOS specific gui helper functions
| void * mostly_harmless::gui::helpers::macos::createView | ( | std::uint32_t | width, |
| std::uint32_t | height ) |
| void mostly_harmless::gui::helpers::macos::getMousePos | ( | std::uint32_t * | x, |
| std::uint32_t * | y ) |
Retrieves the current mouse position in screen coords, and stores them in x and y.
| x | A pointer to your x variable - the result will be written here. |
| y | A pointer to your y variable - the result will be written here. |
| void mostly_harmless::gui::helpers::macos::getViewSize | ( | void * | viewHandle, |
| std::uint32_t * | width, | ||
| std::uint32_t * | height ) |
Retrieves an NSView's size.
| viewHandle | A void* to the NSView to query. |
| width | A pointer to the width variable - the result will be written here. |
| height | A pointer to the height variable - the result will be written here. |
| void mostly_harmless::gui::helpers::macos::hideCursor | ( | ) |
Hides the cursor.
| void mostly_harmless::gui::helpers::macos::hideView | ( | void * | viewHandle | ) |
Sets an NSView as hidden.
| viewHandle | A void* to the NSView to set hidden. |
| void mostly_harmless::gui::helpers::macos::removeFromParentView | ( | void * | viewHandle | ) |
Removes an NSView from its parent NSView.
| viewHandle | A void* to the NSView to remove. |
| void mostly_harmless::gui::helpers::macos::reparentView | ( | void * | hostViewHandle, |
| void * | clientViewHandle, | ||
| void * | childViewHandle, | ||
| Colour | backgroundColour ) |
Adds an NSView as a subview of another NSView.
| parentViewHandle | A void* to the NSView to add the child view to. |
| childViewHandle | A void* to the NSView to add to the parent view. |
| void mostly_harmless::gui::helpers::macos::setMousePos | ( | std::uint32_t | newX, |
| std::uint32_t | newY ) |
Sets the mouse position to the provided position (in screen coords). Internally handles translating from screen coords to global space coords.
| newX | The x position to set the mouse position to (in screen space). |
| newY | The y position to set the mouse position to (in screen space). |
| void mostly_harmless::gui::helpers::macos::setViewSize | ( | void * | viewHandle, |
| std::uint32_t | width, | ||
| std::uint32_t | height ) |
Sets an NSView's size.
| viewHandle | A void* to the NSView* to resize. |
| width | The new width. |
| height | The new height. |
| void mostly_harmless::gui::helpers::macos::showCursor | ( | ) |
Shows (or more accurately, "unhides") the cursor.
| void mostly_harmless::gui::helpers::macos::showView | ( | void * | viewHandle | ) |
Sets an NSView as visible.
| viewHandle | A void* to the NSView to set visible. |