|
LMMS
|
Functions | |
| PUGL_API PuglView * | puglNewView (PuglWorld *world) |
| PUGL_API void | puglFreeView (PuglView *view) |
| Free a view created with puglNewView(). | |
| PUGL_API PuglWorld * | puglGetWorld (PuglView *view) |
| Return the world that View is a part of. | |
| PUGL_API void | puglSetHandle (PuglView *view, PuglHandle handle) |
| PUGL_API PuglHandle | puglGetHandle (PuglView *view) |
| Get the user data for a view. | |
| PUGL_API PuglStatus | puglSetBackend (PuglView *view, const PuglBackend *backend) |
| const PuglBackend * | puglGetBackend (const PuglView *view) |
| Return the graphics backend used by a view. | |
| PUGL_API PuglStatus | puglSetEventFunc (PuglView *view, PuglEventFunc eventFunc) |
| Set the function to call when an event occurs. | |
| PUGL_API PuglStatus | puglSetViewHint (PuglView *view, PuglViewHint hint, int value) |
| PUGL_API int | puglGetViewHint (const PuglView *view, PuglViewHint hint) |
| PUGL_API double | puglGetScaleFactor (const PuglView *view) |
Functions for creating and destroying a view.
Free a view created with puglNewView().
| const PuglBackend * puglGetBackend | ( | const PuglView * | view | ) |
Return the graphics backend used by a view.
| PUGL_API PuglHandle puglGetHandle | ( | PuglView * | view | ) |
Get the user data for a view.
Return the scale factor of the view.
This factor describe how large UI elements (especially text) should be compared to "normal". For example, 2.0 means the UI should be drawn twice as large.
"Normal" is loosely defined, but means a good size on a "standard DPI" display (around 96 DPI). In other words, the scale 1.0 should have text that is reasonably sized on a 96 DPI display, and the scale 2.0 should have text twice that large.
| PUGL_API int puglGetViewHint | ( | const PuglView * | view, |
| PuglViewHint | hint ) |
Get the value for a view hint.
If the view has been realized, this can be used to get the actual value of a hint which was initially set to PUGL_DONT_CARE, or has been adjusted from the suggested value.
Create a new view.
A newly created view does not correspond to a real system view or window. It must first be configured, then the system view can be created with puglRealize().
| PUGL_API PuglStatus puglSetBackend | ( | PuglView * | view, |
| const PuglBackend * | backend ) |
Set the graphics backend to use for a view.
This must be called once to set the graphics backend before calling puglRealize().
Pugl includes the following backends:
Note that backends are modular and not compiled into the main Pugl library to avoid unnecessary dependencies. To use a particular backend, applications must link against the appropriate backend library, or be sure to compile in the appropriate code if using a local copy of Pugl.
| PUGL_API PuglStatus puglSetEventFunc | ( | PuglView * | view, |
| PuglEventFunc | eventFunc ) |
Set the function to call when an event occurs.
| PUGL_API void puglSetHandle | ( | PuglView * | view, |
| PuglHandle | handle ) |
Set the user data for a view.
This is usually a pointer to a struct that contains all the state which must be accessed by a view. Everything needed to process events should be stored here, not in static variables.
The handle is opaque to Pugl and is not interpreted in any way.
| PUGL_API PuglStatus puglSetViewHint | ( | PuglView * | view, |
| PuglViewHint | hint, | ||
| int | value ) |
Set a hint to configure view properties.
This only has an effect when called before puglRealize().