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 
69 {
70  // Save the window for later use
71 
72  m_window = window;
73 }
74 
75 /**
76  * CFullScreenWindow Destructor
77  */
78 
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 
98 {
99  return true;
100 }
101 
102 /**
103  * Re-draw the application window
104  */
105 
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 
116 {
117 }
118 
119 /**
120  * Recover the contained raw window instance
121  *
122  * @return. The window used by this application
123  */
124 
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 
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 
149 {
150  // Get the widget control from the NXWidgets::CNxWindow instance
151 
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 
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 
179 {
180  return true;
181 }
182 
183 /**
184  * Register to receive callbacks when toolbar icons are selected
185  */
186 
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)
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)
213 {
214 }
215 #endif
216 
217 
void block(IApplication *app)
void registerCallbacks(IApplicationCallback *callback)
NXWidgets::CWidgetControl * getWidgetControl(void) const
void setWindowLabel(NXWidgets::CNxString &appname)
void clickStopIcon(bool click)
NXWidgets::INxWindow * getWindow(void) const
CFullScreenWindow(NXWidgets::CNxWindow *window)
NXWidgets::CNxWindow * m_window
CWidgetControl * getWidgetControl(void) const
Definition: cnxwindow.cxx:120
void clickMinimizePosition(bool click)