forked from Archive/PX4-Autopilot
Fix STM32 USART4/5 vs UART4/5 confusion
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4671 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
562e215f60
commit
080d38e168
|
@ -130,6 +130,15 @@ namespace NXWidgets
|
||||||
|
|
||||||
bool open(void);
|
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
|
* Request the position and size information of the window. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
|
|
||||||
#include "cnxwindow.hxx"
|
#include "cnxwindow.hxx"
|
||||||
|
#include "cnxtkwindow.hxx"
|
||||||
#include "cbgwindow.hxx"
|
#include "cbgwindow.hxx"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -176,12 +177,10 @@ namespace NXWidgets
|
||||||
* Get an instance of the framed NX window.
|
* Get an instance of the framed NX window.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if 0 // Not ready for prime time
|
inline CNxTkWindow *createFramedWindow(CWidgetControl *widgetControl)
|
||||||
inline CFramedWindow *createFramedWindow(CWidgetControl *widgetControl)
|
|
||||||
{
|
{
|
||||||
return new CFramedWindow(m_hNxServer, widgetControl);
|
return new CNxTkWindow(m_hNxServer, widgetControl);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an instance of the background window.
|
* Get an instance of the background window.
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace NXWidgets
|
||||||
* 3) The window constructor call CWidgetControl methods to "smarten"
|
* 3) The window constructor call CWidgetControl methods to "smarten"
|
||||||
* the CWidgetControl instance with window-specific knowledge.
|
* the CWidgetControl instance with window-specific knowledge.
|
||||||
* 4) Call the open() method on the window to display the window.
|
* 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.
|
* be used to generate additional widgets.
|
||||||
* 6) After that, the fully smartened CWidgetControl instance can
|
* 6) After that, the fully smartened CWidgetControl instance can
|
||||||
* be used to generate additional widgets by passing it to the
|
* be used to generate additional widgets by passing it to the
|
||||||
|
@ -129,6 +129,15 @@ namespace NXWidgets
|
||||||
|
|
||||||
bool open(void);
|
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
|
* Open a toolbar on the framed window. Toolbar creation is separate
|
||||||
* from object instantion so that errors can be reported
|
* from object instantion so that errors can be reported
|
||||||
|
|
|
@ -120,6 +120,15 @@ namespace NXWidgets
|
||||||
|
|
||||||
bool open(void);
|
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
|
* Request the position and size information of the toolbar. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -130,6 +130,15 @@ namespace NXWidgets
|
||||||
|
|
||||||
bool open(void);
|
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
|
* Request the position and size information of the window. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
namespace NXWidgets
|
namespace NXWidgets
|
||||||
{
|
{
|
||||||
struct SBitmap;
|
struct SBitmap;
|
||||||
|
class CWidgetControl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class defines common operations on a any NX window.
|
* This class defines common operations on a any NX window.
|
||||||
|
@ -89,6 +90,15 @@ namespace NXWidgets
|
||||||
|
|
||||||
virtual bool open(void) = 0;
|
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
|
* Request the position and size information of the window. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -113,6 +113,18 @@ bool CBgWindow::open(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Request the position and size information of the window. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -120,7 +120,7 @@ CNxServer::~CNxServer(void)
|
||||||
#ifndef CONFIG_NX_MULTIUSER
|
#ifndef CONFIG_NX_MULTIUSER
|
||||||
bool CNxServer::connect(void)
|
bool CNxServer::connect(void)
|
||||||
{
|
{
|
||||||
#if defined(SCREENS_EXTERNINIT)
|
#if defined(CONFIG_NXWIDGETS_EXTERNINIT)
|
||||||
// Use external graphics driver initialization
|
// Use external graphics driver initialization
|
||||||
|
|
||||||
m_hDevice = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO);
|
m_hDevice = up_nxdrvinit(CONFIG_NXWIDGETS_DEVNO);
|
||||||
|
|
|
@ -111,6 +111,18 @@ bool CNxTkWindow::open(void)
|
||||||
return m_hNxTkWindow != NULL;
|
return m_hNxTkWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Open a toolbar on the framed window
|
||||||
*
|
*
|
||||||
|
|
|
@ -117,6 +117,18 @@ bool CNxToolbar::open(void)
|
||||||
return ret == OK;
|
return ret == OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Request the position and size information of the toolbar. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -103,6 +103,18 @@ bool CNxWindow::open(void)
|
||||||
return m_hNxWindow != NULL;
|
return m_hNxWindow != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Request the position and size information of the window. The values
|
||||||
* will be returned asynchronously through the client callback method.
|
* will be returned asynchronously through the client callback method.
|
||||||
|
|
|
@ -56,6 +56,9 @@
|
||||||
|
|
||||||
namespace NxWM
|
namespace NxWM
|
||||||
{
|
{
|
||||||
|
class CNxTaskbar;
|
||||||
|
class CApplicationWindow;
|
||||||
|
|
||||||
class CNxStart : public INxApplication
|
class CNxStart : public INxApplication
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -71,9 +74,19 @@ namespace NxWM
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CNxStart Constructor
|
* 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);
|
CNxStart(CNxTaskbar *taskbar, CApplicationWindow *window);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Each implementation of INxApplication must provide a method to recover
|
||||||
|
* the contained CApplicationWindow instance.
|
||||||
|
*/
|
||||||
|
|
||||||
|
CApplicationWindow *getWindow(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the icon associated with the application
|
* Get the icon associated with the application
|
||||||
|
@ -85,6 +98,26 @@ namespace NxWM
|
||||||
|
|
||||||
NXWidgets::INxBitmap *getIcon(void);
|
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
|
* Add the application to the start window
|
||||||
*
|
*
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace NxWM
|
||||||
* widget constructor
|
* widget constructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NXWidgets::INxWindow *openRawWindow(void);
|
NXWidgets::CNxWindow *openRawWindow(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a framed application window
|
* Create a framed application window
|
||||||
|
@ -102,7 +102,15 @@ namespace NxWM
|
||||||
* @return A partially initialized application window instance.
|
* @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.
|
* Create the toolbar window.
|
||||||
|
@ -166,9 +174,37 @@ namespace NxWM
|
||||||
|
|
||||||
bool startWindowManager(start);
|
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
|
* 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
|
* @param application. The new application to add to the task bar
|
||||||
* @return true on success
|
* @return true on success
|
||||||
|
|
|
@ -54,9 +54,23 @@
|
||||||
|
|
||||||
namespace NxWM
|
namespace NxWM
|
||||||
{
|
{
|
||||||
|
class CApplicationWindow;
|
||||||
|
class NxWidget::CNxString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* INxApplication provides the abstract base class for each NxWM application.
|
||||||
|
*/
|
||||||
|
|
||||||
class INxApplication
|
class INxApplication
|
||||||
{
|
{
|
||||||
public:
|
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
|
* Get the icon associated with the application
|
||||||
*
|
*
|
||||||
|
@ -67,11 +81,25 @@ namespace NxWM
|
||||||
|
|
||||||
virtual NXWidgets::INxBitmap *getIcon(void) = 0;
|
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.
|
* Start the application.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual run(void) = 0;
|
virtual run(void) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop the application.
|
||||||
|
*/
|
||||||
|
|
||||||
|
virtual stop(void) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,16 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* 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
|
* Normal background color
|
||||||
*/
|
*/
|
||||||
|
@ -80,5 +89,34 @@
|
||||||
# define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248)
|
# define CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR MKRGB(248,248,248)
|
||||||
#endif
|
#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
|
#endif // __INCLUDE_NXWM_CONFIG_HXX
|
||||||
|
|
|
@ -105,7 +105,36 @@ bool CNxTaskBar::addApplication(INxApplication *application)
|
||||||
bool CNxTaskBar::startWindowManager(start);
|
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
|
* @param application. The new application to add to the task bar
|
||||||
* @return true on success
|
* @return true on success
|
||||||
|
@ -171,18 +200,52 @@ void CNxTaskBar::disconnect(void)
|
||||||
|
|
||||||
// Close the windows
|
// Close the windows
|
||||||
|
|
||||||
|
NxWidgets::CWidgetControl *control;
|
||||||
if (m_toolbar)
|
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;
|
delete m_toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_background)
|
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;
|
delete m_background;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_start)
|
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;
|
delete m_start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +267,7 @@ void CNxTaskBar::disconnect(void)
|
||||||
* widget constructor
|
* widget constructor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void)
|
NXWidgets::CNxWindow *CNxTaskBar::openRawWindow(void)
|
||||||
{
|
{
|
||||||
// Initialize the widget control using the default style
|
// Initialize the widget control using the default style
|
||||||
|
|
||||||
|
@ -232,7 +295,7 @@ NXWidgets::INxWindow *CNxTaskBar::openRawWindow(void)
|
||||||
return false;
|
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.
|
* @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
|
// 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
|
// Get an (uninitialized) instance of the background window as a class
|
||||||
// that derives from INxWindow.
|
// that derives from INxWindow.
|
||||||
|
|
||||||
NxWidgets:CFramedWindow window = createRawWindow(widgetControl);
|
NxWidgets:CNxTkWindow window = createRawWindow(widgetControl);
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
message("CNxwm::createGraphics: Failed to create background window\n");
|
message("CNxwm::createGraphics: Failed to create background window\n");
|
||||||
|
@ -271,7 +334,64 @@ NXWidgets::INxWindow *CNxTaskBar::openFramedWindow(void)
|
||||||
return false;
|
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;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,11 +486,19 @@ bool CNxTaskBar::createBackgroundWindow(void)
|
||||||
return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the background window.
|
* Create the start window.
|
||||||
*
|
*
|
||||||
* @return true on success
|
* @return true on success
|
||||||
*/
|
*/
|
||||||
|
@ -324,13 +507,21 @@ bool CNxTaskBar::createStartWindow(void)
|
||||||
{
|
{
|
||||||
// Create a raw window to present the background image
|
// Create a raw window to present the background image
|
||||||
|
|
||||||
INxWindow *window = openFramedWindow();
|
m_start = openFramedWindow();
|
||||||
if (!window)
|
if (!m_start)
|
||||||
{
|
{
|
||||||
message("CNxwm::createGraphics: Failed to create start window\n");
|
message("CNxwm::createGraphics: Failed to create start window\n");
|
||||||
return false;
|
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
|
// Now create the start up application
|
||||||
#warning "Missing logic"
|
#warning "Missing logic"
|
||||||
|
|
||||||
|
|
|
@ -85,8 +85,8 @@
|
||||||
# define STM32_CONSOLE_2STOP CONFIG_USART3_2STOP
|
# define STM32_CONSOLE_2STOP CONFIG_USART3_2STOP
|
||||||
# define STM32_CONSOLE_TX GPIO_USART3_TX
|
# define STM32_CONSOLE_TX GPIO_USART3_TX
|
||||||
# define STM32_CONSOLE_RX GPIO_USART3_RX
|
# define STM32_CONSOLE_RX GPIO_USART3_RX
|
||||||
#elif defined(CONFIG_UART4_SERIAL_CONSOLE)
|
#elif defined(CONFIG_USART4_SERIAL_CONSOLE)
|
||||||
# define STM32_CONSOLE_BASE STM32_USART4_BASE
|
# define STM32_CONSOLE_BASE STM32_UART4_BASE
|
||||||
# define STM32_APBCLOCK STM32_PCLK1_FREQUENCY
|
# define STM32_APBCLOCK STM32_PCLK1_FREQUENCY
|
||||||
# define STM32_CONSOLE_BAUD CONFIG_USART4_BAUD
|
# define STM32_CONSOLE_BAUD CONFIG_USART4_BAUD
|
||||||
# define STM32_CONSOLE_BITS CONFIG_USART4_BITS
|
# define STM32_CONSOLE_BITS CONFIG_USART4_BITS
|
||||||
|
@ -94,8 +94,8 @@
|
||||||
# define STM32_CONSOLE_2STOP CONFIG_USART4_2STOP
|
# define STM32_CONSOLE_2STOP CONFIG_USART4_2STOP
|
||||||
# define STM32_CONSOLE_TX GPIO_UART4_TX
|
# define STM32_CONSOLE_TX GPIO_UART4_TX
|
||||||
# define STM32_CONSOLE_RX GPIO_UART4_RX
|
# define STM32_CONSOLE_RX GPIO_UART4_RX
|
||||||
#elif defined(CONFIG_UART5_SERIAL_CONSOLE)
|
#elif defined(CONFIG_USART5_SERIAL_CONSOLE)
|
||||||
# define STM32_CONSOLE_BASE STM32_USART5_BASE
|
# define STM32_CONSOLE_BASE STM32_UART5_BASE
|
||||||
# define STM32_APBCLOCK STM32_PCLK1_FREQUENCY
|
# define STM32_APBCLOCK STM32_PCLK1_FREQUENCY
|
||||||
# define STM32_CONSOLE_BAUD CONFIG_USART5_BAUD
|
# define STM32_CONSOLE_BAUD CONFIG_USART5_BAUD
|
||||||
# define STM32_CONSOLE_BITS CONFIG_USART5_BITS
|
# define STM32_CONSOLE_BITS CONFIG_USART5_BITS
|
||||||
|
|
|
@ -84,8 +84,8 @@
|
||||||
#if defined(CONFIG_USART1_SERIAL_CONSOLE) && defined(CONFIG_STM32_USART1)
|
#if defined(CONFIG_USART1_SERIAL_CONSOLE) && defined(CONFIG_STM32_USART1)
|
||||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART4_SERIAL_CONSOLE
|
# undef CONFIG_USART4_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
# undef CONFIG_USART5_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART6_SERIAL_CONSOLE
|
# undef CONFIG_USART6_SERIAL_CONSOLE
|
||||||
# define CONSOLE_UART 1
|
# define CONSOLE_UART 1
|
||||||
# define HAVE_CONSOLE 1
|
# define HAVE_CONSOLE 1
|
||||||
|
@ -100,8 +100,8 @@
|
||||||
#elif defined(CONFIG_USART3_SERIAL_CONSOLE) && defined(CONFIG_STM32_USART3)
|
#elif defined(CONFIG_USART3_SERIAL_CONSOLE) && defined(CONFIG_STM32_USART3)
|
||||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART4_SERIAL_CONSOLE
|
# undef CONFIG_USART4_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
# undef CONFIG_USART5_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART6_SERIAL_CONSOLE
|
# undef CONFIG_USART6_SERIAL_CONSOLE
|
||||||
# define CONSOLE_UART 3
|
# define CONSOLE_UART 3
|
||||||
# define HAVE_CONSOLE 1
|
# define HAVE_CONSOLE 1
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
# undef CONFIG_USART5_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART6_SERIAL_CONSOLE
|
# undef CONFIG_USART6_SERIAL_CONSOLE
|
||||||
# define CONSOLE_UART 4
|
# define CONSOLE_UART 4
|
||||||
# define HAVE_CONSOLE 1
|
# define HAVE_CONSOLE 1
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART4_SERIAL_CONSOLE
|
# undef CONFIG_USART4_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART6_SERIAL_CONSOLE
|
# undef CONFIG_USART6_SERIAL_CONSOLE
|
||||||
# define CONSOLE_UART 5
|
# define CONSOLE_UART 5
|
||||||
# define HAVE_CONSOLE 1
|
# define HAVE_CONSOLE 1
|
||||||
|
@ -125,16 +125,16 @@
|
||||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART4_SERIAL_CONSOLE
|
# undef CONFIG_USART4_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
# undef CONFIG_USART5_SERIAL_CONSOLE
|
||||||
# define CONSOLE_UART 6
|
# define CONSOLE_UART 6
|
||||||
# define HAVE_CONSOLE 1
|
# define HAVE_CONSOLE 1
|
||||||
#else
|
#else
|
||||||
# undef CONFIG_USART1_SERIAL_CONSOLE
|
# undef CONFIG_USART1_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART2_SERIAL_CONSOLE
|
# undef CONFIG_USART2_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART3_SERIAL_CONSOLE
|
# undef CONFIG_USART3_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART4_SERIAL_CONSOLE
|
# undef CONFIG_USART4_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
# undef CONFIG_USART5_SERIAL_CONSOLE
|
||||||
# undef CONFIG_USART6_SERIAL_CONSOLE
|
# undef CONFIG_USART6_SERIAL_CONSOLE
|
||||||
# define CONSOLE_UART 0
|
# define CONSOLE_UART 0
|
||||||
# undef HAVE_CONSOLE
|
# undef HAVE_CONSOLE
|
||||||
|
|
Loading…
Reference in New Issue