wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// apps/graphics/twm4nx/src/cwindowevent.hxx
|
|
|
|
// Shim to manage the interface between NX messages and NxWidgets
|
|
|
|
//
|
|
|
|
// Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
|
|
|
// Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions
|
|
|
|
// are met:
|
|
|
|
//
|
|
|
|
// 1. Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer in
|
|
|
|
// the documentation and/or other materials provided with the
|
|
|
|
// distribution.
|
|
|
|
// 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
// used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOWEVENT_HXX
|
|
|
|
#define __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOWEVENT_HXX
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Included Files
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2019-05-01 19:11:43 +02:00
|
|
|
#include <cstdbool>
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
#include <mqueue.h>
|
|
|
|
|
|
|
|
#include "graphics/nxwidgets/cwindoweventhandler.hxx"
|
|
|
|
#include "graphics/nxwidgets/cwidgetstyle.hxx"
|
|
|
|
#include "graphics/nxwidgets/cwidgetcontrol.hxx"
|
|
|
|
#include "graphics/twm4nx/twm4nx_widgetevents.hxx"
|
|
|
|
#include "graphics/twm4nx/ctwm4nx.hxx"
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Implementation Classes
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
namespace Twm4Nx
|
|
|
|
{
|
2019-05-08 00:16:47 +02:00
|
|
|
/**
|
|
|
|
* This abstract base class provides add on methods to support dragging
|
|
|
|
* of a window.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class IDragEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* A virtual destructor is required in order to override the ITextBox
|
|
|
|
* destructor. We do this because if we delete ITextBox, we want the
|
|
|
|
* destructor of the class that inherits from ITextBox to run, not this
|
|
|
|
* one.
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual ~IDragEvent(void) { }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is called when there is any moved of the mouse or
|
|
|
|
* touch position that would indicate that the object is being moved.
|
|
|
|
*
|
|
|
|
* @param pos The current mouse/touch X/Y position in toolbar relative
|
|
|
|
* coordinates.
|
2019-05-08 02:20:42 +02:00
|
|
|
* @param arg The user-argument provided that accompanies the callback
|
|
|
|
* @return True: if the drag event was processed; false it is was
|
2019-05-08 00:16:47 +02:00
|
|
|
* ignored. The event should be ignored if there is not actually
|
|
|
|
* a drag event in progress
|
|
|
|
*/
|
|
|
|
|
2019-05-08 02:20:42 +02:00
|
|
|
virtual bool dragEvent(FAR const struct nxgl_point_s &pos,
|
|
|
|
uintptr_t arg) = 0;
|
2019-05-08 00:16:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is called if the mouse left button is released or
|
|
|
|
* if the touchscrreen touch is lost. This indicates that the
|
|
|
|
* dragging sequence is complete.
|
|
|
|
*
|
|
|
|
* @param pos The last mouse/touch X/Y position in toolbar relative
|
|
|
|
* coordinates.
|
2019-05-08 02:20:42 +02:00
|
|
|
* @param arg The user-argument provided that accompanies the callback
|
|
|
|
* @return True: If the drag event was processed; false it is was
|
2019-05-08 00:16:47 +02:00
|
|
|
* ignored. The event should be ignored if there is not actually
|
|
|
|
* a drag event in progress
|
|
|
|
*/
|
|
|
|
|
2019-05-08 02:20:42 +02:00
|
|
|
virtual bool dropEvent(FAR const struct nxgl_point_s &pos,
|
|
|
|
uintptr_t arg) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is dragging enabled?
|
|
|
|
*
|
|
|
|
* @param arg The user-argument provided that accompanies the callback
|
|
|
|
* @return True: If the dragging is enabled.
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual bool isDragging(uintptr_t arg) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable/disable dragging
|
|
|
|
*
|
|
|
|
* @param enable. True: Enable dragging
|
|
|
|
* @param arg The user-argument provided that accompanies the callback
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void setDragging(bool enable, uintptr_t arg) = 0;
|
2019-05-08 00:16:47 +02:00
|
|
|
};
|
|
|
|
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
/**
|
|
|
|
* The class CWindowEvent integrates the widget control with some special
|
|
|
|
* handling of mouse and keyboard inputs needs by NxWM. It use used
|
|
|
|
* in place of CWidgetControl whenever an NxWM window is created.
|
|
|
|
*
|
|
|
|
* CWindowEvent cohabitates with CWidgetControl only because it needs the
|
|
|
|
* CWidgetControl as an argument in its messaging.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class CWindowEvent : public NXWidgets::CWindowEventHandler,
|
|
|
|
public NXWidgets::CWidgetControl
|
|
|
|
{
|
|
|
|
private:
|
2019-05-08 02:20:42 +02:00
|
|
|
FAR CTwm4Nx *m_twm4nx; /**< Cached instance of CTwm4Nx */
|
|
|
|
mqd_t m_eventq; /**< NxWidget event message queue */
|
|
|
|
FAR void *m_object; /**< Window object (context specific) */
|
2019-05-10 23:22:27 +02:00
|
|
|
uint16_t m_redrawEvent; /**< Redraw event ID */
|
|
|
|
uint16_t m_mouseEvent; /**< Mouse/touchscreen event ID */
|
|
|
|
uint16_t m_kbdEvent; /**< Keyboard event ID */
|
2019-05-08 00:16:47 +02:00
|
|
|
|
|
|
|
// Dragging
|
|
|
|
|
2019-05-08 02:20:42 +02:00
|
|
|
FAR IDragEvent *m_dragHandler; /**< Drag event handlers (may be NULL) */
|
|
|
|
uintptr_t m_dragArg; /**< User argument associated with callback */
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
|
2019-05-01 19:11:43 +02:00
|
|
|
// Override CWidgetEventHandler virtual methods ///////////////////////
|
|
|
|
|
2019-05-02 22:41:53 +02:00
|
|
|
/**
|
|
|
|
* Handle a NX window redraw request event
|
|
|
|
*
|
|
|
|
* @param nxRect The region in the window to be redrawn
|
|
|
|
* @param more More redraw requests will follow
|
|
|
|
*/
|
2019-05-01 19:11:43 +02:00
|
|
|
|
2019-05-02 22:41:53 +02:00
|
|
|
void handleRedrawEvent(FAR const nxgl_rect_s *nxRect, bool more);
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
|
|
|
|
#ifdef CONFIG_NX_XYINPUT
|
|
|
|
/**
|
|
|
|
* Handle an NX window mouse input event.
|
|
|
|
*/
|
|
|
|
|
2019-05-08 00:16:47 +02:00
|
|
|
void handleMouseEvent(FAR const struct nxgl_point_s *pos,
|
|
|
|
uint8_t buttons);
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_NX_KBD
|
|
|
|
/**
|
|
|
|
* Handle a NX window keyboard input event.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void handleKeyboardEvent(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle a NX window blocked event
|
|
|
|
*
|
|
|
|
* @param arg - User provided argument (see nx_block or nxtk_block)
|
2019-05-02 22:41:53 +02:00
|
|
|
*/
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
|
|
|
|
void handleBlockedEvent(FAR void *arg);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CWindowEvent Constructor
|
|
|
|
*
|
2019-05-02 22:41:53 +02:00
|
|
|
* @param twm4nx The Twm4Nx session instance.
|
|
|
|
* @param obj Contextual object (Usually 'this' of instantiator)
|
2019-05-10 23:22:27 +02:00
|
|
|
* @param redrawEvent The event to send on window redraw events. This
|
|
|
|
* may be EVENT_SYSTEM_NOP to ignore all rdraw events.
|
|
|
|
* @param mouseEvent The event to send on mouse/touchscreen input
|
|
|
|
* events. This may be EVENT_SYSTEM_NOP to ignore all mouse/
|
|
|
|
* touchscreen input events.
|
|
|
|
* @param kbdEvent The event to send on keyboard input events. This
|
|
|
|
* may be EVENT_SYSTEM_NOP to ignore all keyboard input events.
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
* @param style The default style that all widgets on this display
|
|
|
|
* should use. If this is not specified, the widget will use the
|
|
|
|
* values stored in the defaultCWidgetStyle object.
|
|
|
|
*/
|
|
|
|
|
2019-05-02 22:41:53 +02:00
|
|
|
CWindowEvent(FAR CTwm4Nx *twm4nx, FAR void *obj,
|
2019-05-10 23:22:27 +02:00
|
|
|
uint16_t redrawEvent, uint16_t mouseEvent,
|
|
|
|
uint16_t kbdEvent,
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
FAR const NXWidgets::CWidgetStyle *style =
|
|
|
|
(const NXWidgets::CWidgetStyle *)NULL);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CWindowEvent Destructor.
|
|
|
|
*/
|
|
|
|
|
2019-05-08 00:16:47 +02:00
|
|
|
~CWindowEvent(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register an IDragEvent instance to provide callbacks when mouse
|
|
|
|
* movement is received. A mouse movement with the left button down
|
|
|
|
* or a touchscreen touch movement are treated as a drag event.
|
|
|
|
* Release of the mouse left button or loss of the touchscreen touch
|
|
|
|
* is treated as a drop event.
|
|
|
|
*
|
|
|
|
* @param cb A reference to the IDragEvent callback interface.
|
|
|
|
*/
|
|
|
|
|
2019-05-08 02:20:42 +02:00
|
|
|
inline void registerDragEventHandler(FAR IDragEvent *dragHandler,
|
|
|
|
uintptr_t arg)
|
2019-05-08 00:16:47 +02:00
|
|
|
{
|
|
|
|
m_dragHandler = dragHandler;
|
2019-05-08 02:20:42 +02:00
|
|
|
m_dragArg = arg;
|
2019-05-08 00:16:47 +02:00
|
|
|
}
|
2019-05-10 23:22:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Modify event handlers.
|
|
|
|
*
|
|
|
|
* One use for this is by the window drag logic to temporarily capture
|
|
|
|
* application mouse/touchscreen inputs to handle cases where the drag
|
|
|
|
* position enters the application window area.
|
|
|
|
*
|
|
|
|
* @param redrawEvent The event to send on window redraw events. This
|
|
|
|
* may be EVENT_SYSTEM_NOP to ignore all rdraw events.
|
|
|
|
* @param mouseEvent The event to send on mouse/touchscreen input
|
|
|
|
* events. This may be EVENT_SYSTEM_NOP to ignore all mouse/
|
|
|
|
* touchscreen input events.
|
|
|
|
* @param kbdEvent The event to send on keyboard input events. This
|
|
|
|
* may be EVENT_SYSTEM_NOP to ignore all keyboard input events.
|
|
|
|
*/
|
|
|
|
|
|
|
|
inline bool configureEvents(FAR void *obj, uint16_t redrawEvent,
|
|
|
|
uint16_t mouseEvent, uint16_t kbdEvent)
|
|
|
|
{
|
|
|
|
m_object = obj; // Event object reference
|
|
|
|
m_redrawEvent = redrawEvent; // Redraw event ID
|
|
|
|
m_mouseEvent = mouseEvent; // Mouse/touchscreen event ID
|
|
|
|
m_kbdEvent = kbdEvent; // Keyboard event ID
|
|
|
|
return true;
|
|
|
|
}
|
wm4Nx is a port of twm, Tab Window Manager (or Tom's Window Manager)
version 1.0.10 to NuttX NX windows server. No, a port is not the right
word. It is a re-design of TWM from the inside out to work with the NuttX
NX server. The name Twm4Nx reflects this legacy. But Twm4Nx is more a
homage to TWM than a port of TWM.
The original TWM was based on X11 which provides a rich set of features.
TWM provided titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven keyboard
focus, graphic contexts, and user-specified key and pointer button bindings,
etc.
Twm4Nx, on the other hand is based on the NuttX NX server which provides
comparatively minimal support. Additional drawing support comes from
the NuttX NxWidgets library (which necessitated the change to C++).
Twm4Nx is greatly stripped down and targeted on small embedded systems
with minimal resources. For example, no assumption is made about the
availability of a file system; no .twmrc file is used. Bitmaps are not
used (other than for fonts).
The TWM license is, I believe compatible with the BSD license used by NuttX.
The origin TWM license required notice of copyrights within each file and
a full copy of the original license which you can find in the COPYING file.
within this directory.
STATUS:
This port was brutal. Much TWM logic was removed because it depending on X11 features (or just because I could not understand how to use it). The logic is partial. A lot more needs to be done to have a complete system (hence, it is marked EXPERIMENTAL). The kinds of things that need to done are:
1. Update some logic that is only fragmentary for how like resizing, and menus.
2. Integrate NxWidgets into the windows: The resize menu needs a CLabel, the menus are CListBox'es, but not completely integrated, the Icon Manager needs to be a button array.
3. Resit Icons. They are windows now, but need to be compound widgets lying on the background.
4. Widget events are only partially integrated. A lot more needs to be done. A partial change to thoe event system that hints at the redesign is in place but it is far from complete.
2019-04-26 00:54:17 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __APPS_INCLUDE_GRAPHICS_TWM4NX_CWINDOWEVENT_HXX
|