diff options
author | David Robillard <d@drobilla.net> | 2020-05-16 21:18:02 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-05-16 21:18:02 +0200 |
commit | fe96ed3c451548278197e2da74d3d53b1d6a8dd9 (patch) | |
tree | 6c4e3e751ddd13cd4898fac0fae4f4aed7079f36 /pugl/pugl.h | |
parent | 3200cda25e06887e809fc5b47780aaf950253172 (diff) | |
download | pugl-fe96ed3c451548278197e2da74d3d53b1d6a8dd9.tar.gz pugl-fe96ed3c451548278197e2da74d3d53b1d6a8dd9.tar.bz2 pugl-fe96ed3c451548278197e2da74d3d53b1d6a8dd9.zip |
Add default and maximum size
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r-- | pugl/pugl.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h index fe8b585..b489407 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -559,6 +559,7 @@ typedef enum { PUGL_FAILURE, ///< Non-fatal failure PUGL_UNKNOWN_ERROR, ///< Unknown system error PUGL_BAD_BACKEND, ///< Invalid or missing backend + PUGL_BAD_CONFIGURATION, ///< Invalid view configuration PUGL_BAD_PARAMETER, ///< Invalid parameter PUGL_BACKEND_FAILED, ///< Backend initialisation failed PUGL_REGISTRATION_FAILED, ///< Class registration failed @@ -947,6 +948,16 @@ PUGL_API PuglStatus puglSetFrame(PuglView* view, PuglRect frame); /** + Set the default size of the view. + + This should be called before puglResize() to set the default size of the + view, which will be the initial size of the window if this is a top level + view. +*/ +PUGL_API PuglStatus +puglSetDefaultSize(PuglView* view, int width, int height); + +/** Set the minimum size of the view. If an initial minimum size is known, this should be called before @@ -956,6 +967,15 @@ PUGL_API PuglStatus puglSetMinSize(PuglView* view, int width, int height); /** + Set the maximum size of the view. + + If an initial maximum size is known, this should be called before + puglRealize() to avoid stutter, though it can be called afterwards as well. +*/ +PUGL_API PuglStatus +puglSetMaxSize(PuglView* view, int width, int height); + +/** Set the view aspect ratio range. The x and y values here represent a ratio of width to height. To set a |