aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-22 18:49:09 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:34:38 +0200
commit816607027012de0205e144f3edd3fdcfd43db563 (patch)
tree6baafc16e21b6186c51d9ada7c97116b6a30811c /pugl/pugl.h
parentf76954359229c25a6c9d29d6de3e75ab3a25f8dd (diff)
downloadpugl-816607027012de0205e144f3edd3fdcfd43db563.tar.gz
pugl-816607027012de0205e144f3edd3fdcfd43db563.tar.bz2
pugl-816607027012de0205e144f3edd3fdcfd43db563.zip
Add functions to get and set view size and position
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r--pugl/pugl.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 3639a96..1bd49bb 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -126,6 +126,19 @@ typedef enum {
} PuglWindowHintValue;
/**
+ A rectangle.
+
+ This is used to describe things like view position and size. Pugl generally
+ uses coordinates where the top left corner is 0,0.
+*/
+typedef struct {
+ double x;
+ double y;
+ double width;
+ double height;
+} PuglRect;
+
+/**
Keyboard modifier flags.
*/
typedef enum {
@@ -539,8 +552,10 @@ puglInitWindowParent(PuglView* view, PuglNativeWindow parent);
/**
Set the window size before creating a window.
+
+ @deprecated Use puglSetFrame().
*/
-PUGL_API void
+PUGL_API PUGL_DEPRECATED_BY("puglSetFrame") void
puglInitWindowSize(PuglView* view, int width, int height);
/**
@@ -655,10 +670,22 @@ puglGetVisible(PuglView* view);
/**
Get the current size of the view.
*/
-PUGL_API void
+PUGL_API PUGL_DEPRECATED_BY("puglGetFrame") void
puglGetSize(PuglView* view, int* width, int* height);
/**
+ Get the current position and size of the view.
+*/
+PUGL_API PuglRect
+puglGetFrame(const PuglView* view);
+
+/**
+ Set the current position and size of the view.
+*/
+PUGL_API PuglStatus
+puglSetFrame(PuglView* view, PuglRect frame);
+
+/**
@name Context
Functions for accessing the drawing context.
@{