NXWidgets: NXWidgets::INxWindow Class Reference

NXWidgets 1.19

Public Types | Public Member Functions | List of all members
NXWidgets::INxWindow Class Referenceabstract

`#include <inxwindow.hxx>`

Inheritance diagram for NXWidgets::INxWindow:

## Public Types
enum | ELineCaps { LINECAP_NONE = NX_LINECAP_NONE, LINECAP_PT1 = NX_LINECAP_PT1, LINECAP_PT2 = NX_LINECAP_PT2, LINECAP_BOTH = NX_LINECAP_BOTH }

## Public Member Functions
virtual | ~INxWindow (void)
virtual bool | open (void)=0
virtual CWidgetControl * | getWidgetControl (void) const =0
virtual bool | requestPosition (void)=0
virtual bool | getPosition (FAR struct nxgl_point_s *pPos)=0
virtual bool | getSize (FAR struct nxgl_size_s *pSize)=0
virtual bool | setPosition (FAR const struct nxgl_point_s *pPos)=0
virtual bool | setSize (FAR const struct nxgl_size_s *pSize)=0
virtual bool | raise (void)=0
virtual bool | lower (void)=0
virtual void | redirectNxTerm (NXTERM handle)=0
virtual bool | setPixel (FAR const struct nxgl_point_s *pPos, nxgl_mxpixel_t color)=0
virtual bool | fill (FAR const struct nxgl_rect_s *pRect, nxgl_mxpixel_t color)=0
virtual void | getRectangle (FAR const struct nxgl_rect_s *rect, struct SBitmap *dest)=0
virtual bool | fillTrapezoid (FAR const struct nxgl_rect_s *pClip, FAR const struct nxgl_trapezoid_s *pTrap, nxgl_mxpixel_t color)=0
virtual bool | drawLine (FAR struct nxgl_vector_s *vector, nxgl_coord_t width, nxgl_mxpixel_t color, enum ELineCaps caps)=0
virtual bool | drawFilledCircle (struct nxgl_point_s *center, nxgl_coord_t radius, nxgl_mxpixel_t color)=0
virtual bool | move (FAR const struct nxgl_rect_s *pRect, FAR const struct nxgl_point_s *pOffset)=0
virtual bool | bitmap (FAR const struct nxgl_rect_s *pDest, FAR const void *pSrc, FAR const struct nxgl_point_s *pOrigin, unsigned int stride)=0

## Detailed Description

This class defines common operations on a any NX window. There are three instances that represent an NX window from the perspective of NXWidgets.

- There is one widget control instance per NX window,
- One CCallback instance per window,
- One window instance.

There a various kinds of of window instances, but each inherits (1) CCallback and dispatches the Windows callbacks and (2) INxWindow that describes the common window behavior.

Definition at line 83 of file inxwindow.hxx.

## Member Enumeration Documentation

## ◆ ELineCaps

enum NXWidgets::INxWindow::ELineCaps

Enumerator
LINECAP_NONE |
LINECAP_PT1 |
LINECAP_PT2 |
LINECAP_BOTH |

Definition at line 86 of file inxwindow.hxx.

## Constructor & Destructor Documentation

## ◆ ~INxWindow()

virtual NXWidgets::INxWindow::~INxWindow | ( | void |  | ) |
| inlinevirtual

A virtual destructor is required in order to override the INxWindow destructor. We do this because if we delete INxWindow, we want the destructor of the class that inherits from INxWindow to run, not this one.

Definition at line 101 of file inxwindow.hxx.

## Member Function Documentation

## ◆ bitmap()

virtual bool NXWidgets::INxWindow::bitmap | ( | FAR const struct nxgl_rect_s * | pDest,
|  | FAR const void * | pSrc,
|  | FAR const struct nxgl_point_s * | pOrigin,
|  | unsigned int | stride
| ) |  |
| pure virtual

Copy a rectangular region of a larger image into the rectangle in the specified window. The source image is treated as an opaque image.

Parameters

  pDest | Describes the rectangular on the display that will receive the bitmap.
  pSrc | The start of the source image.
  pOrigin | the pOrigin of the upper, left-most corner of the full bitmap. Both pDest and pOrigin are in window coordinates, however, pOrigin may lie outside of the display.
  stride | The width of the full source image in bytes.

Returns
  True on success; false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ drawFilledCircle()

virtual bool NXWidgets::INxWindow::drawFilledCircle | ( | struct nxgl_point_s * | center,
|  | nxgl_coord_t | radius,
|  | nxgl_mxpixel_t | color
| ) |  |
| pure virtual

Draw a filled circle at the specified position, size, and color.

Parameters

  center | The window-relative coordinates of the circle center.
  radius | The radius of the rectangle in pixels.
  color | The color of the rectangle.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ drawLine()

virtual bool NXWidgets::INxWindow::drawLine | ( | FAR struct nxgl_vector_s * | vector,
|  | nxgl_coord_t | width,
|  | nxgl_mxpixel_t | color,
|  | enum ELineCaps | caps
| ) |  |
| pure virtual

Fill the specified line in the window with the specified color.

Parameters

  vector | - Describes the line to be drawn
  width | - The width of the line
  color | - The color to use to fill the line
  caps | - Draw a circular cap on the ends of the line to support better line joins

Returns
  True on success; false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ fill()

virtual bool NXWidgets::INxWindow::fill | ( | FAR const struct nxgl_rect_s * | pRect,
|  | nxgl_mxpixel_t | color
| ) |  |
| pure virtual

Fill the specified rectangle in the window with the specified color.

Parameters

  pRect | The location to be filled.
  color | The color to use in the fill.

Returns
  True on success; false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ fillTrapezoid()

virtual bool NXWidgets::INxWindow::fillTrapezoid | ( | FAR const struct nxgl_rect_s * | pClip,
|  | FAR const struct nxgl_trapezoid_s * | pTrap,
|  | nxgl_mxpixel_t | color
| ) |  |
| pure virtual

Fill the specified trapezoidal region in the window with the specified color.

Parameters

  pClip | Clipping rectangle relative to window (may be null).
  pTrap | The trapezoidal region to be filled.
  color | The color to use in the fill.

Returns
  True on success; false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ getPosition()

virtual bool NXWidgets::INxWindow::getPosition | ( | FAR struct nxgl_point_s * | pPos | ) |
| pure virtual

Get the position of the window (as reported by the NX callback).

Returns
  The position.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ getRectangle()

virtual void NXWidgets::INxWindow::getRectangle | ( | FAR const struct nxgl_rect_s * | rect,
|  | struct SBitmap * | dest
| ) |  |
| pure virtual

Get the raw contents of graphic memory within a rectangular region. NOTE: Since raw graphic memory is returned, the returned memory content may be the memory of windows above this one and may not necessarily belong to this window unless you assure that this is the top window.

Parameters

  rect | The location to be copied
  dest | - The describes the destination bitmap to receive the graphics data.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ getSize()

virtual bool NXWidgets::INxWindow::getSize | ( | FAR struct nxgl_size_s * | pSize | ) |
| pure virtual

Get the size of the window (as reported by the NX callback).

Returns
  The size.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ getWidgetControl()

virtual CWidgetControl* NXWidgets::INxWindow::getWidgetControl | ( | void |  | ) | const
| pure virtual

Each implementation of INxWindow must provide a method to recover the contained CWidgetControl instance.

Returns
  The contained CWidgetControl instance

Implemented in NXWidgets::CBgWindow, NXWidgets::CNxTkWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ lower()

virtual bool NXWidgets::INxWindow::lower | ( | void |  | ) |
| pure virtual

Lower the window to the bottom of the display.

Returns
  OK on success; ERROR on failure with errno set appropriately.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ move()

virtual bool NXWidgets::INxWindow::move | ( | FAR const struct nxgl_rect_s * | pRect,
|  | FAR const struct nxgl_point_s * | pOffset
| ) |  |
| pure virtual

Move a rectangular region within the window.

Parameters

  pRect | Describes the rectangular region to move.
  pOffset | The offset to move the region.

Returns
  True on success; false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ open()

virtual bool NXWidgets::INxWindow::open | ( | void |  | ) |
| pure virtual

Creates a new window. Window creation is separate from object instantiation so that window creation failures can be properly reported.

Returns
  True if the window was successfully created.

Implemented in NXWidgets::CBgWindow, NXWidgets::CNxTkWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ raise()

virtual bool NXWidgets::INxWindow::raise | ( | void |  | ) |
| pure virtual

Bring the window to the top of the display.

Returns
  OK on success; ERROR on failure with errno set appropriately.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ redirectNxTerm()

virtual void NXWidgets::INxWindow::redirectNxTerm | ( | NXTERM | handle | ) |
| pure virtual

Each window implementation also inherits from CCallback. CCallback, by default, forwards NX keyboard input to the various widgets residing in the window. But NxTerm is a different usage model; In this case, keyboard input needs to be directed to the NxTerm character driver. This method can be used to enable (or disable) redirection of NX keyboard input from the window widgets to the NxTerm

Parameters

  handle. | The NXTERM handle. If non-NULL, NX keyboard input will be directed to the NxTerm driver using this handle; If NULL (the default), NX keyboard input will be directed to the widgets within the window.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ requestPosition()

virtual bool NXWidgets::INxWindow::requestPosition | ( | void |  | ) |
| pure virtual

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 data as provided by the callback.

Returns
  OK on success; ERROR on failure with errno set appropriately.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ setPixel()

virtual bool NXWidgets::INxWindow::setPixel | ( | FAR const struct nxgl_point_s * | pPos,
|  | nxgl_mxpixel_t | color
| ) |  |
| pure virtual

Set an individual pixel in the window with the specified color.

Parameters

  pPos | The location of the pixel to be filled.
  color | The color to use in the fill.

Returns
  True on success; false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ setPosition()

virtual bool NXWidgets::INxWindow::setPosition | ( | FAR const struct nxgl_point_s * | pPos | ) |
| pure virtual

Set the position and size of the window.

Parameters

  pPos | The new position of the window.

Returns
  True on success, false on failure.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

## ◆ setSize()

virtual bool NXWidgets::INxWindow::setSize | ( | FAR const struct nxgl_size_s * | pSize | ) |
| pure virtual

Set the size of the selected window.

Parameters

  pSize | The new size of the window.

Returns
  OK on success; ERROR on failure with errno set appropriately.

Implemented in NXWidgets::CNxTkWindow, NXWidgets::CBgWindow, NXWidgets::CNxWindow, and NXWidgets::CNxToolbar.

The documentation for this class was generated from the following file:

- inxwindow.hxx