Commit Graph

4122 Commits

Author SHA1 Message Date
Gregory Nutt
c6802efc38 apps/graphics/twm4nx: Modify how applications register with the main menu. Add logic to support all possible menu selection notification methods: But putting up a subment, by starting an application, or be sending an event. 2019-05-11 13:17:19 -06:00
Gregory Nutt
2b2e17d126 Squashed commit of the following:
apps/graphics/twm4nx:  Add new logic to place an icon at a reasonable spot on the background.

    apps/graphics/twm4nx:  Remove some unused logic.
2019-05-11 09:47:27 -06:00
Dave Marples
80de28c865 apps/system/spi: I needed a small test tool for spi in the style of the i2c tool, but I didn't see one so I've hacked one out of the i2c tool source. 2019-05-10 18:14:44 -06:00
Gregory Nutt
dbb5211060 Squashed commit of the following:
apps/graphics/twm4nx:  This resolves the problems noted in the previous commit comments.  Window events are now communicated properly to the appliation-specific event handler.  Menus now seem to be receiving events and working well.

    apps/graphics/twm4nx:  Revamp application event handler.  Better design but still crashes when a main menu entry is clicked.

    apps/graphics/twm4nx:  First cut at application window event distribution.  Has some issues.  Not ready for prime time.

    apps/graphics/twm4nx:  Add more controls for the events that will be generated on basic window redraw, mouse/keyboard input, and keyboard input.

    apps/graphpics/twm4nx:  Add a 'Desktop' item to the main menu that will iconify all windows and menus and just show the open desktop.
2019-05-10 15:22:27 -06:00
Gregory Nutt
28b4be1913 Squashed commit of the following:
apps/graphics/twm4nx:  Remove some unnecessary twiddling with widget settings.

    apps/graphics/twm4nx:  Correct an error in how menu windows are created.

    apps/graphics/twm4nx:  Use button array vs list box for menus.
2019-05-10 09:20:43 -06:00
Gregory Nutt
71de56bca8 Squashed commit of the following:
apps/graphics/twm4nx: Mostly cosmetic stuff.

    apps/graphics/twm4ndx:  In icon manager, fixing some places where width was used when height was intended.  Fixe uninitialized variable.
2019-05-09 17:54:01 -06:00
Gregory Nutt
06f479c471 Squashed commit of the following:
apps/graphics/twm4nx:  The Icon Manager now adds a Main Menu entry that will de-iconify the Icon Manager or raise to the top of the hieararchy if not iconfified.  This is useful when there are many open windows.

    apps/graphics/twm4nx:  In resize operation, don't let window get narrower than the minimum toolbar width.

    apps/graphics/twm4nx:  Add logic so that the main menu is place at (or near) the position where the background was clicked.

    apps/graphics/twm4nx:  Better integrate menus and iconifiction:  Bringup up a menu is like de-iconifcation, except there is no icon to be erases; taking down a menu is like iconification except that there is no icon to present.

    apps/graphics/nxwidgets:  Add methods to all windows to query if a window is visible or hidden.

    apps/graphics/twm4nx:  Use NxWidgets methods which work in all contexts instead of trying to come up with a way to know if a window is displayed through complex flags.
2019-05-09 13:31:12 -06:00
Gregory Nutt
fea0109ab3 Squashed commit of the following:
apps/graphics/twm4nx:  CWindow: Add a global function that can be used to determine the minimum width of a window.  If the window is set to a width smaller than this, then toolbar items will overlap and the toolbar will be corrupted.  This is a global function (rather than a method of CWindow) because in some cases, this minimum width must be known before the window is created.

    apps/graphics/twm4nx:  CMenus now uses CWindows, rather that raw NX windows.  This rippled through to many other things due to conflicts between NUL-terminated C strings and NXWidgets::CNxStrings.
2019-05-08 22:11:28 -06:00
Gregory Nutt
944fd507fe With these changes, the main menu appears when any location on the background no occupied by an icon is clicked.
apps/graphics/nxwidgets:  CWidgetControl::handleLeftClick now returns a value to indicate if the click was actually processed or not.  CWidgetControl::pollMouseEvents:  Correct return value.

apps/graphics/twm4nx:  CBackground::event():  Implement logic to handle a left click on the background and to bring up the main Menu.  CWindowEvent: Extend message to distinguish between keyboard and mouse input.  Mouse position and buttons now accompany the mouse input data. CMenus: Add methods to query and control the visibility of the menu.
2019-05-08 15:28:06 -06:00
Gregory Nutt
9e1257deed apps/graphics/twm4nx: (1) Update the README file, (2) add initial files to support an NxTerm application. On this initial commit, these are just the NxWM NxTerm files with some renaming. That are not finished and have not yet been hooked into the build system. Some applicatino is needed in order to verify the functionality of the main menu. 2019-05-08 11:15:44 -06:00
Gregory Nutt
598bf28f34 apps/graphics/twm4nx: Extend the IDragEvents interfaces and user's thereof to better handle the cases when dragging where the mouse position gets ahead of the window updates and the reported mouse position lies not in the toolbar window, but in the main window or even outside of the window. 2019-05-07 18:20:42 -06:00
Gregory Nutt
d244b7a11d Squashed commit of the following:
apps/graphics/twm4nx:  Additional redesign.  Window draggin now sort of works in an unreliable hurky-gurky way.  More to be done.

    apps/graphics/twm4nx:  First cut at redesigned dragging logic
2019-05-07 16:16:47 -06:00
Gregory Nutt
b0d39372fb apps/graphics/twm4nx: Exploit the new feature to create hidden windows. This cleans up some brief window startup anomalies. Also fixes an initialization error in CMenus. 2019-05-07 08:51:37 -06:00
Gregory Nutt
b512ec0235 Trival removal of spaces dangling at the end of lines. 2019-05-06 18:13:03 -06:00
Gregory Nutt
eaffa13f54 Squashed commit of the following:
apps/graphics/twm4nx:  Replace most usage of NUL-terminated C strings with NXWidgets::CNxString.

    apps/graphics/twm4nx:  Add initial support for the main menu.  The main menu will come up when a left click is performed on the background.  The main menu is used for starting applications.  The adds the CMainMenu class that implements the main menu and an IApplication interface class the provides th template for how any external C++ application can add itself to the Main Menu.

    Still missing is the logic that responds to the meny item selection and sends the event to the Main Menu as well as the logic in the Main Menu that handles the event and either brings up a sub-menu or starts and application.

    Things are still basically functional after these changes, but my gut feeling is these changes added some instabilities that will need to be smoothed out.
2019-05-06 18:10:45 -06:00
Gregory Nutt
02c148e07e Squashed commit of the following:
apps/graphics/twm4nx:  Try to improve icon text spacing.  Not noticeably better, however.

    apps/graphics:  Split long icon title on two lines below the icon image.

    apps/graphics/twm4nx:  Both iconification and de-iconification work.

    apps/graphics/twm4nx: Various fixed toward de-iconifying a window.  Progress but still not there yet.
2019-05-06 12:05:53 -06:00
Gregory Nutt
1879949cdc apps/graphics/twm4nx: Add logic to hide the window when it is iconified and restore the window when it is de-iconfied. Iconification works, de-iconification does not. 2019-05-05 15:23:50 -06:00
Gregory Nutt
1e4dfd7193 apps/graphics/twm4nx: Trying (unsuccessfully so far) to get events from iconified windows. 2019-05-05 11:50:08 -06:00
Gregory Nutt
64cf50e2eb graphics/twm4nx/src/cbackground.cxx: Add logic to handle polling for background icon events.
graphics/twm4nx/src/window.cxx:  Add flags to CWindow initializer to support customization of toolbar buttons and other window properties.  Add framework to handle toolbar button presses.  Window minimization (aka, iconification) does not work.

graphics/twm4nx/src/input.cxx:  Add support to scaling touchscreen.  Not needed for the current testing because the touchscreen naturally matches the display size.  But will be needed, along with calibration scren, in the future.
2019-05-05 10:23:46 -06:00
Gregory Nutt
f64df4a376 apps/graphics/twm4nx: Additional changes needed to use touchscreen with no keyboard. 2019-05-04 14:51:49 -06:00
Gregory Nutt
afbb51eb1e apps/graphics/twm4nx: Add option to use touschreen instead of mouse input. 2019-05-04 12:26:14 -06:00
Gregory Nutt
f3b3d1fc72 apps/graphics/NxWidgets: CNxTkWindow, CNxWindow, CNxServer: Add support to create RAM backed windows.
apps/graphics/twm4nx:  IconMgr window now comes up correctly.  Need to revisit window width setup.  All windows are no created as RAM backed windows.
2019-05-04 11:45:15 -06:00
Gregory Nutt
b5ae79b8f3 graphics/twm4nx/Kconfig: Add configuration disable keyboard/mouse input for testing purposes.
graphics/twm4nx/src/ciconmgr.cxx:  Correct initial window size and position in the upper righthand corner;  Need to fill draw the button array immediately on window creation.

graphics/twm4nx/src/cwindow.cxx:  Need to fill the toolbar initially with the widget background color.
2019-05-04 10:33:16 -06:00
Gregory Nutt
e50bbaac3a graphics/twm4nx/src/cbackground.cxx: Should set the initial background color immediately without waiting for a redraw. 2019-05-04 07:47:00 -06:00
Gregory Nutt
9eb7db731e apps/graphics/twm4nx: Fix a common typo: backgound vs background. 2019-05-03 10:47:04 -06:00
Sebastien Lorquet
fc7aa92b57 apps/netutils/libcurl4nx: This is an initial comit libcurl4nx. It is not complete yet, but I still wish to commit the unfinished bits to describe the roadmap, and because it is already usable. It will be updated and fixed in the future weeks and months, certainly including POST support and later, SSL.
Some improvements could be made by anyone.  For example, I know the main routine in perform() shall be split into several parts for readability. I apologize in advance for this kind of spaghetti code, but I was short on time to refactor it.  Also chunked HTTP transfer encoding would be a nice contribution from anyone interested. It is detected but not yet supported.
2019-05-03 07:26:13 -06:00
Gregory Nutt
445e0eef79 apps/graphic/twm4nx: Fix junk varialbe that was shadowing variable of the same name in the base CNxWidget class. Resolves all start up crash issues. Now I need to figure out why the host VNC client drops the connection. 2019-05-02 16:40:10 -06:00
Gregory Nutt
2fff83d60d apps/graphics/twm4nx: Correct design of input event logic. Still getting a hardfault. 2019-05-02 14:41:53 -06:00
Gregory Nutt
358f32bfdc Squashed commit of the following:
apps/graphics/twm4nx:  Fix various bugs found in bringup:  Re-order object instantiation to account for inter-object dependencies.  Correct mq_receive() buffer size.  Fix a backward comparison.

    apps/graphics/twm4nx:  Twm4Nx debug can now be separately enabled so that it does not get overwhelmed by other graphics debug output.
2019-05-02 09:19:45 -06:00
Gregory Nutt
a11f55ca4c apps/graphics/twm4nx: Fixes two bugs. Now gets further but is still non-functional. 2019-05-01 14:54:54 -06:00
Gregory Nutt
278b40b766 include/graphics/nxwidgets/cwidgetcontrol.hxx: Add handshare to getWindowHandle() to avoid returning a NULL handle. But now Twm4Nx hangs waiting for the non-NULL handle, 2019-05-01 12:19:14 -06:00
Gregory Nutt
f730108adb Squashed commit of the following:
apps/graphics/NxWidgets:  Fix a possible deadlock condition when waiting for window geometry data that will never come.  Fixed by re-requesting geometry data if we don't already have it.

    apps/graphics/twm4nx:  Add some debug output.

    apps/graphics/twm4nx:  Rethink how background events are handled.

    apps/grephics/twm4nx:  Expermimental organization to capture background events.
2019-05-01 11:11:43 -06:00
Gregory Nutt
8f5944c4a8 Squashed commit of the following:
include/ and netutils/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    nshlib/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    system/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    testing/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
    examples/:  Remove references to CONFIG_DISABLE_SIGNALS.  Signals can no longer be disabled.
2019-04-29 14:53:38 -06:00
Gregory Nutt
ad57b3de4d apps/graphics/twm4nx: Add options to initialize the system via boardctl() and to bring up the network using the new apps/netutils/netinit. This latter is only necessary because VNC is being used to provide graphics. 2019-04-29 11:49:15 -06:00
Gregory Nutt
94a0d92b54 This commit removes the private network initialization logic from NSH and puts in a common location at apps/netutils/netinit. Now that netork initialization logic can be used by applications that do not include NSH.
Squashed commit of the following:

    apps/nshlib:  Remove NSH initialization.  Now uses the common apps/netutils/netinit logic (which was cloned from nshlib to begin with).

    apps/netutils/netinit:  Clone network initialization logic from NSH to this directory so that it can be available for general use.
2019-04-29 10:22:56 -06:00
Gregory Nutt
6a970ec4e9 apps/graphics/twm4nx: Suppress input thread if using the VNC server. We don't need to catch input fromo keyboard and mouse devices in that case; those inputs will be injected into NX directly by the VNC server. Includes a couple of fixes from initial bringup attempts. 2019-04-28 12:47:49 -06:00
Gregory Nutt
e742f97674 Squashed commit of the following:
apps/graphics/twm4nx:  Remove Icon Windows; replace with IconWidgets that are draw on the background.
    apps/graphics/twm4nx:  Add CIconWidget event generation.
    apps/graphics/twm4nx:  Add event handling logic to CIconWidget.
2019-04-28 09:24:05 -06:00
Gregory Nutt
07b6eb555c Trivial changes from review of last PR 2019-04-28 06:47:03 -06:00
raiden00pl
75aca388a4 Merged in raiden00/apps/cjson (pull request #175)
netutils: support for the current version of cJSON

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-04-28 12:34:20 +00:00
raiden00pl
0a6726bc3e Merged in raiden00/apps (pull request #174)
Small fixes

examples/pca9635/pca9635_main.c: fix compilation

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-04-28 11:33:21 +00:00
Gregory Nutt
0c6f41912c apps/graphics/twm4nx: Add compount widget CIconWidget. This will eventually replace the icon Windows with widgets that can be drawn on the Background. 2019-04-27 17:53:02 -06:00
Gregory Nutt
9030bf631d apps/graphics/twm4nx: Flesh out some of the Resize logic. Still missing the pull events needed to do the resize. 2019-04-27 12:05:18 -06:00
Gregory Nutt
c144919a4e apps/graphics/twm4nx: Finsh menu-related event handling. Extended menu handling. Allow external application event handling using a new base class (CTwm4NxEvent). 2019-04-27 09:35:05 -06:00
Gregory Nutt
ba58654955 apps/graphics/twm4nx: In order for widgets too draw the correct window or toolbar, it is necessary to get the CWidgetControl instance from the window we want to use, not to create a new instance. 2019-04-26 14:30:55 -06:00
Sebastien Lorquet
fe0954cd62 netutils/netlib/netlib_parseurl.c: Add a more flexible version of netlib_parsehttpurl. This one can parse any URL, and is extensible so future improvements keep the same API. 2019-04-26 13:08:38 -06:00
Gregory Nutt
601659ff59 Squashed commit of the following:
graphics/twm4nx/src/ciconmgr.cxx:  Integrate use of CButtonArray; implement first cut at event handling.

    graphics/nxwidgets/src/cbuttonarray.cxx:  Add a method to CButtonArray that will allow us to dynamically resize the array (at the cost of losing all button labels).

    graphics/twm4nx/src/ciconmgr.cxx:  Add some fragments of CButtonArray logic.

    graphics/twm4nx/src/cwindow.cxx:  Finishes first cut at window event management.
2019-04-26 12:50:35 -06:00
Gregory Nutt
27194275a5 apps/graphics/twm4nx: Update the README. 2019-04-25 17:58:28 -06:00
Gregory Nutt
950b4cb604 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-25 16:54:17 -06:00
Gregory Nutt
04a05b3e7b apps/system/nxplayer: Fix compile problems when audio debug is enabled. 2019-04-23 11:07:20 -06:00
Gregory Nutt
8c48db8176 graphics/nxglyphs/include/mkcursor.c: Correct file header comments. 2019-04-22 17:01:20 -06:00