aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_internal.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-09-13 16:24:45 -0400
committerDavid Robillard <d@drobilla.net>2015-09-13 16:24:45 -0400
commitadd00976a0c39f78f57df79c2a194c4f4e7adbf7 (patch)
tree0ac8e24a7d09faa2b6d177d147d471555cc09af6 /pugl/pugl_internal.h
parent7c1f22fdf4782aa04a14a914b5a51b3617362366 (diff)
parentd457ac139797b05fdc214f8af458833b58033224 (diff)
downloadpugl-add00976a0c39f78f57df79c2a194c4f4e7adbf7.tar.gz
pugl-add00976a0c39f78f57df79c2a194c4f4e7adbf7.tar.bz2
pugl-add00976a0c39f78f57df79c2a194c4f4e7adbf7.zip
Merge branch 'master' of git.drobilla.net:/home/drobilla/git.drobilla.net/pugl
Diffstat (limited to 'pugl/pugl_internal.h')
-rw-r--r--pugl/pugl_internal.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h
index 993f319..1006c90 100644
--- a/pugl/pugl_internal.h
+++ b/pugl/pugl_internal.h
@@ -1,5 +1,5 @@
/*
- Copyright 2012-2014 David Robillard <http://drobilla.net>
+ Copyright 2012-2015 David Robillard <http://drobilla.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -55,6 +55,10 @@ struct PuglViewImpl {
int height;
int min_width;
int min_height;
+ int min_aspect_x;
+ int min_aspect_y;
+ int max_aspect_x;
+ int max_aspect_y;
int mods;
bool mouse_in_view;
bool ignoreKeyRepeat;
@@ -100,6 +104,19 @@ puglInitWindowMinSize(PuglView* view, int width, int height)
}
void
+puglInitWindowAspectRatio(PuglView* view,
+ int min_x,
+ int min_y,
+ int max_x,
+ int max_y)
+{
+ view->min_aspect_x = min_x;
+ view->min_aspect_y = min_y;
+ view->max_aspect_x = max_x;
+ view->max_aspect_y = max_y;
+}
+
+void
puglInitWindowParent(PuglView* view, PuglNativeWindow parent)
{
view->parent = parent;
@@ -250,7 +267,9 @@ puglDecodeUTF8(const uint8_t* buf)
static void
puglDispatchEvent(PuglView* view, const PuglEvent* event)
{
- if (view->eventFunc) {
+ if (event->type == PUGL_NOTHING) {
+ return;
+ } else if (view->eventFunc) {
view->eventFunc(view, event);
}