From 3c87f1f1fd3b7a58d29e343641d35bb1382cfac8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 21 Jan 2025 18:13:15 -0500 Subject: 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(). --- include/pugl/pugl.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'include/pugl') 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 /** -- cgit v1.2.1