summaryrefslogtreecommitdiff
path: root/NxWidgets
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-29 14:34:56 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-29 14:34:56 +0000
commit530e4e8173cbbdc299b7244ef5ba839f17b49556 (patch)
treea1b741f5bd64efb9dbae3d238b08072ebcc2883c /NxWidgets
parente35aa390b0d57483b82638952ad62f3a7f5373b5 (diff)
downloadnuttx-530e4e8173cbbdc299b7244ef5ba839f17b49556.tar.gz
nuttx-530e4e8173cbbdc299b7244ef5ba839f17b49556.tar.bz2
nuttx-530e4e8173cbbdc299b7244ef5ba839f17b49556.zip
Fix STM32 USART4/5 vs UART4/5 confusion
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4671 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets')
-rw-r--r--NxWidgets/libnxwidgets/include/cbgwindow.hxx9
-rw-r--r--NxWidgets/libnxwidgets/include/cnxserver.hxx7
-rw-r--r--NxWidgets/libnxwidgets/include/cnxtkwindow.hxx11
-rw-r--r--NxWidgets/libnxwidgets/include/cnxtoolbar.hxx9
-rw-r--r--NxWidgets/libnxwidgets/include/cnxwindow.hxx9
-rw-r--r--NxWidgets/libnxwidgets/include/inxwindow.hxx10
-rw-r--r--NxWidgets/libnxwidgets/src/cbgwindow.cxx12
-rw-r--r--NxWidgets/libnxwidgets/src/cnxserver.cxx2
-rw-r--r--NxWidgets/libnxwidgets/src/cnxtkwindow.cxx12
-rw-r--r--NxWidgets/libnxwidgets/src/cnxtoolbar.cxx12
-rw-r--r--NxWidgets/libnxwidgets/src/cnxwindow.cxx12
-rw-r--r--NxWidgets/nxwm/include/cnxstart.hxx35
-rw-r--r--NxWidgets/nxwm/include/cnxtaskbar.hxx42
-rw-r--r--NxWidgets/nxwm/include/inxapplication.hxx28
-rw-r--r--NxWidgets/nxwm/include/nxwmconfig.hxx38
-rw-r--r--NxWidgets/nxwm/src/cnxtaskbar.cxx209
16 files changed, 438 insertions, 19 deletions
diff --git a/NxWidgets/libnxwidgets/include/cbgwindow.hxx b/NxWidgets/libnxwidgets/include/cbgwindow.hxx
index 1f8e417af..435fdffbf 100644
--- a/NxWidgets/libnxwidgets/include/cbgwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/cbgwindow.hxx
@@ -131,6 +131,15 @@ namespace NXWidgets
bool open(void);
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+ CWidgetControl *getWidgetControl(void) const;
+
+ /**
* Request the position and size information of the window. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/libnxwidgets/include/cnxserver.hxx b/NxWidgets/libnxwidgets/include/cnxserver.hxx
index 2c79558a0..3043fd9e0 100644
--- a/NxWidgets/libnxwidgets/include/cnxserver.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxserver.hxx
@@ -48,6 +48,7 @@
#include <nuttx/nx/nx.h>
#include "cnxwindow.hxx"
+#include "cnxtkwindow.hxx"
#include "cbgwindow.hxx"
/****************************************************************************
@@ -176,12 +177,10 @@ namespace NXWidgets
* Get an instance of the framed NX window.
*/
-#if 0 // Not ready for prime time
- inline CFramedWindow *createFramedWindow(CWidgetControl *widgetControl)
+ inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl)
{
- return new CFramedWindow(m_hNxServer, widgetControl);
+ return new CNxTkWindow(m_hNxServer, widgetControl);
}
-#endif
/**
* Get an instance of the background window.
diff --git a/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx b/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx
index ed2ecdbd2..b6915a6c1 100644
--- a/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxtkwindow.hxx
@@ -102,7 +102,7 @@ namespace NXWidgets
* 3) The window constructor call CWidgetControl methods to "smarten"
* the CWidgetControl instance with window-specific knowledge.
* 4) Call the open() method on the window to display the window.
- * 5) After that, the fully smartend CWidgetControl instance can
+ * 5) After that, the fully smartened CWidgetControl instance can
* be used to generate additional widgets.
* 6) After that, the fully smartened CWidgetControl instance can
* be used to generate additional widgets by passing it to the
@@ -130,6 +130,15 @@ namespace NXWidgets
bool open(void);
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+ CWidgetControl *getWidgetControl(void) const;
+
+ /**
* Open a toolbar on the framed window. Toolbar creation is separate
* from object instantion so that errors can be reported
*
diff --git a/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx b/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx
index ff65cf1a9..8e016c15e 100644
--- a/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxtoolbar.hxx
@@ -121,6 +121,15 @@ namespace NXWidgets
bool open(void);
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+ CWidgetControl *getWidgetControl(void) const;
+
+ /**
* Request the position and size information of the toolbar. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/libnxwidgets/include/cnxwindow.hxx b/NxWidgets/libnxwidgets/include/cnxwindow.hxx
index 4a371bb27..e39c3cc81 100644
--- a/NxWidgets/libnxwidgets/include/cnxwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/cnxwindow.hxx
@@ -131,6 +131,15 @@ namespace NXWidgets
bool open(void);
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+ CWidgetControl *getWidgetControl(void) const;
+
+ /**
* Request the position and size information of the window. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/libnxwidgets/include/inxwindow.hxx b/NxWidgets/libnxwidgets/include/inxwindow.hxx
index 0c372ee0d..c38052de0 100644
--- a/NxWidgets/libnxwidgets/include/inxwindow.hxx
+++ b/NxWidgets/libnxwidgets/include/inxwindow.hxx
@@ -60,6 +60,7 @@
namespace NXWidgets
{
struct SBitmap;
+ class CWidgetControl;
/**
* This class defines common operations on a any NX window.
@@ -90,6 +91,15 @@ namespace NXWidgets
virtual bool open(void) = 0;
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+ virtual CWidgetControl *getWidgetControl(void) const = 0;
+
+ /**
* Request the position and size information of the window. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/libnxwidgets/src/cbgwindow.cxx b/NxWidgets/libnxwidgets/src/cbgwindow.cxx
index 08ae584b8..58ecc1f51 100644
--- a/NxWidgets/libnxwidgets/src/cbgwindow.cxx
+++ b/NxWidgets/libnxwidgets/src/cbgwindow.cxx
@@ -114,6 +114,18 @@ bool CBgWindow::open(void)
}
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+CWidgetControl *CBgWindow::getWidgetControl(void) const
+{
+ return m_widgetControl;
+}
+
+/**
* Request the position and size information of the window. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/libnxwidgets/src/cnxserver.cxx b/NxWidgets/libnxwidgets/src/cnxserver.cxx
index 2f36b0f2d..ef71deb44 100644
--- a/NxWidgets/libnxwidgets/src/cnxserver.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxserver.cxx
@@ -120,7 +120,7 @@ CNxServer::~CNxServer(void)
#ifndef CONFIG_NX_MULTIUSER
bool CNxServer::connect(void)
{
-#if defined(SCREENS_EXTERNINIT)
+#if defined(CONFIG_NXWIDGETS_EXTERNINIT)
// Use external graphics driver initialization
m_hDevice = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO);
diff --git a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
index 36b07dce5..ba62ee435 100644
--- a/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxtkwindow.cxx
@@ -112,6 +112,18 @@ bool CNxTkWindow::open(void)
}
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+CWidgetControl *CNxTkWindow::getWidgetControl(void) const
+{
+ return m_widgetControl;
+}
+
+/**
* Open a toolbar on the framed window
*
* @param height Height of the toolbar
diff --git a/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx b/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx
index 5911c731d..1c560deb1 100644
--- a/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxtoolbar.cxx
@@ -118,6 +118,18 @@ bool CNxToolbar::open(void)
}
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+CWidgetControl *CNxToolbar::getWidgetControl(void) const
+{
+ return m_widgetControl;
+}
+
+/**
* Request the position and size information of the toolbar. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/libnxwidgets/src/cnxwindow.cxx b/NxWidgets/libnxwidgets/src/cnxwindow.cxx
index fd4cc6ef2..599335972 100644
--- a/NxWidgets/libnxwidgets/src/cnxwindow.cxx
+++ b/NxWidgets/libnxwidgets/src/cnxwindow.cxx
@@ -104,6 +104,18 @@ bool CNxWindow::open(void)
}
/**
+ * Each implementation of INxWindow must provide a method to recover
+ * the contained CWidgetControl instance.
+ *
+ * @return The contained CWidgetControl instance
+ */
+
+CWidgetControl *CNxWindow::getWidgetControl(void) const
+{
+ return m_widgetControl;
+}
+
+/**
* Request the position and size information of the window. The values
* will be returned asynchronously through the client callback method.
* The GetPosition() method may than be called to obtain the positional
diff --git a/NxWidgets/nxwm/include/cnxstart.hxx b/NxWidgets/nxwm/include/cnxstart.hxx
index 42ea67b35..fbfb9c54b 100644
--- a/NxWidgets/nxwm/include/cnxstart.hxx
+++ b/NxWidgets/nxwm/include/cnxstart.hxx
@@ -56,6 +56,9 @@
namespace NxWM
{
+ class CNxTaskbar;
+ class CApplicationWindow;
+
class CNxStart : public INxApplication
{
protected:
@@ -71,9 +74,19 @@ namespace NxWM
/**
* CNxStart Constructor
+ *
+ * @param taskbar. A pointer to the parent task bar instance
+ * @param window. The window to be used by this application.
+ */
+
+ CNxStart(CNxTaskbar *taskbar, CApplicationWindow *window);
+
+ /**
+ * Each implementation of INxApplication must provide a method to recover
+ * the contained CApplicationWindow instance.
*/
- CNxStart(CNxTaskbar *taskbar);
+ CApplicationWindow *getWindow(void) const;
/**
* Get the icon associated with the application
@@ -86,6 +99,26 @@ namespace NxWM
NXWidgets::INxBitmap *getIcon(void);
/**
+ * Get the name string associated with the application
+ *
+ * @return A copy if CNxString that contains the name of the application.
+ */
+
+ NXWidgets::CNxString getName(void);
+
+ /**
+ * Start the application.
+ */
+
+ run(void);
+
+ /**
+ * Stop the application.
+ */
+
+ stop(void);
+
+ /**
* Add the application to the start window
*
* @param application. The new application to add to the start window
diff --git a/NxWidgets/nxwm/include/cnxtaskbar.hxx b/NxWidgets/nxwm/include/cnxtaskbar.hxx
index ff8b7e4c1..606514bb0 100644
--- a/NxWidgets/nxwm/include/cnxtaskbar.hxx
+++ b/NxWidgets/nxwm/include/cnxtaskbar.hxx
@@ -92,7 +92,7 @@ namespace NxWM
* widget constructor
*/
- NXWidgets::INxWindow *openRawWindow(void);
+ NXWidgets::CNxWindow *openRawWindow(void);
/**
* Create a framed application window
@@ -102,7 +102,15 @@ namespace NxWM
* @return A partially initialized application window instance.
*/
- NXWidgets::INxWindow *openFramedWindow(void);
+ NXWidgets::CNxTkWindow *openFramedWindow(void);
+
+ /**
+ * Set size and position of a window in the application area.
+ *
+ * @param window. The window to be resized and repositioned
+ */
+
+ void setApplicationGeometry(NxWidgets::INxWindow *window);
/**
* Create the toolbar window.
@@ -167,8 +175,36 @@ namespace NxWM
bool startWindowManager(start);
/**
+ * Create an application window. Creating a new applicatino in the start
+ * window requires three steps:
+ *
+ * 1. Call openApplicationWindow to create a window for the application,
+ * 2. Instantiate the application, providing the window to the application's
+ * constructor,
+ * 3. Then call addApplication to add the application to the start window.
+ *
+ * When the application is selected from the start window:
+ *
+ * 4. Call startApplication start the application and bring its window to
+ * the top.
+ */
+
+ CApplicationWindow *openApplicationWindow(void);
+
+ /**
* Start an application and add its icon to the taskbar. The applications's
- * window is brought to the top.
+ * window is brought to the top. Creating a new applicatino in the start
+ * window requires three steps:
+ *
+ * 1. Call openApplicationWindow to create a window for the application,
+ * 2. Instantiate the application, providing the window to the application's
+ * constructor,
+ * 3. Then call addApplication to add the application to the start window.
+ *
+ * When the application is selected from the start window:
+ *
+ * 4. Call startApplication start the application and bring its window to
+ * the top.
*
* @param application. The new application to add to the task bar
* @return true on success
diff --git a/NxWidgets/nxwm/include/inxapplication.hxx b/NxWidgets/nxwm/include/inxapplication.hxx
index ef7c52326..70d4ac104 100644
--- a/NxWidgets/nxwm/include/inxapplication.hxx
+++ b/NxWidgets/nxwm/include/inxapplication.hxx
@@ -54,10 +54,24 @@
namespace NxWM
{
+ class CApplicationWindow;
+ class NxWidget::CNxString;
+
+ /**
+ * INxApplication provides the abstract base class for each NxWM application.
+ */
+
class INxApplication
{
public:
/**
+ * Each implementation of INxApplication must provide a method to recover
+ * the contained CApplicationWindow instance.
+ */
+
+ virtual CApplicationWindow *getWindow(void) const = 0;
+
+ /**
* Get the icon associated with the application
*
* @return An instance if INxBitmap that may be used to rend the
@@ -68,10 +82,24 @@ namespace NxWM
virtual NXWidgets::INxBitmap *getIcon(void) = 0;
/**
+ * Get the name string associated with the application
+ *
+ * @return A copy if CNxString that contains the name of the application.
+ */
+
+ virtual NXWidgets::CNxString getName(void) = 0;
+
+ /**
* Start the application.
*/
virtual run(void) = 0;
+
+ /**
+ * Stop the application.
+ */
+
+ virtual stop(void) = 0;
};
}
diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx
index 18b35d83a..e5a85ac5a 100644
--- a/NxWidgets/nxwm/include/nxwmconfig.hxx
+++ b/NxWidgets/nxwm/include/nxwmconfig.hxx
@@ -47,7 +47,16 @@
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
+/* General Configuration ****************************************************/
+/**
+ * NX Multi-user support is required
+ */
+
+#ifndef CONFIG_NX_MULTIUSER
+# warning "NX multi-user support is required (CONFIG_NX_MULTIUSER)"
+#endif
+/* Colors *******************************************************************/
/**
* Normal background color
*/
@@ -80,5 +89,34 @@
# define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248)
#endif
+/* Task Bar Configuation ***************************************************/
+/* At present, all icons are 25 pixels in "widgth" and, hence require a
+ * task bar of at least that size.
+ */
+
+#ifndef CONFIG_NXWM_TASKBAR_WIDTH
+# define CONFIG_NXWM_TASKBAR_WIDTH (25+2*2)
+#endif
+
+/* Check task bar location */
+
+#if defined(CONFIG_NXWM_TASKBAR_TOP)
+# if defined(CONFIG_NXWM_TASKBAR_BOTTOM) || defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT)
+# warning "Multiple task positions specified"
+# endif
+#elif defined(CONFIG_NXWM_TASKBAR_BOTTOM)
+# if defined (CONFIG_NXWM_TASKBAR_LEFT) || defined (CONFIG_NXWM_TASKBAR_RIGHT)
+# warning "Multiple task positions specified"
+# endif
+#elif defined(CONFIG_NXWM_TASKBAR_LEFT)
+# if defined defined (CONFIG_NXWM_TASKBAR_RIGHT)
+# warning "Multiple task positions specified"
+# endif
+#elif !defined(CONFIG_NXWM_TASKBAR_RIGHT)
+# warning "No task positions specified"
+# define CONFIG_NXWM_TASKBAR_TOP 1
+#endif
+
+/* Colors *******************************************************************/
#endif // __INCLUDE_NXWM_CONFIG_HXX
diff --git a/NxWidgets/nxwm/src/cnxtaskbar.cxx b/NxWidgets/nxwm/src/cnxtaskbar.cxx
index d34fddd99..3cacc2629 100644
--- a/NxWidgets/nxwm/src/cnxtaskbar.cxx
+++ b/NxWidgets/nxwm/src/cnxtaskbar.cxx
@@ -105,7 +105,36 @@ bool CNxTaskBar::addApplication(INxApplication *application)
bool CNxTaskBar::startWindowManager(start);
/**
- * Start an application and add its icon to the taskbar
+ * Create an application window. Creating a new applicatino in the start
+ * window requires three steps:
+ *
+ * 1. Call openApplicationWindow to create a window for the application,
+ * 2. Instantiate the application, providing the window to the application's
+ * constructor,
+ * 3. Then call addApplication to add the application to the start window.
+ *
+ * When the application is selected from the start window:
+ *
+ * 4. Call startApplication start the application and bring its window to
+ * the top.
+ */
+
+CApplicationWindow *CNxTaskBar::openApplicationWindow(void);
+
+/**
+ * Start an application and add its icon to the taskbar. The applications's
+ * window is brought to the top. Creating a new applicatino in the start
+ * window requires three steps:
+ *
+ * 1. Call openApplicationWindow to create a window for the application,
+ * 2. Instantiate the application, providing the window to the application's
+ * constructor,
+ * 3. Then call addApplication to add the application to the start window.
+ *
+ * When the application is selected from the start window:
+ *
+ * 4. Call startApplication start the application and bring its window to
+ * the top.
*
* @param application. The new application to add to the task bar
* @return true on success
@@ -171,18 +200,52 @@ void CNxTaskBar::disconnect(void)
// Close the windows
+ NxWidgets::CWidgetControl *control;
if (m_toolbar)
{
+ // Delete the contained widget control. We are responsible for it
+ // because we created it
+
+ control = m_toolbar->getWidgetControl();
+ if (control)
+ {
+ delete control;
+ }
+
+ // Then delete the toolbar
+
delete m_toolbar;
}
if (m_background)
{
+ // Delete the contained widget control. We are responsible for it
+ // because we created it
+
+ control = m_background->getWidgetControl();
+ if (control)
+ {
+ delete control;
+ }
+
+ // Then delete the background
+
delete m_background;
}
if (m_start)
{
+ // Delete the contained widget control. We are responsible for it
+ // because we created it
+
+ control = m_start->getWidgetControl();
+ if (control)
+ {
+ delete control;
+ }
+
+ // Then delete the start window
+
delete m_start;
}
@@ -204,7 +267,7 @@ void CNxTaskBar::disconnect(void)
* widget constructor
*/
-NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void)
+NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void)
{
// Initialize the widget control using the default style
@@ -232,7 +295,7 @@ NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void)
return false;
}
- return static_cast<INxWindow*>(window);
+ return window;
}
/**
@@ -243,7 +306,7 @@ NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void)
* @return A partially initialized application window instance.
*/
-NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void)
+NXWidgets::CNxTkWindow *CNxTaskBar::openFramedWindow(void)
{
// Initialize the widget control using the default style
@@ -252,7 +315,7 @@ NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void)
// Get an (uninitialized) instance of the background window as a class
// that derives from INxWindow.
- NxWidgets:CFramedWindow window = createRawWindow(widgetControl);
+ NxWidgets:CNxTkWindow window = createRawWindow(widgetControl);
if (!window)
{
message("CNxwm::createGraphics: Failed to create background window\n");
@@ -271,7 +334,64 @@ NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void)
return false;
}
- return static_cast<INxWindow*>(window);
+ return window;
+}
+
+/**
+ * Set size and position of a window in the application area.
+ *
+ * @param window. The window to be resized and repositioned
+ *
+ * @return true on success
+ */
+
+bool CNxTaskBar::setApplicationGeometry(NxWidgets::INxWindow *window)
+{
+ // Get the widget control from the toolbar window. The physical window geometry
+ // should be the same for all windows.
+
+ NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl();
+
+ // Now position and size the application. This will depend on the position and
+ // orientation of the toolbar.
+
+ nxgl_point_t pos;
+ nxgl_size_t size;
+
+#if defined(CONFIG_NXWM_TASKBAR_TOP)
+ pos.x = 0;
+ pos.y = CONFIG_NXWM_TASKBAR_WIDTH;
+
+ size.w = rect.getWidth();
+ size.h = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH;
+#elif defined(CONFIG_NXWM_TASKBAR_BOTTOM)
+ pos.x = 0;
+ pos.y = 0;
+
+ size.w = rect.getWidth();
+ size.h = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH;
+#elif defined(CONFIG_NXWM_TASKBAR_LEFT)
+ pos.x = CONFIG_NXWM_TASKBAR_WIDTH;
+ pos.y = 0;
+
+ size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH;
+ size.h = rect.getHeight();
+#else
+ pos.x = 0;
+ pos.y = 0;
+
+ size.w = rect.getWidth() - CONFIG_NXWM_TASKBAR_WIDTH;
+ size.h = rect.getHeight();
+#endif
+
+ /* Set the size and position the window.
+ *
+ * @param pPos The new position of the window.
+ * @return True on success, false on failure.
+ */
+
+ window->setPosition(&pos);
+ window->setSize(&size);
}
/**
@@ -291,6 +411,61 @@ bool CNxTaskBar::createToolbarWindow(void)
return false;
}
+ // Get the contained widget control
+
+ NxWidgets::CWidgetControl *control = m_toolbar->getWidgetControl();
+
+ // Get the size of the window from the widget control
+
+ CRect rect = control->getWindowBoundingBox();
+
+ // Now position and size the toolbar. This will depend on the position and
+ // orientation of the toolbar.
+
+ nxgl_point_t pos;
+ nxgl_size_t size;
+
+#if defined(CONFIG_NXWM_TASKBAR_TOP)
+ pos.x = 0;
+ pos.y = 0;
+
+ size.w = rect.getWidth();
+ size.h = CONFIG_NXWM_TASKBAR_WIDTH;
+#elif defined(CONFIG_NXWM_TASKBAR_BOTTOM)
+ pos.x = 0;
+ pos.y = rect.getHeight() - CONFIG_NXWM_TASKBAR_WIDTH;
+
+ size.w = rect.getWidth();
+ size.h = CONFIG_NXWM_TASKBAR_WIDTH;
+#elif defined(CONFIG_NXWM_TASKBAR_LEFT)
+ pos.x = 0;
+ pos.y = 0;
+
+ size.w = CONFIG_NXWM_TASKBAR_WIDTH;
+ size.h = rect.getHeight();
+#else
+ pos.x = rect.getWidgth() - CONFIG_NXWM_TASKBAR_WIDTH;
+ pos.y = 0;
+
+ size.w = CONFIG_NXWM_TASKBAR_WIDTH;
+ size.h = rect.getHeight();
+#endif
+
+ /* Set the size and position the window.
+ *
+ * @param pPos The new position of the window.
+ * @return True on success, false on failure.
+ */
+
+ m_toolbar->setPosition(&pos);
+ m_toolbar->setSize(&size);
+
+ /* And raise the window to the top of the display */
+
+ m_toolbar->raise(void);
+
+ // Add the start menu's icon to the toolbar
+#warning "Missing logic"
return true;
}
@@ -311,11 +486,19 @@ bool CNxTaskBar::createBackgroundWindow(void)
return false;
}
+ // Set the geometry to fit in the application window space
+
+ setApplicationGeometry(static_cast<NxWidgets::INxWidget>(m_background));
+
+ /* And lower the background window to the bottom of the display */
+
+ m_background->lower(void);
+
return true;
}
/**
- * Create the background window.
+ * Create the start window.
*
* @return true on success
*/
@@ -324,13 +507,21 @@ bool CNxTaskBar::createStartWindow(void)
{
// Create a raw window to present the background image
- INxWindow *window = openFramedWindow();
- if (!window)
+ m_start = openFramedWindow();
+ if (!m_start)
{
message("CNxwm::createGraphics: Failed to create start window\n");
return false;
}
+ // Set the geometry to fit in the application window space
+
+ setApplicationGeometry(static_cast<NxWidgets::INxWidget>(m_start));
+
+ /* And lower the background window to the top of the display */
+
+ m_start->raise(void);
+
// Now create the start up application
#warning "Missing logic"