Commit Graph

61 Commits

Author SHA1 Message Date
Xiang Xiao
5720d72b71 apps: Fix the nightly build warning
src/cwindowfactory.cxx: In member function 'void Twm4Nx::CWindowFactory::redrawIcons(const nxgl_rect_s*)':
src/cwindowfactory.cxx:461:38: warning: 'iconPos.nxgl_point_s::y' may be used uninitialized in this function [-Wmaybe-uninitialized]
  461 |           iconBounds.pt2.y = iconPos.y + iconSize.h - 1;
      |                              ~~~~~~~~^
src/cwindowfactory.cxx:460:38: warning: 'iconPos.nxgl_point_s::x' may be used uninitialized in this function [-Wmaybe-uninitialized]
  460 |           iconBounds.pt2.x = iconPos.x + iconSize.w - 1;
      |                              ~~~~~~~~^

nsh_netcmds.c:424:20: warning: 'nsh_addrconv' defined but not used [-Wunused-function]
 static inline bool nsh_addrconv(FAR const char *hwstr,
                    ^
nsh_netcmds.c:446:20: warning: 'nsh_sethwaddr' defined but not used [-Wunused-function]
 static inline void nsh_sethwaddr(FAR const char *ifname,
                    ^

nsh_envcmds.c:94:21: warning: 'nsh_getdirpath' defined but not used [-Wunused-function]
 static inline char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl,
                     ^

In file included from bas.c:84:0:
bas.c: In function 'bas_interpreter':
bas_error.h:110:37: warning: left-hand operand of comma expression has no effect [-Wunused-value]
 #define NOSUCHLINE         STATIC+40, _("No such line")
                                     ^
bas.c:2425:52: note: in expansion of macro 'NOSUCHLINE'
                           FS_putChars(STDCHANNEL, (NOSUCHLINE));
                                                    ^~~~~~~~~~
bas_fs.c:107:22: warning: 'g_vt100_colormap' defined but not used [-Wunused-const-variable=]
 static const uint8_t g_vt100_colormap[8] =
                      ^~~~~~~~~~~~~~~~
<stdout>:4048:16: warning: 'input' defined but not used [-Wunused-function]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I62610b4c90e67637250cbd0107c2935c8abc542f
2020-04-13 08:32:42 -06:00
Xiang Xiao
41d88f06e7 Run codespell -w with the latest dictonary again 2020-02-23 07:10:14 -06:00
Xiang Xiao
d660492289 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:41:36 -06:00
Xiang Xiao
1154735ca6 Refine the preprocess conditional guard style 2020-01-31 11:04:10 -06:00
Xiang Xiao
e0dcfa0c55 Remove extra whitespace from files (#43)
* Remove multiple newlines at the end of file
* Remove the white space from the end of line
2020-01-31 08:29:24 -06:00
Xiang Xiao
857158451b Unify the void cast usage
1.Remove void cast for function because many place ignore the returned value witout cast
2.Replace void cast for variable with UNUSED macro

Change-Id: Ie644129a563244a6397036789c4c3ea83c4e9b09
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-02 23:21:01 +08:00
Gregory Nutt
c1bb142e18 Squashed commit of the following:
apps/graphics/tmw4nx and apps/graphics/slcd:  This seems the last of the show stopper bugs.  All seems functional.

    apps/graphics/slcd:  Correct some errors found in early texting.  Now the Twm4Nx::CClock window comes up, but there are problems with the way that the segments are being displayed.

    apps/graphicx/twm4nx:  CClock is complete and compiles correctly.  Crashes with a hardware when the clock is selected from the Main Menu, however.
2019-06-01 13:00:02 -06:00
Gregory Nutt
41765ebe81 apps/graphics/twm4nx: Fix some errors found when enabling NX keyboard support. The most important being that the mouse and keyboard drivers need to be opened non-blocking. 2019-05-26 12:37:18 -06:00
Gregory Nutt
636e3e2278 Squashed commit of the following:
apps/graphics/twm4nx:  Revise logic to detect clicks on the background image.  The original implementation had some side effects.

    apps/graphics/twm4nx:  Remove some remaining, unused stuff from TWM that was never used.  Menus need to close after the 'terminal' selection is made.  Otherwise, the menu can become buried under a newly open menu and not easily recovered.

    apps/graphics/twm4ndx:  Add a 'critical' bit to the eventID.  While resizing, all events will be ignore except those marked critical.

    apps/graphics/twm4nx:  CBackground now brings up the main menu if the background image is click.  This makes the behavior the same across all of the background except when an icon is clicked.
2019-05-23 10:20:12 -06:00
Gregory Nutt
320e660e85 apps/graphics/twm4nx: Add a configuration option to control the number of buttons in one column of the Icon Manager. The Icon Manager now long relies the default window width; now it determines a preffered window with based primarily on the font size. 2019-05-21 16:00:19 -06:00
Gregory Nutt
0a00a9950c Squashed commit of the following:
apps/graphics/twm4nx:  Adds some colors and better style control to support the CONTEMPORARY theme.  Still getting a few artifacts on the display.

    apps/graphics/twm4nx:  Use custom CWidgetStyle to force Icon background to match selected desktop background.

    apps/graphics/nxglyphs:  Add more modern looking button images for the Twm4Nx CONTEMPORARY theme

    apps/graphics/twm4nx:  Add some definitions to support Themes.  Background image is now optional.
2019-05-21 14:48:01 -06:00
Gregory Nutt
891ea23356 Squashed commit of the following:
apps/graphics/twm4nx:  Fix an uninitialized variable that was causing toolbar buttons to randomly come up enabled or disabled.  Remove some unused event definitions.

    apps/graphics/twm4nx:  Fix a calibration screen startup issue.  Make an initial calibration scrren optional
2019-05-20 12:06:06 -06:00
Gregory Nutt
a06b47394b This commit adds a calibration screen
Squashed commit of the following:

    apps/graphics/twm4nx:  The calibration seems to be functional.  Needs more testing.

    apps/graphics/twm4nx:  Extend event handling to support receiving raw, uncalibaated touchscreen inputs.  This is needed for touchscreen calibration.

    apps/graphics/twm4nx:  Extend event handling to support shutting down of externally controlled windows.  This is need to end the calibration sequence.

    apps/graphics/twm4nx:  CCalibration now compiles okay, but is missing event handling logic for touchscreen input and for window termination.

    apps/graphics/twm4nx:  Move application-related files into different directories to separate them from the core Twm4Nx files.

    apps/graphics/twm4nx:  A little more progress on calibration display.

    app/graphics/twm4ndx:  Add files that will support a calibration display.  This initial commit is simply the calibration display from NxWM and is not hooked into the configuration or build systems.

    apps/graphics/twm4ndx:  Compile out cursor support if we are using a mouse
2019-05-20 11:01:46 -06:00
Gregory Nutt
d237001bc3 apps/graphics/nxglyphs: Add a new resize cursor image. apps/graphics/twm4nx: Use new resize cursor image. 2019-05-17 10:52:16 -06:00
Gregory Nutt
6b303da968 Squashed commit of the following:
apps/graphics/twm4nx:  Clean up some build issues.

    apps/graphics/nxglyphs:  Remove some warnings due to coupling with NXWM.

    apps/graphics/twmndx:  Separate out the main() entry point for ctwm4nx.cxx.  There is functionality there that does not involve CTwm4Nx and so it is better if the main function were totally separate.
2019-05-17 08:53:25 -06:00
Gregory Nutt
5fc0e6c1a8 apps/graphics/twm4nx: During resizing, when the tool bar is drawn, the toolbar background must be redraw before the butttons and title are redrawn. 2019-05-16 16:39:13 -06:00
Gregory Nutt
e76bfbb74e Squashed commit of the following:
apps/graphics/twm4nx:  Other toolbar buttons need to be disabled while resizing.  Lots of problems if you decide to iconify or exit while resizing.  CResize now disables all buttons except for the RESIZE button while resizing.

    apps/graphics/twm4nx:  Add an event and logic to support notification of changes in the size of a window to NxTerm.

    Various updates to adapt to change in boardctl() interface.

    apps/graphics/twm4nx:  Correct an error in the NxTerm resize logic

    apps/graphics/twm4nx:  Update debug output when failures to send a message occur.  The returned value of -1 is not interested, need to show the errno value instead.

    apps/graphics/twm4nx:  Correct the maximum size of a message.  Recent changes caused message send failures because a message exceed that previous maximum size.

    apps/graphics/twm4nx:  Fix routing of redraw events.
2019-05-16 13:51:57 -06:00
Gregory Nutt
11fc2e4621 Squashed commit of the following:
apps/graphics/twm4nx:  Fix a bad width calculation.

    apps/graphics/twm4nx:  Debugging resize.  Only partially functional.

    apps/graphics/twm4nx:  Forgot to install the IEventTap instance.  No resizing kind of works, but I can't get out of it!  There is a basic problem in the window needs to be updated for the new size and there is no mechanism in place to do that (at least not with RAM backed windows).

    apps/graphics/twm4nx:  Add missing part of the resize logic.  Initial testing is mixed.  The resize window appears, but nothing else good happens.  No hardfaults though.

    apps/graphics/twm4nx:  This is a complete redesign of the CResize class.  Unverified on initial commit.

    apps/graphics/twm4nx:  Commit of in-progress resize changes
2019-05-15 17:21:25 -06:00
Gregory Nutt
e6b642308f Squashed commit of the following:
apps/graphics/nxwidgets/src/cbuttonarray.cxx:  Correct an error CButtonArray.  Was not correctly resizing the widget when the dimensions of the button array changed.

    apps/graphics/twm4nx:  Trival correcion of some typos in comments.
2019-05-15 07:55:57 -06:00
Gregory Nutt
7d28294b45 Squashed commit of the following:
apps/graphics/twm4nx:  Rename IDragEvent interface to IEventTap.  I intend to reuse this interface for window resizing as well as dragging.

    apps/graphics/twm4nx:  Some trivial elimination of some unused logic in CResize.
2019-05-14 16:55:02 -06:00
Gregory Nutt
f57ea060ea apps/graphics/twm4nx: Rename twm4nx_widgetevents.hxx to twm4m_events.hxx. The name was misleading because it includes other types of events as well. 2019-05-14 14:00:21 -06:00
Gregory Nutt
d91fb4e8c9 Squashed commit of the following:
apps/graphics/twm4nx:  In the Icon Manager, do not use the window name to identify which button press corresponds to which Window.  Window names are not unique.  Instead, it now keeps track of thich row x column was assigned to the window name.  That row x column uniquely associates a window with a button and does not depend on the window name in any way.

    apps/graphics/twm4nx:  Fix an error in event notification sent by the Icon Manager when a window is selected.

    apps/graphics/twm4nx:  Correct logic in Icon Manager for the case where the number of windows causes the Icon Manager to increase in size by one row.
2019-05-14 10:41:00 -06:00
Gregory Nutt
eeb5d4433c Squashed commit of the following:
apps/graphics/twm4nx:  Add logic to detect collisions with reserved regions in the backgroud or with other icons when moving an icon on the desktop.

    apps/graphics/twm4nx:  When moving icons, erase the old icon image before drawing the new one.
2019-05-14 08:15:36 -06:00
Gregory Nutt
75fc1a2dd3 apps/graphics/twm4nx: Icons can now be moved, but there are artifacts: Need to erase the old icon region on the background before drawing the new icon image during the move. 2019-05-13 18:09:20 -06:00
Gregory Nutt
3cd7b371d5 apps/graphics/twm4nx: Fix error in place of icons on the desktop
apps/graphics/twm4nx:  Fix several errors associated with the NxTerm buttons.  Most changes involved fixing crashes with the exit button is pressed.  Now the NxTerm windows behave well.  However, they are not receiving console input so there is still more to be done.
2019-05-13 09:09:33 -06:00
Gregory Nutt
668fe4e366 Squashed commit of the following:
apps/graphics/twm4nx:  Various fixes to get the NxTerm window to come up properly.  It does now come up okay, but the system basically loses its mind thereafter.  Goods good until some buttons are pressed.

    apps/graphics/twm4nx:  Simpify application startup.

    apps/graphics/twm4nx:  Fix some errors in debug statements.
2019-05-12 17:40:02 -06:00
Gregory Nutt
abd7c9a165 This commit incorporates the NxTerm window hosting NSH. This is just code complete and just compiles with no errors. The NxTerm item does not appear in the Main Menu, however, selecting the menu item does not yet bring up the NxTerm window.
Squashed commit of the following:

    apps/graphics/twm4nx:  Revamp the event system to support notification of external applications when the window is being closed.

    apps/graphics/twm4nx:  A little NxTerm progress

    apps/graphics/twm4nx:  Clean up some logic associated with use of multiple Icon Managers.

    apps/graphics/twm4nx:  Add CNxterm to the build.  It is a long way from compiling.
2019-05-12 11:57:45 -06:00
Gregory Nutt
77d10f9028 apps/graphics/twm4nx: Add an IApplicationFactory interface. 2019-05-11 15:48:46 -06:00
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
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