summaryrefslogtreecommitdiff
path: root/NxWidgets/nxwm/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-01 20:36:19 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-05-01 20:36:19 +0000
commitfd4dd86fe8de2ddda1e8723973e8b5774528ebb7 (patch)
tree076f03852cb6bcd7a34d313558f7529143337e6d /NxWidgets/nxwm/include
parent990276740afafeb69f64b01050a99f113bb89fa6 (diff)
downloadnuttx-fd4dd86fe8de2ddda1e8723973e8b5774528ebb7.tar.gz
nuttx-fd4dd86fe8de2ddda1e8723973e8b5774528ebb7.tar.bz2
nuttx-fd4dd86fe8de2ddda1e8723973e8b5774528ebb7.zip
More NxWM support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4682 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/nxwm/include')
-rw-r--r--NxWidgets/nxwm/include/capplicationwindow.hxx22
-rw-r--r--NxWidgets/nxwm/include/cnxconsole.hxx15
-rw-r--r--NxWidgets/nxwm/include/cstartwindow.hxx27
-rw-r--r--NxWidgets/nxwm/include/ctaskbar.hxx47
-rw-r--r--NxWidgets/nxwm/include/nxwmconfig.hxx97
5 files changed, 177 insertions, 31 deletions
diff --git a/NxWidgets/nxwm/include/capplicationwindow.hxx b/NxWidgets/nxwm/include/capplicationwindow.hxx
index 3d868e576..adeac30dc 100644
--- a/NxWidgets/nxwm/include/capplicationwindow.hxx
+++ b/NxWidgets/nxwm/include/capplicationwindow.hxx
@@ -165,7 +165,27 @@ namespace NxWM
{
m_callback = callback;
}
- };
+
+ /**
+ * Simulate a mouse click on the minimize icon. This inline method is only
+ * used during automated testing of NxWM.
+ */
+
+ inline void clickMinimizeIcon(int index)
+ {
+ m_minimizeImage->click(0,0);
+ }
+
+ /**
+ * Simulate a mouse click on the stop applicaiton icon. This inline method is only
+ * used during automated testing of NxWM.
+ */
+
+ inline void clickStopIcon(int index)
+ {
+ m_stopImage->click(0,0);
+ }
+ };
}
#endif // __cplusplus
diff --git a/NxWidgets/nxwm/include/cnxconsole.hxx b/NxWidgets/nxwm/include/cnxconsole.hxx
index 99a9b92f2..7754276a7 100644
--- a/NxWidgets/nxwm/include/cnxconsole.hxx
+++ b/NxWidgets/nxwm/include/cnxconsole.hxx
@@ -33,8 +33,8 @@
*
****************************************************************************/
-#ifndef __INCLUDE_CNXCONSOLE_NXX
-#define __INCLUDE_CNXCONSOLE_NXX
+#ifndef __INCLUDE_CNXCONSOLE_HXX
+#define __INCLUDE_CNXCONSOLE_HXX
/****************************************************************************
* Included Files
@@ -77,12 +77,19 @@ namespace NxWM
class CNxConsole : public IApplication, private IApplicationCallback
{
- protected:
+ private:
CTaskbar *m_taskbar; /**< Reference to the "parent" taskbar */
CApplicationWindow *m_window; /**< Reference to the application window */
NXCONSOLE m_nxcon; /**< NxConsole handle */
pid_t m_pid; /**< Task ID of the NxConsole thread */
+ /**
+ * This is the NxConsole task. This function first redirects output to the
+ * console window.
+ */
+
+ static int nxconsole(int argc, char *argv[]);
+
/**
* Called when the window minimize button is pressed.
*/
@@ -170,4 +177,4 @@ namespace NxWM
}
#endif // __cplusplus
-#endif // __INCLUDE_CNXCONSOLE_NXX
+#endif // __INCLUDE_CNXCONSOLE_HXX
diff --git a/NxWidgets/nxwm/include/cstartwindow.hxx b/NxWidgets/nxwm/include/cstartwindow.hxx
index ab6b6f926..649bf3247 100644
--- a/NxWidgets/nxwm/include/cstartwindow.hxx
+++ b/NxWidgets/nxwm/include/cstartwindow.hxx
@@ -116,12 +116,6 @@ namespace NxWM
void handleClickEvent(const NXWidgets::CWidgetEventArgs &e);
- /**
- * CStartWindow Constructor
- */
-
- ~CStartWindow(void);
-
public:
/**
@@ -134,6 +128,12 @@ namespace NxWM
CStartWindow(CTaskbar *taskbar, CApplicationWindow *window);
/**
+ * CStartWindow Constructor
+ */
+
+ ~CStartWindow(void);
+
+ /**
* Each implementation of IApplication must provide a method to recover
* the contained CApplicationWindow instance.
*/
@@ -185,7 +185,7 @@ namespace NxWM
* CTaskbar when the application window must be displayed
*/
- virtual void redraw(void) = 0;
+ void redraw(void);
/**
* Add the application to the start window. The general sequence for
@@ -203,6 +203,19 @@ namespace NxWM
*/
bool addApplication(IApplication *app);
+
+ /**
+ * Simulate a mouse click on the icon at index. This inline method is only
+ * used during automated testing of NxWM.
+ */
+
+ inline void clickIcon(int index)
+ {
+ if (index < m_slots.size())
+ {
+ m_slots.at(index).image->click(0,0);
+ }
+ }
};
}
diff --git a/NxWidgets/nxwm/include/ctaskbar.hxx b/NxWidgets/nxwm/include/ctaskbar.hxx
index 1de4a7491..f5bef2054 100644
--- a/NxWidgets/nxwm/include/ctaskbar.hxx
+++ b/NxWidgets/nxwm/include/ctaskbar.hxx
@@ -101,18 +101,6 @@ namespace NxWM
TNxArray<struct STaskbarSlot> m_slots; /**< List of application slots in the task bar */
/**
- * Connect to the server
- */
-
- bool connect(void);
-
- /**
- * Disconnect from the server
- */
-
- void disconnect(void);
-
- /**
* Create a raw window.
*
* 1) Create a dumb CWigetControl instance
@@ -202,20 +190,32 @@ namespace NxWM
void handleClickEvent(const NXWidgets::CWidgetEventArgs &e);
+ public:
+ /**
+ * CTaskbar Constructor
+ *
+ * @param hWnd - NX server handle
+ */
+
+ CTaskbar(void);
+
/**
* CTaskbar Destructor
*/
~CTaskbar(void);
- public:
/**
- * CTaskbar Constructor
- *
- * @param hWnd - NX server handle
+ * Connect to the server
*/
+
+ bool connect(void);
- CTaskbar(void);
+ /**
+ * Disconnect from the server
+ */
+
+ void disconnect(void);
/**
* Initialize task bar. Task bar initialization is separate from
@@ -341,6 +341,19 @@ namespace NxWM
*/
bool stopApplication(IApplication *app);
+
+ /**
+ * Simulate a mouse click on the icon at index. This inline method is only
+ * used duringautomated testing of NxWM.
+ */
+
+ inline void clickIcon(int index)
+ {
+ if (index < m_slots.size())
+ {
+ m_slots.at(index).image->click(0,0);
+ }
+ }
};
}
diff --git a/NxWidgets/nxwm/include/nxwmconfig.hxx b/NxWidgets/nxwm/include/nxwmconfig.hxx
index a683dbd5f..d76b08098 100644
--- a/NxWidgets/nxwm/include/nxwmconfig.hxx
+++ b/NxWidgets/nxwm/include/nxwmconfig.hxx
@@ -50,11 +50,41 @@
****************************************************************************/
/* General Configuration ****************************************************/
/**
+ * Required settings:
+ *
+ * CONFIG_HAVE_CXX : C++ support is required
+ * CONFIG_NX : NX must enabled
+ * CONFIG_NX_MULTIUSER=y : NX must be configured in multiuse mode
+ * CONFIG_NXCONSOLE=y : For NxConsole support
+ *
+ * General settings:
+ *
+ * CONFIG_NXWM_DEFAULT_FONTID - the NxWM default font ID. Default:
+ * NXFONT_DEFAULT
+ */
+
+#ifndef CONFIG_HAVE_CXX
+# error "C++ support is required (CONFIG_HAVE_CXX)"
+#endif
+
+/**
* NX Multi-user support is required
*/
+#ifndef CONFIG_NX
+# error "NX support is required (CONFIG_NX)"
+#endif
+
#ifndef CONFIG_NX_MULTIUSER
-# warning "NX multi-user support is required (CONFIG_NX_MULTIUSER)"
+# error "NX multi-user support is required (CONFIG_NX_MULTIUSER)"
+#endif
+
+/**
+ * NxConsole support is (probably) required
+ */
+
+#ifndef CONFIG_NXCONSOLE
+# warning "NxConsole support may be needed (CONFIG_NXCONSOLE)"
#endif
/**
@@ -67,6 +97,27 @@
/* Colors *******************************************************************/
/**
+ * Color configuration
+ *
+ * CONFIG_NXWM_DEFAULT_BACKGROUNDCOLOR - Normal background color. Default:
+ * MKRGB(160,160,160)
+ * CONFIG_NXWM_DEFAULT_SELECTEDBACKGROUNDCOLOR - Select background color.
+ * Default: MKRGB(120,192,192)
+ * CONFIG_NXWM_DEFAULT_FOREGROUNDCOLOR - Normal "foreground" color. Default:
+ * MKRGB(192,192,192)
+ * CONFIG_NXWM_DEFAULT_SELECTEDFOREGROUNDCOLOR - Selected "foreground" color.
+ * Default: MKRGB(192,192,192)
+ * CONFIG_NXWM_DEFAULT_SHINEEDGECOLOR - Color of the bright edge of a border.
+ * Default: MKRGB(255,255,255)
+ * CONFIG_NXWM_DEFAULT_SHADOWEDGECOLOR - Color of the shadowed edge of a border.
+ * Default: MKRGB(0,0,0)
+ * CONFIG_NXWM_DEFAULT_FONTCOLOR - Default fong color. Default:
+ * MKRGB(0,0,0)
+ * CONFIG_NXWM_TRANSPARENT_COLOR - The "transparent" color. Default:
+ * MKRGB(0,0,0)
+ */
+
+/**
* Normal background color
*/
@@ -129,6 +180,23 @@
/* Task Bar Configuation ***************************************************/
/**
* Horizontal and vertical spacing of icons in the task bar.
+ *
+ * CONFIG_NXWM_TASKBAR_VSPACING - Vertical spacing. Default: 2 pixels
+ * CONFIG_NXWM_TASKBAR_HSPACING - Horizontal spacing. Default: 2 rows
+ *
+ * Task bar location. Default is CONFIG_NXWM_TASKBAR_TOP.
+ *
+ * CONFIG_NXWM_TASKBAR_TOP - Task bar is at the top of the display
+ * CONFIG_NXWM_TASKBAR_BOTTOM - Task bar is at the bottom of the display
+ * CONFIG_NXWM_TASKBAR_LEFT - Task bar is on the left side of the display
+ * CONFIG_NXWM_TASKBAR_RIGHT - Task bar is on the right side of the display
+ *
+ * CONFIG_NXWM_TASKBAR_WIDTH - Task bar thickness (either vertical or
+ * horizontal). Default: 25 + 2*spacing
+ */
+
+/**
+ * Horizontal and vertical spacing of icons in the task bar.
*/
#ifndef CONFIG_NXWM_TASKBAR_VSPACING
@@ -152,7 +220,7 @@
# warning "Multiple task bar positions specified"
# endif
#elif defined(CONFIG_NXWM_TASKBAR_LEFT)
-# if defined defined (CONFIG_NXWM_TASKBAR_RIGHT)
+# if defined (CONFIG_NXWM_TASKBAR_RIGHT)
# warning "Multiple task bar positions specified"
# endif
#elif !defined(CONFIG_NXWM_TASKBAR_RIGHT)
@@ -174,12 +242,20 @@
#endif
/* Tool Bar Configuration ***************************************************/
+/**
+ * CONFIG_NXWM_TOOLBAR_HEIGHT. The height of the tool bar in each
+ * application window. Default: Same as the thickness of the task bar.
+ */
#ifndef CONFIG_NXWM_TOOLBAR_HEIGHT
# define CONFIG_NXWM_TOOLBAR_HEIGHT CONFIG_NXWM_TASKBAR_WIDTH
#endif
/* Background Image **********************************************************/
+/**
+ * CONFIG_NXWM_BACKGROUND_IMAGE - The name of the image to use in the
+ * background window. Default:NXWidgets::g_nuttxBitmap
+ */
#ifndef CONFIG_NXWM_BACKGROUND_IMAGE
# define CONFIG_NXWM_BACKGROUND_IMAGE NXWidgets::g_nuttxBitmap
@@ -188,6 +264,9 @@
/* Start Window Configuration ***********************************************/
/**
* Horizontal and vertical spacing of icons in the task bar.
+ *
+ * CONFIG_NXWM_STARTWINDOW_VSPACING - Vertical spacing. Default: 2 pixels
+ * CONFIG_NXWM_STARTWINDOW_HSPACING - Horizontal spacing. Default: 2 rows
*/
#ifndef CONFIG_NXWM_STARTWINDOW_VSPACING
@@ -199,6 +278,20 @@
#endif
/* NxConsole Window *********************************************************/
+/**
+ * NxConsole Window Configuration
+ *
+ * CONFIG_NXWM_NXCONSOLE_PRIO - Priority of the NxConsole task. Default:
+ * SCHED_PRIORITY_DEFAULT
+ * CONFIG_NXWM_NXCONSOLE_STACKSIZE - The stack size to use when starting the
+ * NxConsole task. Default: 2048 bytes.
+ * CONFIG_NXWM_NXCONSOLE_WCOLOR - The color of the NxConsole window background.
+ * Default: MKRGB(192,192,192)
+ * CONFIG_NXWM_NXCONSOLE_FONTCOLOR - The color of the fonts to use in the
+ * NxConsole window. Default: MKRGB(0,0,0)
+ * CONFIG_NXWM_NXCONSOLE_FONTID - The ID of the font to use in the NxConsole
+ * window. Default: CONFIG_NXWM_DEFAULT_FONTID
+ */
#ifndef CONFIG_NXWM_NXCONSOLE_PRIO
# define CONFIG_NXWM_NXCONSOLE_PRIO SCHED_PRIORITY_DEFAULT