aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native/Window.h
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-08-10 16:16:13 +0200
committerSven Gothel <[email protected]>2015-08-10 16:16:13 +0200
commit2d837a7a7130702ad36b694875613fae77c7ef06 (patch)
treef9027493d91511e9f799a852d3058d9fb29f9645 /src/newt/native/Window.h
parent1e4bfc26e2f220e046f42f7d26c05e4971bc509d (diff)
Bug 1188, Bug 1186: NEWT Window: Support non-resizable, minimize, maximize, alwaysOnBottom and sticky/all-desktop (Part 1)
Change also implements Bug 1186: 'NEWT Window: Use a Bitfield holding all state flags and expose it accordingly', since it is essential for an efficient implementation. Part 1: - Bug 1186 - Using Bitfield, holding public (Window) and private state bits/mask - Bug 1188 - Window adds: - [is|set]AlwaysOnBottom(..), - [is|set]Resizable(..), - [is|set]Sticky(..), - [is|set]Maximized(..), - isChildWindow(), - Full implementation for X11 - TODO: Implement for OSX and Windows - Manual tests: - TestGearsES2NEWT, TestGearsES2NEWTSimple and TestGearsES2NewtCanvasAWT utilize new NewtDemoListener, which has a key-listener to perform all [new] actions. See source code of NewtDemoListener.
Diffstat (limited to 'src/newt/native/Window.h')
-rw-r--r--src/newt/native/Window.h62
1 files changed, 46 insertions, 16 deletions
diff --git a/src/newt/native/Window.h b/src/newt/native/Window.h
index d9ee5fd1f..ada886d24 100644
--- a/src/newt/native/Window.h
+++ b/src/newt/native/Window.h
@@ -29,30 +29,60 @@
#ifndef _WINDOW_H_
#define _WINDOW_H_
-#define FLAG_CHANGE_PARENTING ( 1 << 0 )
-#define FLAG_CHANGE_DECORATION ( 1 << 1 )
-#define FLAG_CHANGE_FULLSCREEN ( 1 << 2 )
-#define FLAG_CHANGE_ALWAYSONTOP ( 1 << 3 )
-#define FLAG_CHANGE_VISIBILITY ( 1 << 4 )
+#define FLAG_CHANGE_VISIBILITY ( 1 << 31 )
+#define FLAG_CHANGE_VISIBILITY_FAST ( 1 << 30 )
+#define FLAG_CHANGE_PARENTING ( 1 << 29 )
+#define FLAG_CHANGE_DECORATION ( 1 << 28 )
+#define FLAG_CHANGE_ALWAYSONTOP ( 1 << 27 )
+#define FLAG_CHANGE_ALWAYSONBOTTOM ( 1 << 26 )
+#define FLAG_CHANGE_STICKY ( 1 << 25 )
+#define FLAG_CHANGE_RESIZABLE ( 1 << 24 )
+#define FLAG_CHANGE_MAXIMIZED_VERT ( 1 << 23 )
+#define FLAG_CHANGE_MAXIMIZED_HORZ ( 1 << 22 )
+#define FLAG_CHANGE_FULLSCREEN ( 1 << 21 )
-#define FLAG_HAS_PARENT ( 1 << 8 )
-#define FLAG_IS_UNDECORATED ( 1 << 9 )
-#define FLAG_IS_FULLSCREEN ( 1 << 10 )
-#define FLAG_IS_FULLSCREEN_SPAN ( 1 << 11 )
-#define FLAG_IS_ALWAYSONTOP ( 1 << 12 )
-#define FLAG_IS_VISIBLE ( 1 << 13 )
+#define FLAG_IS_VISIBLE ( 1 << 0 )
+#define FLAG_IS_AUTOPOSITION ( 1 << 1 )
+#define FLAG_IS_CHILD ( 1 << 2 )
+#define FLAG_IS_FOCUSED ( 1 << 3 )
+#define FLAG_IS_UNDECORATED ( 1 << 4 )
+#define FLAG_IS_ALWAYSONTOP ( 1 << 5 )
+#define FLAG_IS_ALWAYSONBOTTOM ( 1 << 6 )
+#define FLAG_IS_STICKY ( 1 << 7 )
+#define FLAG_IS_RESIZABLE ( 1 << 8 )
+#define FLAG_IS_MAXIMIZED_VERT ( 1 << 9 )
+#define FLAG_IS_MAXIMIZED_HORZ ( 1 << 10 )
+#define FLAG_IS_FULLSCREEN ( 1 << 11 )
+#define FLAG_IS_FULLSCREEN_SPAN ( 1 << 12 )
+#define TST_FLAG_CHANGE_VISIBILITY(f) ( 0 != ( (f) & FLAG_CHANGE_VISIBILITY ) )
+#define TST_FLAG_CHANGE_VISIBILITY_FAST(f) ( 0 != ( (f) & FLAG_CHANGE_VISIBILITY_FAST ) )
#define TST_FLAG_CHANGE_PARENTING(f) ( 0 != ( (f) & FLAG_CHANGE_PARENTING ) )
#define TST_FLAG_CHANGE_DECORATION(f) ( 0 != ( (f) & FLAG_CHANGE_DECORATION ) )
-#define TST_FLAG_CHANGE_FULLSCREEN(f) ( 0 != ( (f) & FLAG_CHANGE_FULLSCREEN ) )
#define TST_FLAG_CHANGE_ALWAYSONTOP(f) ( 0 != ( (f) & FLAG_CHANGE_ALWAYSONTOP ) )
-#define TST_FLAG_CHANGE_VISIBILITY(f) ( 0 != ( (f) & FLAG_CHANGE_VISIBILITY ) )
+#define TST_FLAG_CHANGE_ALWAYSONBOTTOM(f) ( 0 != ( (f) & FLAG_CHANGE_ALWAYSONBOTTOM ) )
+#define TST_FLAG_CHANGE_ALWAYSONANY(f) ( 0 != ( (f) & ( FLAG_CHANGE_ALWAYSONTOP | FLAG_CHANGE_ALWAYSONBOTTOM ) ) )
+#define TST_FLAG_CHANGE_STICKY(f) ( 0 != ( (f) & FLAG_CHANGE_STICKY ) )
+#define TST_FLAG_CHANGE_RESIZABLE(f) ( 0 != ( (f) & FLAG_CHANGE_RESIZABLE ) )
+#define TST_FLAG_CHANGE_MAXIMIZED_VERT(f) ( 0 != ( (f) & FLAG_CHANGE_MAXIMIZED_VERT ) )
+#define TST_FLAG_CHANGE_MAXIMIZED_HORZ(f) ( 0 != ( (f) & FLAG_CHANGE_MAXIMIZED_HORZ ) )
+#define TST_FLAG_CHANGE_MAXIMIZED_ANY(f) ( 0 != ( (f) & ( FLAG_CHANGE_MAXIMIZED_VERT | FLAG_CHANGE_MAXIMIZED_HORZ ) ) )
+#define TST_FLAG_CHANGE_FULLSCREEN(f) ( 0 != ( (f) & FLAG_CHANGE_FULLSCREEN ) )
-#define TST_FLAG_HAS_PARENT(f) ( 0 != ( (f) & FLAG_HAS_PARENT ) )
+#define TST_FLAG_IS_VISIBLE(f) ( 0 != ( (f) & FLAG_IS_VISIBLE ) )
+#define TST_FLAG_IS_AUTOPOSITION(f) ( 0 != ( (f) & FLAG_IS_AUTOPOSITION ) )
+#define TST_FLAG_IS_CHILD(f) ( 0 != ( (f) & FLAG_IS_CHILD ) )
+#define TST_FLAG_IS_FOCUSED(f) ( 0 != ( (f) & FLAG_IS_FOCUSED ) )
#define TST_FLAG_IS_UNDECORATED(f) ( 0 != ( (f) & FLAG_IS_UNDECORATED ) )
+#define TST_FLAG_IS_ALWAYSONTOP(f) ( 0 != ( (f) & FLAG_IS_ALWAYSONTOP ) )
+#define TST_FLAG_IS_ALWAYSONBOTTOM(f) ( 0 != ( (f) & FLAG_IS_ALWAYSONBOTTOM ) )
+#define TST_FLAG_IS_ALWAYSONANY(f) ( 0 != ( (f) & ( FLAG_IS_ALWAYSONTOP | FLAG_IS_ALWAYSONBOTTOM ) ) )
+#define TST_FLAG_IS_STICKY(f) ( 0 != ( (f) & FLAG_IS_STICKY ) )
+#define TST_FLAG_IS_RESIZABLE(f) ( 0 != ( (f) & FLAG_IS_RESIZABLE ) )
+#define TST_FLAG_IS_MAXIMIZED_VERT(f) ( 0 != ( (f) & FLAG_IS_MAXIMIZED_VERT ) )
+#define TST_FLAG_IS_MAXIMIZED_HORZ(f) ( 0 != ( (f) & FLAG_IS_MAXIMIZED_HORZ ) )
+#define TST_FLAG_IS_MAXIMIZED_ANY(f) ( 0 != ( (f) & ( FLAG_IS_MAXIMIZED_VERT | FLAG_IS_MAXIMIZED_HORZ ) ) )
#define TST_FLAG_IS_FULLSCREEN(f) ( 0 != ( (f) & FLAG_IS_FULLSCREEN ) )
#define TST_FLAG_IS_FULLSCREEN_SPAN(f) ( 0 != ( (f) & FLAG_IS_FULLSCREEN_SPAN ) )
-#define TST_FLAG_IS_ALWAYSONTOP(f) ( 0 != ( (f) & FLAG_IS_ALWAYSONTOP ) )
-#define TST_FLAG_IS_VISIBLE(f) ( 0 != ( (f) & FLAG_IS_VISIBLE ) )
#endif