diff options
Diffstat (limited to 'src/internal.h')
-rw-r--r-- | src/internal.h | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/internal.h b/src/internal.h index 3721c10..8678982 100644 --- a/src/internal.h +++ b/src/internal.h @@ -9,8 +9,8 @@ #include "attributes.h" #include "types.h" -#include "pugl/attributes.h" -#include "pugl/pugl.h" +#include <pugl/attributes.h> +#include <pugl/pugl.h> #include <stdbool.h> #include <stddef.h> @@ -18,9 +18,29 @@ PUGL_BEGIN_DECLS +/// Return true if `x`,`y` is a valid position +bool +puglIsValidPosition(int x, int y); + +/// Return true if `width`,`height` is a valid position +bool +puglIsValidSize(unsigned x, unsigned y); + /// Return true if `size` is a valid view size bool -puglIsValidSize(PuglViewSize size); +puglIsValidArea(PuglArea size); + +/// Return the center point of some "soft" ancestor (parent window or screen) +PuglPoint +puglGetAncestorCenter(const PuglView* view); + +/// Return the initial size of a view +PuglArea +puglGetInitialSize(const PuglView* view); + +/// Return the initial position of a view if known, or an invalid position +PuglPoint +puglGetInitialPosition(const PuglView* view, PuglArea size); /// Set hint to a default value if it is unset (PUGL_DONT_CARE) void @@ -34,8 +54,14 @@ puglSetBlob(PuglBlob* dest, const void* data, size_t len); void puglSetString(char** dest, const char* string); +/// Store `width` and `height` as the current value of a size `hint` +PuglStatus +puglStoreSizeHint(PuglView* view, + PuglSizeHint hint, + unsigned width, + unsigned height); + /// Handle a changed string property -PUGL_API PuglStatus puglViewStringChanged(PuglView* view, PuglStringHint key, const char* value); @@ -56,8 +82,7 @@ PuglStatus puglDispatchSimpleEvent(PuglView* view, PuglEventType type); /// Process configure event while already in the graphics context -PUGL_WARN_UNUSED_RESULT -PuglStatus +PUGL_WARN_UNUSED_RESULT PuglStatus puglConfigure(PuglView* view, const PuglEvent* event); /// Dispatch `event` to `view`, entering graphics context if necessary |