diff options
author | David Robillard <d@drobilla.net> | 2025-02-08 16:48:43 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-02-08 18:02:30 -0500 |
commit | 23b0774862b79543b93a9b50b4f085c2c396698a (patch) | |
tree | d389c9950c0c55c29addab14702f796d97ade25b /include/pugl | |
parent | 494932c79800698bcd30a506c6abe7f43c59d2bd (diff) | |
download | pugl-23b0774862b79543b93a9b50b4f085c2c396698a.tar.gz pugl-23b0774862b79543b93a9b50b4f085c2c396698a.tar.bz2 pugl-23b0774862b79543b93a9b50b4f085c2c396698a.zip |
Add PUGL_CURRENT_SIZE hint and make size hints dynamic
Diffstat (limited to 'include/pugl')
-rw-r--r-- | include/pugl/pugl.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 8ecea0e..6aaca58 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -983,6 +983,15 @@ typedef enum { PUGL_DEFAULT_SIZE, /** + Current size. + + This reflects the current size of the view, which may be different from + the default size if the view is resizable. Typically, it overrides the + default size. + */ + PUGL_CURRENT_SIZE, + + /** Minimum size. If set, the view's size should be constrained to be at least this large. @@ -1183,14 +1192,15 @@ puglSetSize(PuglView* view, unsigned width, unsigned height); /** Set a size hint for the view. - This can be used to set the default, minimum, and maximum size of a view, - as well as the supported range of aspect ratios. + This can be used to set the default, current, minimum, and maximum size of a + view, as well as the supported range of aspect ratios. This should be called before puglRealize() so the initial window for the - view can be configured correctly. + view can be configured correctly. It may also be used dynamically after the + window is realized, for some hints. - @return #PUGL_UNKNOWN_ERROR on failure, but always succeeds if the view is - not yet realized. + @return An error code on failure, but always succeeds if the view is not yet + realized. */ PUGL_API PuglStatus puglSetSizeHint(PuglView* view, |