diff options
author | David Robillard <d@drobilla.net> | 2025-01-21 18:13:15 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-01-21 18:13:22 -0500 |
commit | 3c87f1f1fd3b7a58d29e343641d35bb1382cfac8 (patch) | |
tree | d092eb192f8724794c10e01d26feaf4235d931a1 /include/pugl | |
parent | 0452a367a89ac415c647831880485a55eaddbe35 (diff) | |
download | pugl-3c87f1f1fd3b7a58d29e343641d35bb1382cfac8.tar.gz pugl-3c87f1f1fd3b7a58d29e343641d35bb1382cfac8.tar.bz2 pugl-3c87f1f1fd3b7a58d29e343641d35bb1382cfac8.zip |
Use a consistent naming scheme for parent functions
These could be combined into a hint-like general get/set mechanism, but
currently there's only two window relationships and no immediate plans to add
more, so that feels a bit over-engineered. So, just rename for consistency
with puglSetTransientParent().
Diffstat (limited to 'include/pugl')
-rw-r--r-- | include/pugl/pugl.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 79d3969..838450d 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -1245,18 +1245,18 @@ puglSetSizeHint(PuglView* view, */ /** - Set the parent window for embedding a view in an existing window. + Set the parent for embedding a view in an existing window. This must be called before puglRealize(), reparenting is not supported. */ PUGL_API PuglStatus -puglSetParentWindow(PuglView* view, PuglNativeView parent); +puglSetParent(PuglView* view, PuglNativeView parent); /// Return the parent window this view is embedded in, or null PUGL_API PuglNativeView -puglGetParentWindow(const PuglView* view); +puglGetParent(const PuglView* view); /** Set the transient parent of the window. @@ -1927,11 +1927,11 @@ puglInitWindowHint(PuglView* view, PuglViewHint hint, int value) @deprecated Use puglSetWindowParent(). */ -static inline PUGL_DEPRECATED_BY("puglSetParentWindow") +static inline PUGL_DEPRECATED_BY("puglSetParent") void puglInitWindowParent(PuglView* view, PuglNativeView parent) { - puglSetParentWindow(view, parent); + puglSetParent(view, parent); } /** @@ -2178,6 +2178,22 @@ puglRequestAttention(PuglView* view) # define PUGL_KEY_SUPER PUGL_KEY_SUPER_L +/// Set the parent window for embedding a view in an existing window +static inline PUGL_DEPRECATED_BY("puglSetParent") +PuglStatus +puglSetParentWindow(PuglView* view, PuglNativeView parent) +{ + return puglSetParent(view, parent); +} + +/// Return the parent window this view is embedded in, or null +static inline PUGL_DEPRECATED_BY("puglGetParent") +PuglNativeView +puglGetParentWindow(PuglView* view) +{ + return puglGetParent(view); +} + #endif // PUGL_DISABLE_DEPRECATED /** |