NXWidgets: cfullscreenwindow.cxx Source File

NXWidgets 1.19

cfullscreenwindow.cxx
Go to the documentation of this file.
1 /********************************************************************************************
2 * NxWidgets/nxwm/src/cfullscreenwindow.cxx
3 *
4 * Copyright (C) 2012 Gregory Nutt. All rights reserved.
5 * Author: Gregory Nutt <gnutt@nuttx.org>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name NuttX, NxWidgets, nor the names of its contributors
18 * me be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 ********************************************************************************************/
35
36 /********************************************************************************************
37 * Included Files
38 ********************************************************************************************/
39
40 #include <nuttx/config.h>
41
42 #include <nuttx/nx/nxglib.h>
43
44 #include "nxconfig.hxx"
45 #include "cwidgetcontrol.hxx"
46 #include "cgraphicsport.hxx"
47
48 #include "nxwmconfig.hxx"
49 #include "nxwmglyphs.hxx"
50 #include "cfullscreenwindow.hxx"
51
52 /********************************************************************************************
53 * Pre-Processor Definitions
54 ********************************************************************************************/
55
56 /********************************************************************************************
57 * CFullScreenWindow Method Implementations
58 ********************************************************************************************/
59
60 using namespace NxWM;
61
62 /**
63 * CFullScreenWindow Constructor
64 *
65 * @param window. The raw window to be used by this application.
66 */
67
68 CFullScreenWindow::CFullScreenWindow(NXWidgets::CNxWindow *window)
69 {
70 // Save the window for later use
71
72 m_window = window;
73 }
74
75 /**
76 * CFullScreenWindow Destructor
77 */
78
79 CFullScreenWindow::~CFullScreenWindow(void)
80 {
81 // We didn't create the window. That was done by the task bar,
82 // But we will handle destruction of with window as a courtesy.
83
84 if (m_window)
85 {
86 delete m_window;
87 }
88 }
89
90 /**
91 * Initialize window. Window initialization is separate from
92 * object instantiation so that failures can be reported.
93 *
94 * @return True if the window was successfully initialized.
95 */
96
97 bool CFullScreenWindow::open(void)
98 {
99 return true;
100 }
101
102 /**
103 * Re-draw the application window
104 */
105
106 void CFullScreenWindow::redraw(void)
107 {
108 }
109
110 /**
111 * The application window is hidden (either it is minimized or it is
112 * maximized, but not at the top of the hierarchy)
113 */
114
115 void CFullScreenWindow::hide(void)
116 {
117 }
118
119 /**
120 * Recover the contained raw window instance
121 *
122 * @return. The window used by this application
123 */
124
125 NXWidgets::INxWindow *CFullScreenWindow::getWindow(void) const
126 {
127 return static_cast<NXWidgets::INxWindow*>(m_window);
128 }
129
130 /**
131 * Recover the contained widget control
132 *
133 * @return. The widget control used by this application
134 */
135
136 NXWidgets::CWidgetControl *CFullScreenWindow::getWidgetControl(void) const
137 {
138 return m_window->getWidgetControl();
139 }
140
141 /**
142 * Block further activity on this window in preparation for window
143 * shutdown.
144 *
145 * @param app. The application to be blocked
146 */
147
148 void CFullScreenWindow::block(IApplication *app)
149 {
150 // Get the widget control from the NXWidgets::CNxWindow instance
151
152 NXWidgets::CWidgetControl *control = m_window->getWidgetControl();
153
154 // And then block further reporting activity on the underlying
155 // NX raw window
156
157 nx_block(control->getWindowHandle(), (FAR void *)app);
158 }
159
160 /**
161 * Set the window label
162 *
163 * @param appname. The name of the application to place on the window
164 */
165
166 void CFullScreenWindow::setWindowLabel(NXWidgets::CNxString &appname)
167 {
168 }
169
170 /**
171 * Report of this is a "normal" window or a full screen window. The
172 * primary purpose of this method is so that window manager will know
173 * whether or not it show draw the task bar.
174 *
175 * @return True if this is a full screen window.
176 */
177
178 bool CFullScreenWindow::isFullScreen(void) const
179 {
180 return true;
181 }
182
183 /**
184 * Register to receive callbacks when toolbar icons are selected
185 */
186
187 void CFullScreenWindow::registerCallbacks(IApplicationCallback *callback)
188 {
189 }
190
191 /**
192 * Simulate a mouse click or release on the minimize icon. This method
193 * is only available for automated testing of NxWM.
194 *
195 * @param click. True to click; false to release;
196 */
197
198 #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN)
199 void CFullScreenWindow::clickMinimizePosition(bool click)
200 {
201 }
202 #endif
203
204 /**
205 * Simulate a mouse click or release on the stop icon. This method
206 * is only available for automated testing of NxWM.
207 *
208 * @param click. True to click; false to release;
209 */
210
211 #if defined(CONFIG_NXWM_UNITTEST) && !defined(CONFIG_NXWM_TOUCHSCREEN)
212 void CFullScreenWindow::clickStopIcon(bool click)
213 {
214 }
215 #endif
216
217
NxWM::CFullScreenWindow::isFullScreen
bool isFullScreen(void) const
Definition: cfullscreenwindow.cxx:178
NXWidgets::CWidgetControl
Definition: cwidgetcontrol.hxx:95
NxWM::CFullScreenWindow::hide
void hide(void)
Definition: cfullscreenwindow.cxx:115
cfullscreenwindow.hxx
NxWM::CFullScreenWindow::block
void block(IApplication *app)
Definition: cfullscreenwindow.cxx:148
cgraphicsport.hxx
NxWM::CFullScreenWindow::registerCallbacks
void registerCallbacks(IApplicationCallback *callback)
Definition: cfullscreenwindow.cxx:187
NxWM::CFullScreenWindow::getWidgetControl
NXWidgets::CWidgetControl * getWidgetControl(void) const
Definition: cfullscreenwindow.cxx:136
NxWM::CFullScreenWindow::redraw
void redraw(void)
Definition: cfullscreenwindow.cxx:106
NxWM::CFullScreenWindow::setWindowLabel
void setWindowLabel(NXWidgets::CNxString &appname)
Definition: cfullscreenwindow.cxx:166
cwidgetcontrol.hxx
NxWM::CFullScreenWindow::clickStopIcon
void clickStopIcon(bool click)
Definition: cfullscreenwindow.cxx:212
NxWM::CFullScreenWindow::getWindow
NXWidgets::INxWindow * getWindow(void) const
Definition: cfullscreenwindow.cxx:125
nxwmconfig.hxx
NxWM::CFullScreenWindow::CFullScreenWindow
CFullScreenWindow(NXWidgets::CNxWindow *window)
Definition: cfullscreenwindow.cxx:68
NxWM::CFullScreenWindow::m_window
NXWidgets::CNxWindow * m_window
Definition: cfullscreenwindow.hxx:70
nxconfig.hxx
nxwmglyphs.hxx
NxWM
Definition: capplicationwindow.hxx:66
NxWM::CFullScreenWindow::~CFullScreenWindow
~CFullScreenWindow(void)
Definition: cfullscreenwindow.cxx:79
NxWM::IApplication
Definition: iapplication.hxx:70
NXWidgets::CNxString
Definition: cnxstring.hxx:121
NXWidgets::CNxWindow::getWidgetControl
CWidgetControl * getWidgetControl(void) const
Definition: cnxwindow.cxx:120
NxWM::CFullScreenWindow::open
bool open(void)
Definition: cfullscreenwindow.cxx:97
NXWidgets::INxWindow
Definition: inxwindow.hxx:83
NXWidgets::CWidgetControl::getWindowHandle
NXHANDLE getWindowHandle(void)
Definition: cwidgetcontrol.hxx:668
NxWM::CFullScreenWindow::clickMinimizePosition
void clickMinimizePosition(bool click)
Definition: cfullscreenwindow.cxx:199
NxWM::IApplicationCallback
Definition: iapplicationwindow.hxx:74
NXWidgets::CNxWindow
Definition: cnxwindow.hxx:86