blip  0.1
Window.hpp
Go to the documentation of this file.
1 #ifndef __blip_Window_hpp
2 #define __blip_Window_hpp
3 
4 #include <blip/Blip.hpp>
5 
6 #include <commonc++/Buffer.h++>
7 
8 struct ANativeActivity;
9 struct ANativeWindow;
10 
11 namespace blip {
12 
13 class Rectangle;
14 
19 class Window
20 {
21  friend class NativeActivity;
22 
23  public:
24 
28 
30  enum Flags {
34  Flag_DimBehind = (1 << 1),
36  Flag_BlurBehind = (1 << 2),
38  Flag_NotFocusable = (1 << 3),
40  Flag_NotTouchable = (1 << 4),
45  Flag_NotTouchModal = (1 << 5),
53  Flag_KeepScreenOn = (1 << 7),
57  Flag_LayoutInScreen = (1 << 8),
59  Flag_LayoutNoLimits = (1 << 9),
63  Flag_FullScreen = (1 << 10),
69  Flag_Dither = (1 << 12),
71  Flag_Secure = (1 << 13),
73  Flag_Scaled = (1 << 14),
92  Flag_AltFocusableIM = (1 << 17),
100  Flag_ShowWhenLocked = (1 << 19),
103  Flag_ShowWallpaper = (1 << 20),
106  Flag_TurnScreenOn = (1 << 21),
109  };
110 
112  ~Window();
113 
118  int getWidth() const;
119 
124  int getHeight() const;
125 
127  Format getFormat() const;
128 
130  void setFormat(Format format);
131 
137  void setFlags(uint32_t addFlags, uint32_t removeFlags);
138 
139  // TODO:
140 // bool lock(ByteBuffer* buffer, Rectangle* dirtyRect) throw();
141 // bool unlockAndPost() throw();
142 
155  bool setBuffersGeometry(uint_t width, uint_t height, Format format);
156 
157  private: // called by NativeActivity
158 
160  Window(ANativeActivity* activity, ANativeWindow* window);
161 
162  inline ANativeWindow* getHandle()
163  { return(_window); }
166  private:
167 
168  ANativeActivity* _activity;
169  ANativeWindow* _window;
170 
171  CCXX_COPY_DECLS(Window);
172 };
173 
174 } // namespace blip
175 
176 #endif // __blip_Window_hpp
Even when the window is focusable (Window::Flag_NotFocusable is not set), allow any pointer events ou...
Definition: Window.hpp:45
Hide all screen decorations (such as the status bar) while the window is visible. ...
Definition: Window.hpp:63
void setFormat(Format format)
Set the window format.
Definition: Window.cpp:72
Definition: Window.hpp:27
Definition: Window.hpp:27
If the device is asleep when the screen is pressed, send that touch event to the application.
Definition: Window.hpp:49
Dismiss non-secure keyguards.
Definition: Window.hpp:108
A native window.
Definition: Window.hpp:19
Used in conjunction with Window::Flag_LayoutInScreen.
Definition: Window.hpp:88
Intended for windows that will often be used when the user is holding the screen against their face...
Definition: Window.hpp:82
If Window::Flag_NotTouchModal is not set, allow the application to receive a single special MotionEve...
Definition: Window.hpp:98
bool setBuffersGeometry(uint_t width, uint_t height, Format format)
Change the format and size of hte window buffers.
Definition: Window.cpp:136
Keep the device screen turned on and bright as long as the window is visible.
Definition: Window.hpp:53
Place the window within the entire screen, ignoring border decorations such as the status bar...
Definition: Window.hpp:57
Definition: Window.hpp:26
Display the system wallpaper behind the window.
Definition: Window.hpp:103
void setFlags(uint32_t addFlags, uint32_t removeFlags)
Set and clear window flags.
Definition: Window.cpp:101
Allow the window to extend outside of the bounds of the screen.
Definition: Window.hpp:59
Disable key input focus for the window.
Definition: Window.hpp:38
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
Display the window even if the device is locked.
Definition: Window.hpp:100
Flags
Window flags.
Definition: Window.hpp:30
Format getFormat() const
Get the window format.
Definition: Window.cpp:52
Inverts the state of Window::Flag_NotFocusable with respect to how the window interacts with the curr...
Definition: Window.hpp:92
An abstract base class for all "native" (C++) Android activities.
Definition: NativeActivity.hpp:71
Disable touch events for the window.
Definition: Window.hpp:40
Allow the screen lock to activate when this window is visible.
Definition: Window.hpp:32
When the window is made visibile, turn the screen on if the device is asleep.
Definition: Window.hpp:106
Format
Window formats.
Definition: Window.hpp:26
Dim everything behind the window.
Definition: Window.hpp:34
Blur everything behind the window.
Definition: Window.hpp:36
Definition: Window.hpp:26
Do not allow screen shots to be taken while the window is visible.
Definition: Window.hpp:71
Force the screen decorations (such as the status bar) to be shown while the window is visible...
Definition: Window.hpp:67
Enable scaling when compisiting the window to the screen.
Definition: Window.hpp:73
int getWidth() const
Get the width of the native window.
Definition: Window.cpp:36
Enable dithering when compositing the window to the screen.
Definition: Window.hpp:69
int getHeight() const
Get the height of the native window.
Definition: Window.cpp:44
~Window()
Destructor.
Definition: Window.cpp:28